From 92415bad8be9ed02ef3c2bf71c2644821a90d5d7 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 28 Jan 2020 17:05:29 -0500 Subject: [PATCH 1/2] Wrapped all accessors in convertor files in has___() condition. --- org.hl7.fhir.convertors/pom.xml | 7 + .../convertors/conv10_30/Account10_30.java | 64 +- .../conv10_30/Appointment10_30.java | 116 +- .../conv10_30/AppointmentResponse10_30.java | 64 +- .../convertors/conv10_30/AuditEvent10_30.java | 304 +- .../fhir/convertors/conv10_30/Basic10_30.java | 40 +- .../convertors/conv10_30/Binary10_30.java | 16 +- .../convertors/conv10_30/Bundle10_30.java | 164 +- .../convertors/conv10_30/CarePlan10_30.java | 224 +- .../conv10_30/ClinicalImpression10_30.java | 92 +- .../conv10_30/Communication10_30.java | 104 +- .../conv10_30/CommunicationRequest10_30.java | 120 +- .../conv10_30/Composition10_30.java | 216 +- .../convertors/conv10_30/ConceptMap10_30.java | 201 +- .../convertors/conv10_30/Condition10_30.java | 144 +- .../conv10_30/Conformance10_30.java | 612 +++- .../convertors/conv10_30/Contract10_30.java | 436 ++- .../conv10_30/DataElement10_30.java | 137 +- .../conv10_30/DetectedIssue10_30.java | 88 +- .../convertors/conv10_30/Device10_30.java | 124 +- .../conv10_30/DeviceComponent10_30.java | 104 +- .../conv10_30/DeviceMetric10_30.java | 104 +- .../conv10_30/DeviceUseStatement10_30.java | 68 +- .../conv10_30/DiagnosticReport10_30.java | 144 +- .../conv10_30/DocumentManifest10_30.java | 120 +- .../conv10_30/DocumentReference10_30.java | 240 +- .../convertors/conv10_30/Encounter10_30.java | 256 +- .../conv10_30/EnrollmentRequest10_30.java | 36 +- .../conv10_30/EnrollmentResponse10_30.java | 40 +- .../conv10_30/EpisodeOfCare10_30.java | 88 +- .../conv10_30/FamilyMemberHistory10_30.java | 104 +- .../fhir/convertors/conv10_30/Flag10_30.java | 64 +- .../fhir/convertors/conv10_30/Group10_30.java | 120 +- .../conv10_30/HealthcareService10_30.java | 192 +- .../conv10_30/ImagingStudy10_30.java | 224 +- .../conv10_30/Immunization10_30.java | 249 +- .../ImmunizationRecommendation10_30.java | 128 +- .../conv10_30/ImplementationGuide10_30.java | 288 +- .../fhir/convertors/conv10_30/List10_30.java | 108 +- .../convertors/conv10_30/Location10_30.java | 120 +- .../fhir/convertors/conv10_30/Media10_30.java | 96 +- .../convertors/conv10_30/Medication10_30.java | 60 +- .../conv10_30/MedicationDispense10_30.java | 208 +- .../conv10_30/MedicationStatement10_30.java | 136 +- .../conv10_30/MessageHeader10_30.java | 176 +- .../conv10_30/NamingSystem10_30.java | 140 +- .../conv10_30/Observation10_30.java | 248 +- .../conv10_30/OperationDefinition10_30.java | 228 +- .../conv10_30/OperationOutcome10_30.java | 48 +- .../conv10_30/Organization10_30.java | 96 +- .../convertors/conv10_30/Parameters10_30.java | 40 +- .../convertors/conv10_30/Patient10_30.java | 248 +- .../convertors/conv10_30/Person10_30.java | 96 +- .../conv10_30/Practitioner10_30.java | 108 +- .../convertors/conv10_30/Procedure10_30.java | 176 +- .../conv10_30/ProcedureRequest10_30.java | 92 +- .../convertors/conv10_30/Provenance10_30.java | 100 +- .../conv10_30/Questionnaire10_30.java | 144 +- .../conv10_30/QuestionnaireResponse10_30.java | 140 +- .../conv10_30/ReferralRequest10_30.java | 104 +- .../conv10_30/RelatedPerson10_30.java | 76 +- .../conv10_30/RiskAssessment10_30.java | 112 +- .../convertors/conv10_30/Schedule10_30.java | 40 +- .../conv10_30/SearchParameter10_30.java | 124 +- .../fhir/convertors/conv10_30/Slot10_30.java | 52 +- .../convertors/conv10_30/Specimen10_30.java | 24 +- .../conv10_30/StructureDefinition10_30.java | 233 +- .../conv10_30/Subscription10_30.java | 92 +- .../convertors/conv10_30/Substance10_30.java | 84 +- .../conv10_30/SupplyDelivery10_30.java | 56 +- .../convertors/conv10_30/TestScript10_30.java | 644 +++- .../convertors/conv10_30/ValueSet10_30.java | 357 +- .../conv10_40/Appointment10_40.java | 116 +- .../conv10_40/AppointmentResponse10_40.java | 64 +- .../convertors/conv10_40/AuditEvent10_40.java | 260 +- .../fhir/convertors/conv10_40/Basic10_40.java | 40 +- .../convertors/conv10_40/Binary10_40.java | 12 +- .../convertors/conv10_40/Bundle10_40.java | 164 +- .../convertors/conv10_40/CarePlan10_40.java | 212 +- .../conv10_40/Communication10_40.java | 104 +- .../conv10_40/CommunicationRequest10_40.java | 120 +- .../conv10_40/Composition10_40.java | 204 +- .../convertors/conv10_40/ConceptMap10_40.java | 153 +- .../convertors/conv10_40/Condition10_40.java | 136 +- .../conv10_40/Conformance10_40.java | 508 ++- .../conv10_40/DataElement10_40.java | 69 +- .../conv10_40/DetectedIssue10_40.java | 88 +- .../conv10_40/DeviceMetric10_40.java | 104 +- .../conv10_40/DeviceUseStatement10_40.java | 60 +- .../conv10_40/DiagnosticReport10_40.java | 136 +- .../conv10_40/DocumentReference10_40.java | 208 +- .../convertors/conv10_40/Encounter10_40.java | 256 +- .../conv10_40/EnrollmentRequest10_40.java | 32 +- .../conv10_40/EnrollmentResponse10_40.java | 36 +- .../conv10_40/EpisodeOfCare10_40.java | 88 +- .../conv10_40/FamilyMemberHistory10_40.java | 96 +- .../fhir/convertors/conv10_40/Flag10_40.java | 64 +- .../fhir/convertors/conv10_40/Group10_40.java | 120 +- .../conv10_40/HealthcareService10_40.java | 180 +- .../conv10_40/ImplementationGuide10_40.java | 181 +- .../fhir/convertors/conv10_40/List10_40.java | 108 +- .../convertors/conv10_40/Location10_40.java | 120 +- .../conv10_40/MedicationDispense10_40.java | 192 +- .../conv10_40/MedicationStatement10_40.java | 120 +- .../conv10_40/MessageHeader10_40.java | 156 +- .../conv10_40/NamingSystem10_40.java | 132 +- .../conv10_40/Observation10_40.java | 228 +- .../conv10_40/OperationDefinition10_40.java | 216 +- .../conv10_40/OperationOutcome10_40.java | 48 +- .../conv10_40/Organization10_40.java | 96 +- .../convertors/conv10_40/Parameters10_40.java | 40 +- .../convertors/conv10_40/Patient10_40.java | 216 +- .../convertors/conv10_40/Person10_40.java | 96 +- .../conv10_40/Practitioner10_40.java | 108 +- .../conv10_40/Questionnaire10_40.java | 144 +- .../conv10_40/QuestionnaireResponse10_40.java | 132 +- .../conv10_40/RiskAssessment10_40.java | 112 +- .../convertors/conv10_40/Schedule10_40.java | 40 +- .../conv10_40/SearchParameter10_40.java | 124 +- .../fhir/convertors/conv10_40/Slot10_40.java | 52 +- .../conv10_40/StructureDefinition10_40.java | 225 +- .../conv10_40/Subscription10_40.java | 84 +- .../convertors/conv10_40/Substance10_40.java | 84 +- .../conv10_40/SupplyDelivery10_40.java | 56 +- .../convertors/conv10_40/TestScript10_40.java | 644 +++- .../convertors/conv10_40/ValueSet10_40.java | 353 +- .../conv10_50/Appointment10_50.java | 116 +- .../conv10_50/AppointmentResponse10_50.java | 64 +- .../convertors/conv10_50/AuditEvent10_50.java | 252 +- .../fhir/convertors/conv10_50/Basic10_50.java | 40 +- .../convertors/conv10_50/Binary10_50.java | 12 +- .../convertors/conv10_50/Bundle10_50.java | 164 +- .../convertors/conv10_50/CarePlan10_50.java | 200 +- .../conv10_50/Communication10_50.java | 100 +- .../conv10_50/CommunicationRequest10_50.java | 116 +- .../conv10_50/Composition10_50.java | 204 +- .../convertors/conv10_50/ConceptMap10_50.java | 155 +- .../convertors/conv10_50/Condition10_50.java | 136 +- .../conv10_50/Conformance10_50.java | 508 ++- .../conv10_50/DataElement10_50.java | 69 +- .../conv10_50/DetectedIssue10_50.java | 88 +- .../conv10_50/DeviceMetric10_50.java | 104 +- .../conv10_50/DeviceUseStatement10_50.java | 56 +- .../conv10_50/DiagnosticReport10_50.java | 136 +- .../conv10_50/DocumentReference10_50.java | 208 +- .../convertors/conv10_50/Encounter10_50.java | 252 +- .../conv10_50/EnrollmentRequest10_50.java | 32 +- .../conv10_50/EnrollmentResponse10_50.java | 36 +- .../conv10_50/EpisodeOfCare10_50.java | 88 +- .../conv10_50/FamilyMemberHistory10_50.java | 96 +- .../fhir/convertors/conv10_50/Flag10_50.java | 64 +- .../fhir/convertors/conv10_50/Group10_50.java | 120 +- .../conv10_50/HealthcareService10_50.java | 180 +- .../conv10_50/ImplementationGuide10_50.java | 183 +- .../fhir/convertors/conv10_50/List10_50.java | 108 +- .../convertors/conv10_50/Location10_50.java | 120 +- .../conv10_50/MedicationDispense10_50.java | 188 +- .../conv10_50/MedicationStatement10_50.java | 120 +- .../conv10_50/MessageHeader10_50.java | 156 +- .../conv10_50/NamingSystem10_50.java | 132 +- .../conv10_50/Observation10_50.java | 228 +- .../conv10_50/OperationDefinition10_50.java | 216 +- .../conv10_50/OperationOutcome10_50.java | 48 +- .../conv10_50/Organization10_50.java | 96 +- .../convertors/conv10_50/Parameters10_50.java | 40 +- .../convertors/conv10_50/Patient10_50.java | 216 +- .../convertors/conv10_50/Person10_50.java | 96 +- .../conv10_50/Practitioner10_50.java | 108 +- .../conv10_50/Questionnaire10_50.java | 144 +- .../conv10_50/QuestionnaireResponse10_50.java | 132 +- .../conv10_50/RiskAssessment10_50.java | 112 +- .../convertors/conv10_50/Schedule10_50.java | 40 +- .../conv10_50/SearchParameter10_50.java | 124 +- .../fhir/convertors/conv10_50/Slot10_50.java | 52 +- .../conv10_50/StructureDefinition10_50.java | 225 +- .../convertors/conv10_50/Substance10_50.java | 84 +- .../conv10_50/SupplyDelivery10_50.java | 56 +- .../convertors/conv10_50/TestScript10_50.java | 644 +++- .../convertors/conv10_50/ValueSet10_50.java | 353 +- .../convertors/conv14_30/Bundle14_30.java | 120 +- .../convertors/conv14_30/CodeSystem14_30.java | 168 +- .../conv14_30/CompartmentDefinition14_30.java | 80 +- .../convertors/conv14_30/ConceptMap14_30.java | 113 +- .../conv14_30/Conformance14_30.java | 404 ++- .../conv14_30/DataElement14_30.java | 68 +- .../conv14_30/ImplementationGuide14_30.java | 196 +- .../conv14_30/NamingSystem14_30.java | 100 +- .../conv14_30/OperationDefinition14_30.java | 180 +- .../conv14_30/OperationOutcome14_30.java | 48 +- .../convertors/conv14_30/Parameters14_30.java | 40 +- .../conv14_30/Questionnaire14_30.java | 136 +- .../conv14_30/QuestionnaireResponse14_30.java | 104 +- .../conv14_30/SearchParameter14_30.java | 92 +- .../conv14_30/StructureDefinition14_30.java | 136 +- .../convertors/conv14_30/TestScript14_30.java | 480 ++- .../convertors/conv14_30/ValueSet14_30.java | 196 +- .../convertors/conv14_40/Bundle14_40.java | 120 +- .../convertors/conv14_40/CodeSystem14_40.java | 160 +- .../conv14_40/CompartmentDefinition14_40.java | 80 +- .../convertors/conv14_40/ConceptMap14_40.java | 99 +- .../conv14_40/Conformance14_40.java | 328 +- .../conv14_40/DataElement14_40.java | 32 +- .../conv14_40/ImplementationGuide14_40.java | 133 +- .../conv14_40/NamingSystem14_40.java | 92 +- .../conv14_40/OperationDefinition14_40.java | 156 +- .../conv14_40/OperationOutcome14_40.java | 48 +- .../convertors/conv14_40/Parameters14_40.java | 40 +- .../conv14_40/Questionnaire14_40.java | 132 +- .../conv14_40/QuestionnaireResponse14_40.java | 96 +- .../conv14_40/SearchParameter14_40.java | 92 +- .../conv14_40/StructureDefinition14_40.java | 124 +- .../conv14_40/StructureMap14_40.java | 220 +- .../convertors/conv14_40/ValueSet14_40.java | 196 +- .../convertors/conv14_50/Bundle14_50.java | 120 +- .../convertors/conv14_50/CodeSystem14_50.java | 160 +- .../conv14_50/CompartmentDefinition14_50.java | 80 +- .../convertors/conv14_50/ConceptMap14_50.java | 99 +- .../conv14_50/Conformance14_50.java | 328 +- .../conv14_50/DataElement14_50.java | 32 +- .../conv14_50/ImplementationGuide14_50.java | 133 +- .../conv14_50/NamingSystem14_50.java | 92 +- .../conv14_50/OperationDefinition14_50.java | 160 +- .../conv14_50/OperationOutcome14_50.java | 48 +- .../convertors/conv14_50/Parameters14_50.java | 40 +- .../conv14_50/Questionnaire14_50.java | 132 +- .../conv14_50/QuestionnaireResponse14_50.java | 96 +- .../conv14_50/SearchParameter14_50.java | 92 +- .../conv14_50/StructureDefinition14_50.java | 128 +- .../conv14_50/StructureMap14_50.java | 220 +- .../convertors/conv14_50/ValueSet14_50.java | 196 +- .../conv30_40/ActivityDefinition30_40.java | 88 +- .../conv30_40/AllergyIntolerance30_40.java | 48 +- .../conv30_40/Appointment30_40.java | 88 +- .../conv30_40/AppointmentResponse30_40.java | 16 +- .../convertors/conv30_40/AuditEvent30_40.java | 80 +- .../fhir/convertors/conv30_40/Basic30_40.java | 8 +- .../convertors/conv30_40/BodySite30_40.java | 16 +- .../convertors/conv30_40/Bundle30_40.java | 24 +- .../conv30_40/CapabilityStatement30_40.java | 192 +- .../convertors/conv30_40/CarePlan30_40.java | 97 +- .../convertors/conv30_40/CareTeam30_40.java | 56 +- .../conv30_40/ClinicalImpression30_40.java | 72 +- .../convertors/conv30_40/CodeSystem30_40.java | 80 +- .../conv30_40/Communication30_40.java | 88 +- .../conv30_40/CompartmentDefinition30_40.java | 40 +- .../conv30_40/Composition30_40.java | 72 +- .../convertors/conv30_40/ConceptMap30_40.java | 48 +- .../convertors/conv30_40/Condition30_40.java | 64 +- .../convertors/conv30_40/Consent30_40.java | 101 +- .../conv30_40/DataElement30_40.java | 24 +- .../conv30_40/DetectedIssue30_40.java | 16 +- .../conv30_40/DeviceUseStatement30_40.java | 24 +- .../conv30_40/DiagnosticReport30_40.java | 64 +- .../conv30_40/DocumentReference30_40.java | 48 +- .../convertors/conv30_40/Encounter30_40.java | 120 +- .../convertors/conv30_40/Endpoint30_40.java | 40 +- .../conv30_40/EpisodeOfCare30_40.java | 56 +- .../conv30_40/ExpansionProfile30_40.java | 4 +- .../conv30_40/FamilyMemberHistory30_40.java | 56 +- .../fhir/convertors/conv30_40/Flag30_40.java | 8 +- .../fhir/convertors/conv30_40/Goal30_40.java | 48 +- .../conv30_40/GraphDefinition30_40.java | 56 +- .../fhir/convertors/conv30_40/Group30_40.java | 24 +- .../conv30_40/HealthcareService30_40.java | 120 +- .../conv30_40/ImagingStudy30_40.java | 81 +- .../conv30_40/Immunization30_40.java | 32 +- .../conv30_40/ImplementationGuide30_40.java | 65 +- .../convertors/conv30_40/Library30_40.java | 68 +- .../convertors/conv30_40/Linkage30_40.java | 8 +- .../fhir/convertors/conv30_40/List30_40.java | 24 +- .../convertors/conv30_40/Location30_40.java | 32 +- .../fhir/convertors/conv30_40/Media30_40.java | 56 +- .../convertors/conv30_40/Medication30_40.java | 8 +- .../MedicationAdministration30_40.java | 80 +- .../conv30_40/MedicationDispense30_40.java | 96 +- .../conv30_40/MedicationRequest30_40.java | 72 +- .../conv30_40/MedicationStatement30_40.java | 64 +- .../conv30_40/MessageDefinition30_40.java | 56 +- .../conv30_40/MessageHeader30_40.java | 16 +- .../conv30_40/NamingSystem30_40.java | 32 +- .../conv30_40/Observation30_40.java | 72 +- .../conv30_40/OperationDefinition30_40.java | 68 +- .../conv30_40/OperationOutcome30_40.java | 24 +- .../conv30_40/Organization30_40.java | 64 +- .../convertors/conv30_40/Parameters30_40.java | 16 +- .../convertors/conv30_40/Patient30_40.java | 88 +- .../conv30_40/PaymentNotice30_40.java | 8 +- .../convertors/conv30_40/Person30_40.java | 40 +- .../conv30_40/PlanDefinition30_40.java | 192 +- .../conv30_40/Practitioner30_40.java | 64 +- .../conv30_40/PractitionerRole30_40.java | 80 +- .../convertors/conv30_40/Procedure30_40.java | 76 +- .../conv30_40/ProcedureRequest30_40.java | 1 - .../convertors/conv30_40/Provenance30_40.java | 56 +- .../conv30_40/Questionnaire30_40.java | 96 +- .../conv30_40/QuestionnaireResponse30_40.java | 48 +- .../conv30_40/RelatedPerson30_40.java | 21 +- .../conv30_40/RiskAssessment30_40.java | 8 +- .../convertors/conv30_40/Schedule30_40.java | 32 +- .../conv30_40/SearchParameter30_40.java | 72 +- .../convertors/conv30_40/Sequence30_40.java | 40 +- .../fhir/convertors/conv30_40/Slot30_40.java | 24 +- .../convertors/conv30_40/Specimen30_40.java | 64 +- .../conv30_40/StructureDefinition30_40.java | 76 +- .../conv30_40/StructureMap30_40.java | 128 +- .../conv30_40/Subscription30_40.java | 16 +- .../convertors/conv30_40/Substance30_40.java | 32 +- .../conv30_40/SupplyDelivery30_40.java | 24 +- .../convertors/conv30_40/TestReport30_40.java | 40 +- .../convertors/conv30_40/TestScript30_40.java | 128 +- .../convertors/conv30_40/ValueSet30_40.java | 112 +- .../conv30_50/ActivityDefinition30_50.java | 88 +- .../conv30_50/AllergyIntolerance30_50.java | 48 +- .../conv30_50/Appointment30_50.java | 80 +- .../conv30_50/AppointmentResponse30_50.java | 16 +- .../convertors/conv30_50/AuditEvent30_50.java | 80 +- .../fhir/convertors/conv30_50/Basic30_50.java | 8 +- .../convertors/conv30_50/BodySite30_50.java | 16 +- .../convertors/conv30_50/Bundle30_50.java | 24 +- .../conv30_50/CapabilityStatement30_50.java | 192 +- .../convertors/conv30_50/CarePlan30_50.java | 97 +- .../convertors/conv30_50/CareTeam30_50.java | 48 +- .../conv30_50/ClinicalImpression30_50.java | 56 +- .../convertors/conv30_50/CodeSystem30_50.java | 80 +- .../conv30_50/Communication30_50.java | 80 +- .../conv30_50/CompartmentDefinition30_50.java | 40 +- .../conv30_50/Composition30_50.java | 72 +- .../convertors/conv30_50/ConceptMap30_50.java | 44 +- .../convertors/conv30_50/Condition30_50.java | 64 +- .../conv30_50/DataElement30_50.java | 24 +- .../conv30_50/DetectedIssue30_50.java | 16 +- .../conv30_50/DeviceUseStatement30_50.java | 20 +- .../conv30_50/DiagnosticReport30_50.java | 64 +- .../conv30_50/DocumentReference30_50.java | 48 +- .../convertors/conv30_50/Encounter30_50.java | 116 +- .../convertors/conv30_50/Endpoint30_50.java | 40 +- .../conv30_50/EpisodeOfCare30_50.java | 56 +- .../conv30_50/ExpansionProfile30_50.java | 4 +- .../conv30_50/FamilyMemberHistory30_50.java | 48 +- .../fhir/convertors/conv30_50/Flag30_50.java | 8 +- .../fhir/convertors/conv30_50/Goal30_50.java | 40 +- .../conv30_50/GraphDefinition30_50.java | 56 +- .../fhir/convertors/conv30_50/Group30_50.java | 24 +- .../conv30_50/HealthcareService30_50.java | 120 +- .../conv30_50/ImagingStudy30_50.java | 81 +- .../conv30_50/Immunization30_50.java | 28 +- .../conv30_50/ImplementationGuide30_50.java | 65 +- .../convertors/conv30_50/Library30_50.java | 68 +- .../convertors/conv30_50/Linkage30_50.java | 8 +- .../fhir/convertors/conv30_50/List30_50.java | 24 +- .../convertors/conv30_50/Location30_50.java | 32 +- .../convertors/conv30_50/Measure30_50.java | 92 +- .../convertors/conv30_50/Medication30_50.java | 8 +- .../MedicationAdministration30_50.java | 80 +- .../conv30_50/MedicationDispense30_50.java | 92 +- .../conv30_50/MedicationRequest30_50.java | 64 +- .../conv30_50/MedicationStatement30_50.java | 56 +- .../conv30_50/MessageDefinition30_50.java | 56 +- .../conv30_50/MessageHeader30_50.java | 16 +- .../conv30_50/NamingSystem30_50.java | 32 +- .../conv30_50/Observation30_50.java | 72 +- .../conv30_50/OperationDefinition30_50.java | 68 +- .../conv30_50/OperationOutcome30_50.java | 24 +- .../conv30_50/Organization30_50.java | 64 +- .../convertors/conv30_50/Parameters30_50.java | 16 +- .../convertors/conv30_50/Patient30_50.java | 88 +- .../conv30_50/PaymentNotice30_50.java | 8 +- .../convertors/conv30_50/Person30_50.java | 40 +- .../conv30_50/PlanDefinition30_50.java | 192 +- .../conv30_50/Practitioner30_50.java | 64 +- .../conv30_50/PractitionerRole30_50.java | 80 +- .../conv30_50/Questionnaire30_50.java | 96 +- .../conv30_50/QuestionnaireResponse30_50.java | 48 +- .../conv30_50/RelatedPerson30_50.java | 21 +- .../conv30_50/RiskAssessment30_50.java | 16 +- .../convertors/conv30_50/Schedule30_50.java | 32 +- .../conv30_50/SearchParameter30_50.java | 72 +- .../convertors/conv30_50/Sequence30_50.java | 40 +- .../fhir/convertors/conv30_50/Slot30_50.java | 24 +- .../convertors/conv30_50/Specimen30_50.java | 64 +- .../conv30_50/StructureDefinition30_50.java | 76 +- .../conv30_50/StructureMap30_50.java | 128 +- .../convertors/conv30_50/Substance30_50.java | 32 +- .../conv30_50/SupplyDelivery30_50.java | 24 +- .../convertors/conv30_50/TestReport30_50.java | 40 +- .../convertors/conv30_50/TestScript30_50.java | 128 +- .../convertors/conv30_50/ValueSet30_50.java | 112 +- .../fhir/convertors/conv40_50/Account.java | 299 +- .../conv40_50/ActivityDefinition.java | 863 +++-- .../conv40_50/AllergyIntolerance.java | 471 +-- .../convertors/conv40_50/Appointment.java | 510 +-- .../conv40_50/AppointmentResponse.java | 161 +- .../fhir/convertors/conv40_50/AuditEvent.java | 705 ++-- .../hl7/fhir/convertors/conv40_50/Basic.java | 79 +- .../hl7/fhir/convertors/conv40_50/Binary.java | 61 +- .../conv40_50/BiologicallyDerivedProduct.java | 527 +-- .../convertors/conv40_50/BodyStructure.java | 107 +- .../hl7/fhir/convertors/conv40_50/Bundle.java | 635 ++-- .../conv40_50/CapabilityStatement.java | 1721 ++++----- .../fhir/convertors/conv40_50/CarePlan.java | 808 +++-- .../fhir/convertors/conv40_50/CareTeam.java | 275 +- .../fhir/convertors/conv40_50/ChargeItem.java | 389 +- .../conv40_50/ChargeItemDefinition.java | 469 +-- .../hl7/fhir/convertors/conv40_50/Claim.java | 1411 ++++---- .../convertors/conv40_50/ClaimResponse.java | 1439 ++++---- .../conv40_50/ClinicalImpression.java | 311 +- .../fhir/convertors/conv40_50/CodeSystem.java | 863 ++--- .../convertors/conv40_50/Communication.java | 464 +-- .../conv40_50/CommunicationRequest.java | 453 +-- .../conv40_50/CompartmentDefinition.java | 275 +- .../convertors/conv40_50/Composition.java | 744 ++-- .../fhir/convertors/conv40_50/ConceptMap.java | 592 +-- .../fhir/convertors/conv40_50/Condition.java | 287 +- .../fhir/convertors/conv40_50/Consent.java | 663 ++-- .../fhir/convertors/conv40_50/Contract.java | 1903 +++++----- .../fhir/convertors/conv40_50/Coverage.java | 401 ++- .../conv40_50/CoverageEligibilityRequest.java | 545 +-- .../CoverageEligibilityResponse.java | 649 ++-- .../convertors/conv40_50/DetectedIssue.java | 381 +- .../hl7/fhir/convertors/conv40_50/Device.java | 753 ++-- .../conv40_50/DeviceDefinition.java | 617 ++-- .../convertors/conv40_50/DeviceMetric.java | 489 +-- .../convertors/conv40_50/DeviceRequest.java | 520 +-- .../conv40_50/DeviceUseStatement.java | 220 +- .../conv40_50/DiagnosticReport.java | 343 +- .../conv40_50/DocumentManifest.java | 187 +- .../conv40_50/DocumentReference.java | 481 +-- .../fhir/convertors/conv40_50/Encounter.java | 765 ++-- .../fhir/convertors/conv40_50/Endpoint.java | 203 +- .../conv40_50/EnrollmentRequest.java | 151 +- .../conv40_50/EnrollmentResponse.java | 217 +- .../convertors/conv40_50/Enumerations.java | 594 ++-- .../convertors/conv40_50/EpisodeOfCare.java | 325 +- .../convertors/conv40_50/EventDefinition.java | 283 +- .../convertors/conv40_50/ExampleScenario.java | 819 ++--- .../conv40_50/ExplanationOfBenefit.java | 2459 +++++++------ .../conv40_50/FamilyMemberHistory.java | 324 +- .../hl7/fhir/convertors/conv40_50/Flag.java | 155 +- .../hl7/fhir/convertors/conv40_50/Goal.java | 320 +- .../convertors/conv40_50/GraphDefinition.java | 548 +-- .../hl7/fhir/convertors/conv40_50/Group.java | 311 +- .../conv40_50/GuidanceResponse.java | 236 +- .../conv40_50/HealthcareService.java | 489 +-- .../convertors/conv40_50/ImagingStudy.java | 531 +-- .../convertors/conv40_50/Immunization.java | 572 +-- .../conv40_50/ImmunizationEvaluation.java | 189 +- .../conv40_50/ImmunizationRecommendation.java | 261 +- .../conv40_50/ImplementationGuide.java | 3163 ++++++++++------- .../convertors/conv40_50/InsurancePlan.java | 683 ++-- .../fhir/convertors/conv40_50/Invoice.java | 477 +-- .../fhir/convertors/conv40_50/Library.java | 311 +- .../fhir/convertors/conv40_50/Linkage.java | 157 +- .../convertors/conv40_50/ListResource.java | 313 +- .../fhir/convertors/conv40_50/Location.java | 479 +-- .../fhir/convertors/conv40_50/Measure.java | 687 ++-- .../convertors/conv40_50/MeasureReport.java | 587 +-- .../hl7/fhir/convertors/conv40_50/Media.java | 288 +- .../fhir/convertors/conv40_50/Medication.java | 259 +- .../conv40_50/MedicationAdministration.java | 366 +- .../conv40_50/MedicationDispense.java | 394 +- .../conv40_50/MedicationKnowledge.java | 1032 +++--- .../conv40_50/MedicationRequest.java | 733 ++-- .../conv40_50/MedicationStatement.java | 270 +- .../conv40_50/MessageDefinition.java | 467 +-- .../convertors/conv40_50/MessageHeader.java | 359 +- .../conv40_50/MolecularSequence.java | 1121 +++--- .../convertors/conv40_50/NamingSystem.java | 329 +- .../convertors/conv40_50/NutritionOrder.java | 775 ++-- .../convertors/conv40_50/Observation.java | 491 +-- .../conv40_50/ObservationDefinition.java | 460 +-- .../conv40_50/OperationDefinition.java | 620 ++-- .../conv40_50/OperationOutcome.java | 403 ++- .../convertors/conv40_50/Organization.java | 193 +- .../conv40_50/OrganizationAffiliation.java | 149 +- .../fhir/convertors/conv40_50/Parameters.java | 108 +- .../fhir/convertors/conv40_50/Patient.java | 415 ++- .../convertors/conv40_50/PaymentNotice.java | 191 +- .../conv40_50/PaymentReconciliation.java | 437 +-- .../hl7/fhir/convertors/conv40_50/Person.java | 227 +- .../convertors/conv40_50/PlanDefinition.java | 1441 ++++---- .../convertors/conv40_50/Practitioner.java | 193 +- .../conv40_50/PractitionerRole.java | 351 +- .../fhir/convertors/conv40_50/Procedure.java | 478 +-- .../fhir/convertors/conv40_50/Provenance.java | 307 +- .../convertors/conv40_50/Questionnaire.java | 793 +++-- .../conv40_50/QuestionnaireResponse.java | 319 +- .../convertors/conv40_50/RelatedPerson.java | 191 +- .../convertors/conv40_50/RequestGroup.java | 1124 +++--- .../convertors/conv40_50/ResearchStudy.java | 461 +-- .../convertors/conv40_50/ResearchSubject.java | 213 +- .../convertors/conv40_50/RiskAssessment.java | 344 +- .../fhir/convertors/conv40_50/Schedule.java | 111 +- .../convertors/conv40_50/SearchParameter.java | 552 +-- .../convertors/conv40_50/ServiceRequest.java | 556 +-- .../hl7/fhir/convertors/conv40_50/Slot.java | 195 +- .../fhir/convertors/conv40_50/Specimen.java | 447 +-- .../conv40_50/SpecimenDefinition.java | 433 +-- .../conv40_50/StructureDefinition.java | 619 ++-- .../convertors/conv40_50/StructureMap.java | 1259 ++++--- .../fhir/convertors/conv40_50/Substance.java | 255 +- .../conv40_50/SubstanceNucleicAcid.java | 287 +- .../conv40_50/SubstancePolymer.java | 429 +-- .../conv40_50/SubstanceProtein.java | 165 +- .../SubstanceReferenceInformation.java | 351 +- .../conv40_50/SubstanceSourceMaterial.java | 507 +-- .../convertors/conv40_50/SupplyDelivery.java | 237 +- .../convertors/conv40_50/SupplyRequest.java | 346 +- .../hl7/fhir/convertors/conv40_50/Task.java | 707 ++-- .../conv40_50/TerminologyCapabilities.java | 865 ++--- .../fhir/convertors/conv40_50/TestReport.java | 813 +++-- .../fhir/convertors/conv40_50/TestScript.java | 1677 +++++---- .../fhir/convertors/conv40_50/ValueSet.java | 803 +++-- .../conv40_50/VerificationResult.java | 473 +-- .../conv40_50/VisionPrescription.java | 461 +-- .../hl7/fhir/convertors/parser/Parser.java | 1244 +++++++ 515 files changed, 69318 insertions(+), 42297 deletions(-) create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index c31501189..0dbc844b6 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -59,6 +59,13 @@ true + + + com.github.javaparser + javaparser-symbol-solver-core + 3.15.9 + + diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Account10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Account10_30.java index 1758f4266..6d6707391 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Account10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Account10_30.java @@ -10,15 +10,33 @@ public class Account10_30 { return null; org.hl7.fhir.dstu2.model.Account tgt = new org.hl7.fhir.dstu2.model.Account(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setName(src.getName()); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setStatus(convertAccountStatus(src.getStatus())); - tgt.setActivePeriod(VersionConvertor_10_30.convertPeriod(src.getActive())); - tgt.setBalance(VersionConvertor_10_30.convertMoney(src.getBalance())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); - tgt.setDescription(src.getDescription()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasStatus()) { + tgt.setStatus(convertAccountStatus(src.getStatus())); + } + if (src.hasActive()) { + tgt.setActivePeriod(VersionConvertor_10_30.convertPeriod(src.getActive())); + } + if (src.hasBalance()) { + tgt.setBalance(VersionConvertor_10_30.convertMoney(src.getBalance())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasOwner()) { + tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -27,17 +45,31 @@ public class Account10_30 { return null; org.hl7.fhir.dstu3.model.Account tgt = new org.hl7.fhir.dstu3.model.Account(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasType()) tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setStatus(convertAccountStatus(src.getStatus())); - tgt.setActive(VersionConvertor_10_30.convertPeriod(src.getActivePeriod())); - tgt.setBalance(VersionConvertor_10_30.convertMoney(src.getBalance())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); - tgt.setDescription(src.getDescription()); + if (src.hasStatus()) { + tgt.setStatus(convertAccountStatus(src.getStatus())); + } + if (src.hasActivePeriod()) { + tgt.setActive(VersionConvertor_10_30.convertPeriod(src.getActivePeriod())); + } + if (src.hasBalance()) { + tgt.setBalance(VersionConvertor_10_30.convertMoney(src.getBalance())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasOwner()) { + tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Appointment10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Appointment10_30.java index 07b504614..e957f51c1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Appointment10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Appointment10_30.java @@ -10,17 +10,39 @@ public class Appointment10_30 { return null; org.hl7.fhir.dstu2.model.Appointment tgt = new org.hl7.fhir.dstu2.model.Appointment(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertAppointmentStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPriority(src.getPriority()); - tgt.setDescription(src.getDescription()); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_30.convertReference(t)); - tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(src.getPriority()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasMinutesDuration()) { + tgt.setMinutesDuration(src.getMinutesDuration()); + } + if (src.hasSlot()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } return tgt; } @@ -29,18 +51,38 @@ public class Appointment10_30 { return null; org.hl7.fhir.dstu3.model.Appointment tgt = new org.hl7.fhir.dstu3.model.Appointment(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertAppointmentStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + } if (src.hasType()) tgt.addServiceType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setPriority(src.getPriority()); - tgt.setDescription(src.getDescription()); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_30.convertReference(t)); - tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + if (src.hasPriority()) { + tgt.setPriority(src.getPriority()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasMinutesDuration()) { + tgt.setMinutesDuration(src.getMinutesDuration()); + } + if (src.hasSlot()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } return tgt; } @@ -49,10 +91,18 @@ public class Appointment10_30 { return null; org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); - tgt.setRequired(convertParticipantRequired(src.getRequired())); - tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasRequired()) { + tgt.setRequired(convertParticipantRequired(src.getRequired())); + } + if (src.hasStatus()) { + tgt.setStatus(convertParticipationStatus(src.getStatus())); + } return tgt; } @@ -61,10 +111,18 @@ public class Appointment10_30 { return null; org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); - tgt.setRequired(convertParticipantRequired(src.getRequired())); - tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasRequired()) { + tgt.setRequired(convertParticipantRequired(src.getRequired())); + } + if (src.hasStatus()) { + tgt.setStatus(convertParticipationStatus(src.getStatus())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AppointmentResponse10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AppointmentResponse10_30.java index c67ebe6d2..b5eaaee0c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AppointmentResponse10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AppointmentResponse10_30.java @@ -10,14 +10,30 @@ public class AppointmentResponse10_30 { return null; org.hl7.fhir.dstu2.model.AppointmentResponse tgt = new org.hl7.fhir.dstu2.model.AppointmentResponse(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasParticipantType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasParticipantStatus()) { + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -26,14 +42,30 @@ public class AppointmentResponse10_30 { return null; org.hl7.fhir.dstu3.model.AppointmentResponse tgt = new org.hl7.fhir.dstu3.model.AppointmentResponse(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasParticipantType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasParticipantStatus()) { + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AuditEvent10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AuditEvent10_30.java index 90ead3c27..f4ef2ef09 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AuditEvent10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/AuditEvent10_30.java @@ -10,16 +10,36 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu2.model.AuditEvent tgt = new org.hl7.fhir.dstu2.model.AuditEvent(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.getEvent().setType(VersionConvertor_10_30.convertCoding(src.getType())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(VersionConvertor_10_30.convertCoding(t)); - tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); - tgt.getEvent().setDateTime(src.getRecorded()); - tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); - tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(VersionConvertor_10_30.convertCoding(cc)); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t)); - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t)); + if (src.hasType()) { + tgt.getEvent().setType(VersionConvertor_10_30.convertCoding(src.getType())); + } + if (src.hasSubtype()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasAction()) { + tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); + } + if (src.hasRecorded()) { + tgt.getEvent().setDateTime(src.getRecorded()); + } + if (src.hasOutcome()) { + tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); + } + if (src.hasOutcomeDesc()) { + tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); + } + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(VersionConvertor_10_30.convertCoding(cc)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) { + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + } + if (src.hasEntity()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t)); + } return tgt; } @@ -29,17 +49,37 @@ public class AuditEvent10_30 { org.hl7.fhir.dstu3.model.AuditEvent tgt = new org.hl7.fhir.dstu3.model.AuditEvent(); VersionConvertor_10_30.copyDomainResource(src, tgt); if (src.hasEvent()) { - tgt.setType(VersionConvertor_10_30.convertCoding(src.getEvent().getType())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(VersionConvertor_10_30.convertCoding(t)); - tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); - tgt.setRecorded(src.getEvent().getDateTime()); - tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); - tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(VersionConvertor_10_30.convertCoding(t)); + if (src.hasEvent()) { + tgt.setType(VersionConvertor_10_30.convertCoding(src.getEvent().getType())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasEvent()) { + tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); + } + if (src.hasEvent()) { + tgt.setRecorded(src.getEvent().getDateTime()); + } + if (src.hasEvent()) { + tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); + } + if (src.hasEvent()) { + tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(VersionConvertor_10_30.convertCoding(t)); + } + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) { + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + } + if (src.hasObject()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t)); } - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t)); - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t)); return tgt; } @@ -86,17 +126,39 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); - tgt.setUserId(VersionConvertor_10_30.convertIdentifier(src.getUserId())); - tgt.setAltId(src.getAltId()); - tgt.setName(src.getName()); - tgt.setRequestor(src.getRequestor()); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - tgt.setMedia(VersionConvertor_10_30.convertCoding(src.getMedia())); - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(VersionConvertor_10_30.convertCoding(t)); + if (src.hasRole()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); + } + if (src.hasUserId()) { + tgt.setUserId(VersionConvertor_10_30.convertIdentifier(src.getUserId())); + } + if (src.hasAltId()) { + tgt.setAltId(src.getAltId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRequestor()) { + tgt.setRequestor(src.getRequestor()); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasMedia()) { + tgt.setMedia(VersionConvertor_10_30.convertCoding(src.getMedia())); + } + if (src.hasNetwork()) { + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + } + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(VersionConvertor_10_30.convertCoding(t)); + } return tgt; } @@ -105,17 +167,39 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); - tgt.setUserId(VersionConvertor_10_30.convertIdentifier(src.getUserId())); - tgt.setAltId(src.getAltId()); - tgt.setName(src.getName()); - tgt.setRequestor(src.getRequestor()); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - tgt.setMedia(VersionConvertor_10_30.convertCoding(src.getMedia())); - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(VersionConvertor_10_30.convertCoding(cc)); + if (src.hasRole()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); + } + if (src.hasUserId()) { + tgt.setUserId(VersionConvertor_10_30.convertIdentifier(src.getUserId())); + } + if (src.hasAltId()) { + tgt.setAltId(src.getAltId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRequestor()) { + tgt.setRequestor(src.getRequestor()); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasMedia()) { + tgt.setMedia(VersionConvertor_10_30.convertCoding(src.getMedia())); + } + if (src.hasNetwork()) { + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + } + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(VersionConvertor_10_30.convertCoding(cc)); + } return tgt; } @@ -124,8 +208,12 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAddress(src.getAddress()); - tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } + if (src.hasType()) { + tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + } return tgt; } @@ -134,8 +222,12 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAddress(src.getAddress()); - tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } + if (src.hasType()) { + tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + } return tgt; } @@ -144,16 +236,36 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); - tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); - tgt.setRole(VersionConvertor_10_30.convertCoding(src.getRole())); - tgt.setLifecycle(VersionConvertor_10_30.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCoding(t)); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_30.convertCoding(src.getRole())); + } + if (src.hasLifecycle()) { + tgt.setLifecycle(VersionConvertor_10_30.convertCoding(src.getLifecycle())); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasQuery()) { + tgt.setQuery(src.getQuery()); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -162,16 +274,36 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); - tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); - tgt.setRole(VersionConvertor_10_30.convertCoding(src.getRole())); - tgt.setLifecycle(VersionConvertor_10_30.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCoding(t)); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_30.convertCoding(src.getRole())); + } + if (src.hasLifecycle()) { + tgt.setLifecycle(VersionConvertor_10_30.convertCoding(src.getLifecycle())); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasQuery()) { + tgt.setQuery(src.getQuery()); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -180,8 +312,12 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -190,8 +326,12 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -272,9 +412,15 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSite(src.getSite()); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCoding(t)); + if (src.hasSite()) { + tgt.setSite(src.getSite()); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCoding(t)); + } return tgt; } @@ -283,9 +429,15 @@ public class AuditEvent10_30 { return null; org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSite(src.getSite()); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCoding(t)); + if (src.hasSite()) { + tgt.setSite(src.getSite()); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCoding(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Basic10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Basic10_30.java index 4cc4cc91b..58035aeb6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Basic10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Basic10_30.java @@ -10,11 +10,21 @@ public class Basic10_30 { return null; org.hl7.fhir.dstu2.model.Basic tgt = new org.hl7.fhir.dstu2.model.Basic(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setCreated(src.getCreated()); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } return tgt; } @@ -23,11 +33,21 @@ public class Basic10_30 { return null; org.hl7.fhir.dstu3.model.Basic tgt = new org.hl7.fhir.dstu3.model.Basic(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setCreated(src.getCreated()); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Binary10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Binary10_30.java index 2ffbddd3e..2d15a7b55 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Binary10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Binary10_30.java @@ -10,8 +10,12 @@ public class Binary10_30 { return null; org.hl7.fhir.dstu2.model.Binary tgt = new org.hl7.fhir.dstu2.model.Binary(); VersionConvertor_10_30.copyResource(src, tgt); - tgt.setContentType(src.getContentType()); - tgt.setContent(src.getContent()); + if (src.hasContentType()) { + tgt.setContentType(src.getContentType()); + } + if (src.hasContent()) { + tgt.setContent(src.getContent()); + } return tgt; } @@ -20,8 +24,12 @@ public class Binary10_30 { return null; org.hl7.fhir.dstu3.model.Binary tgt = new org.hl7.fhir.dstu3.model.Binary(); VersionConvertor_10_30.copyResource(src, tgt); - tgt.setContentType(src.getContentType()); - tgt.setContent(src.getContent()); + if (src.hasContentType()) { + tgt.setContentType(src.getContentType()); + } + if (src.hasContent()) { + tgt.setContent(src.getContent()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30.java index 2b79400bb..d1eb6fbfc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30.java @@ -11,12 +11,20 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle(); VersionConvertor_10_30.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_10_30.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_10_30.convertSignature(src.getSignature())); + } return tgt; } @@ -25,11 +33,17 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu2.model.Bundle tgt = new org.hl7.fhir.dstu2.model.Bundle(); VersionConvertor_10_30.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t, advisor)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t, advisor)); + } if (src.hasSignature()) tgt.setSignature(VersionConvertor_10_30.convertSignature(src.getSignature())); return tgt; @@ -70,12 +84,24 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_10_30.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasFullUrl()) { + tgt.setFullUrl(src.getFullUrl()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_30.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -84,12 +110,24 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); - tgt.setIfNoneMatch(src.getIfNoneMatch()); - tgt.setIfModifiedSince(src.getIfModifiedSince()); - tgt.setIfMatch(src.getIfMatch()); - tgt.setIfNoneExist(src.getIfNoneExist()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIfNoneMatch()) { + tgt.setIfNoneMatch(src.getIfNoneMatch()); + } + if (src.hasIfModifiedSince()) { + tgt.setIfModifiedSince(src.getIfModifiedSince()); + } + if (src.hasIfMatch()) { + tgt.setIfMatch(src.getIfMatch()); + } + if (src.hasIfNoneExist()) { + tgt.setIfNoneExist(src.getIfNoneExist()); + } return tgt; } @@ -98,12 +136,24 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); - tgt.setIfNoneMatch(src.getIfNoneMatch()); - tgt.setIfModifiedSince(src.getIfModifiedSince()); - tgt.setIfMatch(src.getIfMatch()); - tgt.setIfNoneExist(src.getIfNoneExist()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIfNoneMatch()) { + tgt.setIfNoneMatch(src.getIfNoneMatch()); + } + if (src.hasIfModifiedSince()) { + tgt.setIfModifiedSince(src.getIfModifiedSince()); + } + if (src.hasIfMatch()) { + tgt.setIfMatch(src.getIfMatch()); + } + if (src.hasIfNoneExist()) { + tgt.setIfNoneExist(src.getIfNoneExist()); + } return tgt; } @@ -112,10 +162,18 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); - tgt.setLocation(src.getLocation()); - tgt.setEtag(src.getEtag()); - tgt.setLastModified(src.getLastModified()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } + if (src.hasLocation()) { + tgt.setLocation(src.getLocation()); + } + if (src.hasEtag()) { + tgt.setEtag(src.getEtag()); + } + if (src.hasLastModified()) { + tgt.setLastModified(src.getLastModified()); + } return tgt; } @@ -124,10 +182,18 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); - tgt.setLocation(src.getLocation()); - tgt.setEtag(src.getEtag()); - tgt.setLastModified(src.getLastModified()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } + if (src.hasLocation()) { + tgt.setLocation(src.getLocation()); + } + if (src.hasEtag()) { + tgt.setEtag(src.getEtag()); + } + if (src.hasLastModified()) { + tgt.setLastModified(src.getLastModified()); + } return tgt; } @@ -136,8 +202,12 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); - tgt.setScore(src.getScore()); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } + if (src.hasScore()) { + tgt.setScore(src.getScore()); + } return tgt; } @@ -146,8 +216,12 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); - tgt.setScore(src.getScore()); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } + if (src.hasScore()) { + tgt.setScore(src.getScore()); + } return tgt; } @@ -156,8 +230,12 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -166,8 +244,12 @@ public class Bundle10_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CarePlan10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CarePlan10_30.java index 69cc77b11..d5fcaf7af 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CarePlan10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CarePlan10_30.java @@ -10,17 +10,39 @@ public class CarePlan10_30 { return null; org.hl7.fhir.dstu3.model.CarePlan tgt = new org.hl7.fhir.dstu3.model.CarePlan(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } + if (src.hasContext()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } return tgt; } @@ -29,17 +51,39 @@ public class CarePlan10_30 { return null; org.hl7.fhir.dstu2.model.CarePlan tgt = new org.hl7.fhir.dstu2.model.CarePlan(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } + if (src.hasContext()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } return tgt; } @@ -48,9 +92,15 @@ public class CarePlan10_30 { return null; org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_30.convertAnnotation(t)); - tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasProgress()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_30.convertAnnotation(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); + } + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } return tgt; } @@ -59,9 +109,15 @@ public class CarePlan10_30 { return null; org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_30.convertAnnotation(t)); - tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasProgress()) { + for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_30.convertAnnotation(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_30.convertReference(src.getReference())); + } + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } return tgt; } @@ -70,20 +126,48 @@ public class CarePlan10_30 { return null; org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - tgt.setProhibited(src.getProhibited()); - tgt.setScheduled(VersionConvertor_10_30.convertType(src.getScheduled())); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); - tgt.setProduct(VersionConvertor_10_30.convertType(src.getProduct())); - tgt.setDailyAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getDailyAmount())); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setDescription(src.getDescription()); + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } + if (src.hasProhibited()) { + tgt.setProhibited(src.getProhibited()); + } + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_10_30.convertType(src.getScheduled())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_10_30.convertType(src.getProduct())); + } + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getDailyAmount())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -92,20 +176,48 @@ public class CarePlan10_30 { return null; org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - tgt.setProhibited(src.getProhibited()); - tgt.setScheduled(VersionConvertor_10_30.convertType(src.getScheduled())); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); - tgt.setProduct(VersionConvertor_10_30.convertType(src.getProduct())); - tgt.setDailyAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getDailyAmount())); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setDescription(src.getDescription()); + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } + if (src.hasProhibited()) { + tgt.setProhibited(src.getProhibited()); + } + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_10_30.convertType(src.getScheduled())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_10_30.convertType(src.getProduct())); + } + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getDailyAmount())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ClinicalImpression10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ClinicalImpression10_30.java index a6bcf3c59..085624c3e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ClinicalImpression10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ClinicalImpression10_30.java @@ -11,20 +11,40 @@ public class ClinicalImpression10_30 { return null; org.hl7.fhir.dstu3.model.ClinicalImpression tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setAssessor(VersionConvertor_10_30.convertReference(src.getAssessor())); - tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasAssessor()) { + tgt.setAssessor(VersionConvertor_10_30.convertReference(src.getAssessor())); + } + if (src.hasStatus()) { + tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); - tgt.setPrevious(VersionConvertor_10_30.convertReference(src.getPrevious())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_10_30.convertReference(t)); - tgt.addProtocol(src.getProtocol()); - tgt.setSummary(src.getSummary()); - for (org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPrevious()) { + tgt.setPrevious(VersionConvertor_10_30.convertReference(src.getPrevious())); + } + if (src.hasProblem()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasProtocol()) { + tgt.addProtocol(src.getProtocol()); + } + if (src.hasSummary()) { + tgt.setSummary(src.getSummary()); + } + if (src.hasFinding()) { + for (org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } if (src.hasPrognosis()) tgt.addPrognosisCodeableConcept().setText(src.getPrognosis()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertReference(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -33,19 +53,41 @@ public class ClinicalImpression10_30 { return null; org.hl7.fhir.dstu2.model.ClinicalImpression tgt = new org.hl7.fhir.dstu2.model.ClinicalImpression(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setAssessor(VersionConvertor_10_30.convertReference(src.getAssessor())); - tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasAssessor()) { + tgt.setAssessor(VersionConvertor_10_30.convertReference(src.getAssessor())); + } + if (src.hasStatus()) { + tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); - tgt.setPrevious(VersionConvertor_10_30.convertReference(src.getPrevious())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_10_30.convertReference(t)); - for (UriType t : src.getProtocol()) tgt.setProtocol(t.asStringValue()); - tgt.setSummary(src.getSummary()); - for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); - tgt.setPrognosis(src.getPrognosisCodeableConceptFirstRep().getText()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertReference(t)); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPrevious()) { + tgt.setPrevious(VersionConvertor_10_30.convertReference(src.getPrevious())); + } + if (src.hasProblem()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasProtocol()) { + for (UriType t : src.getProtocol()) tgt.setProtocol(t.asStringValue()); + } + if (src.hasSummary()) { + tgt.setSummary(src.getSummary()); + } + if (src.hasFinding()) { + for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } + if (src.hasPrognosisCodeableConcept()) { + tgt.setPrognosis(src.getPrognosisCodeableConceptFirstRep().getText()); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -54,7 +96,9 @@ public class ClinicalImpression10_30 { return null; org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setItem(VersionConvertor_10_30.convertCodeableConcept(src.getItem())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_30.convertCodeableConcept(src.getItem())); + } return tgt; } @@ -65,7 +109,9 @@ public class ClinicalImpression10_30 { VersionConvertor_10_30.copyElement(src, tgt); if (src.hasItemCodeableConcept()) try { - tgt.setItem(VersionConvertor_10_30.convertCodeableConcept(src.getItemCodeableConcept())); + if (src.hasItemCodeableConcept()) { + tgt.setItem(VersionConvertor_10_30.convertCodeableConcept(src.getItemCodeableConcept())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { } return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Communication10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Communication10_30.java index e4056a13d..a6077ae79 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Communication10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Communication10_30.java @@ -10,18 +10,42 @@ public class Communication10_30 { return null; org.hl7.fhir.dstu3.model.Communication tgt = new org.hl7.fhir.dstu3.model.Communication(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setSent(src.getSent()); - tgt.setReceived(src.getReceived()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasSent()) { + tgt.setSent(src.getSent()); + } + if (src.hasReceived()) { + tgt.setReceived(src.getReceived()); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } return tgt; } @@ -30,18 +54,42 @@ public class Communication10_30 { return null; org.hl7.fhir.dstu2.model.Communication tgt = new org.hl7.fhir.dstu2.model.Communication(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setSent(src.getSent()); - tgt.setReceived(src.getReceived()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasSent()) { + tgt.setSent(src.getSent()); + } + if (src.hasReceived()) { + tgt.setReceived(src.getReceived()); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } return tgt; } @@ -50,7 +98,9 @@ public class Communication10_30 { return null; org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -59,7 +109,9 @@ public class Communication10_30 { return null; org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CommunicationRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CommunicationRequest10_30.java index c31439e0f..7f9cba1c5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CommunicationRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/CommunicationRequest10_30.java @@ -10,20 +10,48 @@ public class CommunicationRequest10_30 { return null; org.hl7.fhir.dstu2.model.CommunicationRequest tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setRequester(VersionConvertor_10_30.convertReference(src.getRequester().getAgent())); - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setScheduled(VersionConvertor_10_30.convertType(src.getOccurrence())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setRequestedOn(src.getAuthoredOn()); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setPriority(convertPriorityCode(src.getPriority())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasRequester()) { + tgt.setRequester(VersionConvertor_10_30.convertReference(src.getRequester().getAgent())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasOccurrence()) { + tgt.setScheduled(VersionConvertor_10_30.convertType(src.getOccurrence())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasAuthoredOn()) { + tgt.setRequestedOn(src.getAuthoredOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasPriority()) { + tgt.setPriority(convertPriorityCode(src.getPriority())); + } return tgt; } @@ -32,20 +60,48 @@ public class CommunicationRequest10_30 { return null; org.hl7.fhir.dstu3.model.CommunicationRequest tgt = new org.hl7.fhir.dstu3.model.CommunicationRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.getRequester().setAgent(VersionConvertor_10_30.convertReference(src.getRequester())); - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setOccurrence(VersionConvertor_10_30.convertType(src.getScheduled())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setAuthoredOn(src.getRequestedOn()); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setPriority(convertPriorityCode(src.getPriority())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_30.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasRequester()) { + tgt.getRequester().setAgent(VersionConvertor_10_30.convertReference(src.getRequester())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasScheduled()) { + tgt.setOccurrence(VersionConvertor_10_30.convertType(src.getScheduled())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasRequestedOn()) { + tgt.setAuthoredOn(src.getRequestedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasPriority()) { + tgt.setPriority(convertPriorityCode(src.getPriority())); + } return tgt; } @@ -54,7 +110,9 @@ public class CommunicationRequest10_30 { return null; org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -63,7 +121,9 @@ public class CommunicationRequest10_30 { return null; org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Composition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Composition10_30.java index ed6460aba..20defc7c3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Composition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Composition10_30.java @@ -10,25 +10,51 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu3.model.Composition tgt = new org.hl7.fhir.dstu3.model.Composition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); - tgt.setTitle(src.getTitle()); - tgt.setStatus(convertCompositionStatus(src.getStatus())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(convertCompositionStatus(src.getStatus())); + } try { - tgt.setConfidentiality(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.fromCode(src.getConfidentiality())); + if (src.hasConfidentiality()) { + tgt.setConfidentiality(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.fromCode(src.getConfidentiality())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); - tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasAttester()) { + for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -37,21 +63,47 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu2.model.Composition tgt = new org.hl7.fhir.dstu2.model.Composition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); - tgt.setTitle(src.getTitle()); - tgt.setStatus(convertCompositionStatus(src.getStatus())); - tgt.setConfidentiality(src.getConfidentiality().toCode()); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); - tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(convertCompositionStatus(src.getStatus())); + } + if (src.hasConfidentiality()) { + tgt.setConfidentiality(src.getConfidentiality().toCode()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasAttester()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -94,9 +146,15 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Enumeration t : src.getMode()) VersionConvertor_10_30.copyElement(t, tgt.addModeElement().setValue(convertCompositionAttestationMode(t.getValue()))); - tgt.setTime(src.getTime()); - tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); + if (src.hasMode()) { + for (org.hl7.fhir.dstu2.model.Enumeration t : src.getMode()) VersionConvertor_10_30.copyElement(t, tgt.addModeElement().setValue(convertCompositionAttestationMode(t.getValue()))); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); + } return tgt; } @@ -105,9 +163,15 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getMode()) VersionConvertor_10_30.copyElement(t, tgt.addModeElement().setValue(convertCompositionAttestationMode(t.getValue()))); - tgt.setTime(src.getTime()); - tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); + if (src.hasMode()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getMode()) VersionConvertor_10_30.copyElement(t, tgt.addModeElement().setValue(convertCompositionAttestationMode(t.getValue()))); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); + } return tgt; } @@ -116,9 +180,15 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -127,9 +197,15 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -172,18 +248,34 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu3.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu3.model.Composition.SectionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setText(VersionConvertor_10_30.convertNarrative(src.getText())); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasText()) { + tgt.setText(VersionConvertor_10_30.convertNarrative(src.getText())); + } try { - tgt.setMode(org.hl7.fhir.dstu3.model.Composition.SectionMode.fromCode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(org.hl7.fhir.dstu3.model.Composition.SectionMode.fromCode(src.getMode())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_30.convertReference(t)); - tgt.setEmptyReason(VersionConvertor_10_30.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasEmptyReason()) { + tgt.setEmptyReason(VersionConvertor_10_30.convertCodeableConcept(src.getEmptyReason())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -192,14 +284,30 @@ public class Composition10_30 { return null; org.hl7.fhir.dstu2.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu2.model.Composition.SectionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setText(VersionConvertor_10_30.convertNarrative(src.getText())); - tgt.setMode(src.getMode().toCode()); - tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_30.convertReference(t)); - tgt.setEmptyReason(VersionConvertor_10_30.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasText()) { + tgt.setText(VersionConvertor_10_30.convertNarrative(src.getText())); + } + if (src.hasMode()) { + tgt.setMode(src.getMode().toCode()); + } + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasEmptyReason()) { + tgt.setEmptyReason(VersionConvertor_10_30.convertCodeableConcept(src.getEmptyReason())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ConceptMap10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ConceptMap10_30.java index 41f94a7f9..b2237975e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ConceptMap10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ConceptMap10_30.java @@ -4,7 +4,6 @@ import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.dstu3.model.ConceptMap; import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent; import org.hl7.fhir.exceptions.FHIRException; - import java.util.ArrayList; import java.util.List; @@ -15,26 +14,54 @@ public class ConceptMap10_30 { return null; org.hl7.fhir.dstu2.model.ConceptMap tgt = new org.hl7.fhir.dstu2.model.ConceptMap(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_10_30.convertType(src.getTarget())); - for (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertType(src.getTarget())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } return tgt; } @@ -43,26 +70,50 @@ public class ConceptMap10_30 { return null; org.hl7.fhir.dstu3.model.ConceptMap tgt = new org.hl7.fhir.dstu3.model.ConceptMap(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_10_30.convertType(src.getTarget())); + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertType(src.getTarget())); + } for (org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent t : src.getElement()) { List ws = convertSourceElementComponent(t); for (VersionConvertor_10_30.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp); @@ -75,8 +126,12 @@ public class ConceptMap10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -85,8 +140,12 @@ public class ConceptMap10_30 { return null; org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -149,9 +208,15 @@ public class ConceptMap10_30 { return null; org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setProperty(src.getElement()); - tgt.setSystem(src.getCodeSystem()); - tgt.setCode(src.getCode()); + if (src.hasElement()) { + tgt.setProperty(src.getElement()); + } + if (src.hasCodeSystem()) { + tgt.setSystem(src.getCodeSystem()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } return tgt; } @@ -160,9 +225,15 @@ public class ConceptMap10_30 { return null; org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setElement(src.getProperty()); - tgt.setCodeSystem(src.getSystem()); - tgt.setCode(src.getCode()); + if (src.hasProperty()) { + tgt.setElement(src.getProperty()); + } + if (src.hasSystem()) { + tgt.setCodeSystem(src.getSystem()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } return tgt; } @@ -173,9 +244,13 @@ public class ConceptMap10_30 { for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) { org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } tgt.addTarget(convertTargetElementComponent(t)); - res.add(new VersionConvertor_10_30.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem())); + if (src.hasCodeSystem()) { + res.add(new VersionConvertor_10_30.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem())); + } } return res; } @@ -186,8 +261,12 @@ public class ConceptMap10_30 { org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent(); VersionConvertor_10_30.copyElement(src, tgt); tgt.setCodeSystem(g.getSource()); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + } return tgt; } @@ -197,11 +276,21 @@ public class ConceptMap10_30 { org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent(); VersionConvertor_10_30.copyElement(src, tgt); tgt.setCodeSystem(g.getTarget()); - tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); - tgt.setComments(src.getComment()); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -210,11 +299,21 @@ public class ConceptMap10_30 { return null; org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); - tgt.setComment(src.getComments()); - for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Condition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Condition10_30.java index 38dcdc934..ac00e90cc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Condition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Condition10_30.java @@ -10,26 +10,54 @@ public class Condition10_30 { return null; org.hl7.fhir.dstu3.model.Condition tgt = new org.hl7.fhir.dstu3.model.Condition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setAsserter(VersionConvertor_10_30.convertReference(src.getAsserter())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasAsserter()) { + tgt.setAsserter(VersionConvertor_10_30.convertReference(src.getAsserter())); + } if (src.hasDateRecorded()) tgt.setAssertedDate(src.getDateRecorded()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } try { - tgt.setClinicalStatus(org.hl7.fhir.dstu3.model.Condition.ConditionClinicalStatus.fromCode(src.getClinicalStatus())); + if (src.hasClinicalStatus()) { + tgt.setClinicalStatus(org.hl7.fhir.dstu3.model.Condition.ConditionClinicalStatus.fromCode(src.getClinicalStatus())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - tgt.setSeverity(VersionConvertor_10_30.convertCodeableConcept(src.getSeverity())); - tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); - tgt.setAbatement(VersionConvertor_10_30.convertType(src.getAbatement())); - tgt.setStage(convertConditionStageComponent(src.getStage())); - for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasVerificationStatus()) { + tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); + } + if (src.hasSeverity()) { + tgt.setSeverity(VersionConvertor_10_30.convertCodeableConcept(src.getSeverity())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); + } + if (src.hasAbatement()) { + tgt.setAbatement(VersionConvertor_10_30.convertType(src.getAbatement())); + } + if (src.hasStage()) { + tgt.setStage(convertConditionStageComponent(src.getStage())); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -38,22 +66,50 @@ public class Condition10_30 { return null; org.hl7.fhir.dstu2.model.Condition tgt = new org.hl7.fhir.dstu2.model.Condition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setAsserter(VersionConvertor_10_30.convertReference(src.getAsserter())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasAsserter()) { + tgt.setAsserter(VersionConvertor_10_30.convertReference(src.getAsserter())); + } if (src.hasAssertedDate()) tgt.setDateRecorded(src.getAssertedDate()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setClinicalStatus(src.getClinicalStatus().toCode()); - tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - tgt.setSeverity(VersionConvertor_10_30.convertCodeableConcept(src.getSeverity())); - tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); - tgt.setAbatement(VersionConvertor_10_30.convertType(src.getAbatement())); - tgt.setStage(convertConditionStageComponent(src.getStage())); - for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasClinicalStatus()) { + tgt.setClinicalStatus(src.getClinicalStatus().toCode()); + } + if (src.hasVerificationStatus()) { + tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); + } + if (src.hasSeverity()) { + tgt.setSeverity(VersionConvertor_10_30.convertCodeableConcept(src.getSeverity())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); + } + if (src.hasAbatement()) { + tgt.setAbatement(VersionConvertor_10_30.convertType(src.getAbatement())); + } + if (src.hasStage()) { + tgt.setStage(convertConditionStageComponent(src.getStage())); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -62,8 +118,12 @@ public class Condition10_30 { return null; org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept cc : src.getCode()) tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(cc)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept cc : src.getCode()) tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(cc)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -72,8 +132,12 @@ public class Condition10_30 { return null; org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.addCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + if (src.hasCode()) { + tgt.addCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -82,8 +146,12 @@ public class Condition10_30 { return null; org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSummary(VersionConvertor_10_30.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_30.convertReference(t)); + if (src.hasSummary()) { + tgt.setSummary(VersionConvertor_10_30.convertCodeableConcept(src.getSummary())); + } + if (src.hasAssessment()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -92,8 +160,12 @@ public class Condition10_30 { return null; org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSummary(VersionConvertor_10_30.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_30.convertReference(t)); + if (src.hasSummary()) { + tgt.setSummary(VersionConvertor_10_30.convertCodeableConcept(src.getSummary())); + } + if (src.hasAssessment()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_30.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Conformance10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Conformance10_30.java index af73d8836..03eb3f7c4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Conformance10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Conformance10_30.java @@ -41,30 +41,66 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance tgt = new org.hl7.fhir.dstu2.model.Conformance(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } if (src.hasImplementation()) tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(src.getFhirVersion()); - tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasAcceptUnknown()) { + tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); + } + if (src.hasFormat()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -73,29 +109,67 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(src.getFhirVersion()); - tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasAcceptUnknown()) { + tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); + } + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -104,8 +178,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -114,8 +192,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -124,9 +206,15 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + } return tgt; } @@ -135,9 +223,15 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + } return tgt; } @@ -172,8 +266,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setUrl(src.getUrl()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -182,8 +280,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setUrl(src.getUrl()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -192,10 +294,18 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); - tgt.setReliableCache(src.getReliableCache()); - tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) { + tgt.setReliableCache(src.getReliableCache()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + } return tgt; } @@ -204,10 +314,18 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); - tgt.setReliableCache(src.getReliableCache()); - tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) { + tgt.setReliableCache(src.getReliableCache()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + } return tgt; } @@ -216,8 +334,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_10_30.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_10_30.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -226,8 +348,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_10_30.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_10_30.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -236,13 +362,27 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCoding(src.getCode())); - tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - tgt.setMode(convertConformanceEventMode(src.getMode())); - tgt.setFocus(src.getFocus()); - tgt.setRequest(VersionConvertor_10_30.convertReference(src.getRequest())); - tgt.setResponse(VersionConvertor_10_30.convertReference(src.getResponse())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCoding(src.getCode())); + } + if (src.hasCategory()) { + tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); + } + if (src.hasMode()) { + tgt.setMode(convertConformanceEventMode(src.getMode())); + } + if (src.hasFocus()) { + tgt.setFocus(src.getFocus()); + } + if (src.hasRequest()) { + tgt.setRequest(VersionConvertor_10_30.convertReference(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(VersionConvertor_10_30.convertReference(src.getResponse())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -251,13 +391,27 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCoding(src.getCode())); - tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - tgt.setMode(convertConformanceEventMode(src.getMode())); - tgt.setFocus(src.getFocus()); - tgt.setRequest(VersionConvertor_10_30.convertReference(src.getRequest())); - tgt.setResponse(VersionConvertor_10_30.convertReference(src.getResponse())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCoding(src.getCode())); + } + if (src.hasCategory()) { + tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); + } + if (src.hasMode()) { + tgt.setMode(convertConformanceEventMode(src.getMode())); + } + if (src.hasFocus()) { + tgt.setFocus(src.getFocus()); + } + if (src.hasRequest()) { + tgt.setRequest(VersionConvertor_10_30.convertReference(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(VersionConvertor_10_30.convertReference(src.getResponse())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -266,16 +420,32 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } if (src.getTransactionMode() == org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH || src.getTransactionMode() == org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH) tgt.addInteraction().setCode(SystemRestfulInteraction.BATCH); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu2.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -284,10 +454,18 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } boolean batch = false; boolean transaction = false; for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) { @@ -302,9 +480,15 @@ public class Conformance10_30 { tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH); else tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.TRANSACTION : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.NOTSUPPORTED); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -313,8 +497,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_10_30.convertReference(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(VersionConvertor_10_30.convertReference(src.getDefinition())); + } return tgt; } @@ -323,8 +511,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_10_30.convertReference(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(VersionConvertor_10_30.convertReference(src.getDefinition())); + } return tgt; } @@ -333,19 +525,41 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } if (src.hasProfile()) tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - tgt.setReadHistory(src.getReadHistory()); - tgt.setUpdateCreate(src.getUpdateCreate()); - tgt.setConditionalCreate(src.getConditionalCreate()); - tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } + if (src.hasReadHistory()) { + tgt.setReadHistory(src.getReadHistory()); + } + if (src.hasUpdateCreate()) { + tgt.setUpdateCreate(src.getUpdateCreate()); + } + if (src.hasConditionalCreate()) { + tgt.setConditionalCreate(src.getConditionalCreate()); + } + if (src.hasConditionalUpdate()) { + tgt.setConditionalUpdate(src.getConditionalUpdate()); + } + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -354,18 +568,42 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); - for (org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - tgt.setReadHistory(src.getReadHistory()); - tgt.setUpdateCreate(src.getUpdateCreate()); - tgt.setConditionalCreate(src.getConditionalCreate()); - tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } + if (src.hasReadHistory()) { + tgt.setReadHistory(src.getReadHistory()); + } + if (src.hasUpdateCreate()) { + tgt.setUpdateCreate(src.getUpdateCreate()); + } + if (src.hasConditionalCreate()) { + tgt.setConditionalCreate(src.getConditionalCreate()); + } + if (src.hasConditionalUpdate()) { + tgt.setConditionalUpdate(src.getConditionalUpdate()); + } + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -374,10 +612,18 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(src.getDefinition()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -386,10 +632,18 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(src.getDefinition()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -398,8 +652,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setBlob(src.getBlob()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasBlob()) { + tgt.setBlob(src.getBlob()); + } return tgt; } @@ -408,8 +666,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setBlob(src.getBlob()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasBlob()) { + tgt.setBlob(src.getBlob()); + } return tgt; } @@ -418,10 +680,18 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + if (src.hasCors()) { + tgt.setCors(src.getCors()); + } + if (src.hasService()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasCertificate()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + } return tgt; } @@ -430,10 +700,18 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + if (src.hasCors()) { + tgt.setCors(src.getCors()); + } + if (src.hasService()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasCertificate()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + } return tgt; } @@ -442,9 +720,15 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setVersion(src.getVersion()); - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasReleaseDate()) { + tgt.setReleaseDate(src.getReleaseDate()); + } return tgt; } @@ -453,9 +737,15 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setVersion(src.getVersion()); - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasReleaseDate()) { + tgt.setReleaseDate(src.getReleaseDate()); + } return tgt; } @@ -550,8 +840,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -560,8 +854,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -626,8 +924,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -636,8 +938,12 @@ public class Conformance10_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Contract10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Contract10_30.java index b2952f855..ba5295628 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Contract10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Contract10_30.java @@ -11,8 +11,12 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.AgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.AgentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getEntity())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasEntity()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getEntity())); + } + if (src.hasRole()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -21,8 +25,12 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.ActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ActorComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertReference(src.getActor())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasActor()) { + tgt.setEntity(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasRole()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -31,7 +39,9 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -40,7 +50,9 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -49,24 +61,60 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract tgt = new org.hl7.fhir.dstu2.model.Contract(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setIssued(src.getIssued()); - tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSubject()) tgt.addSubject(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthority()) tgt.addAuthority(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDomain()) tgt.addDomain(VersionConvertor_10_30.convertReference(t)); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType()) tgt.addSubType(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent()) tgt.addActor(convertAgentComponent(t)); - for (org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t)); - for (org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t)); - for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); - tgt.setBinding(VersionConvertor_10_30.convertType(src.getBinding())); - for (org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t)); - for (org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t)); - for (org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasApplies()) { + tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); + } + if (src.hasSubject()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSubject()) tgt.addSubject(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasAuthority()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthority()) tgt.addAuthority(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasDomain()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDomain()) tgt.addDomain(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasSubType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType()) tgt.addSubType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActionReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent()) tgt.addActor(convertAgentComponent(t)); + } + if (src.hasSigner()) { + for (org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t)); + } + if (src.hasValuedItem()) { + for (org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t)); + } + if (src.hasTerm()) { + for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); + } + if (src.hasBinding()) { + tgt.setBinding(VersionConvertor_10_30.convertType(src.getBinding())); + } + if (src.hasFriendly()) { + for (org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t)); + } + if (src.hasLegal()) { + for (org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t)); + } return tgt; } @@ -75,24 +123,60 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract tgt = new org.hl7.fhir.dstu3.model.Contract(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setIssued(src.getIssued()); - tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSubject()) tgt.addSubject(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthority()) tgt.addAuthority(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getDomain()) tgt.addDomain(VersionConvertor_10_30.convertReference(t)); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSubType()) tgt.addSubType(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Contract.ActorComponent t : src.getActor()) tgt.addAgent(convertAgentComponent(t)); - for (org.hl7.fhir.dstu2.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t)); - for (org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t)); - for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); - tgt.setBinding(VersionConvertor_10_30.convertType(src.getBinding())); - for (org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t)); - for (org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t)); - for (org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasApplies()) { + tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); + } + if (src.hasSubject()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSubject()) tgt.addSubject(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasAuthority()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthority()) tgt.addAuthority(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasDomain()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getDomain()) tgt.addDomain(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasSubType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSubType()) tgt.addSubType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActionReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.dstu2.model.Contract.ActorComponent t : src.getActor()) tgt.addAgent(convertAgentComponent(t)); + } + if (src.hasSigner()) { + for (org.hl7.fhir.dstu2.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t)); + } + if (src.hasValuedItem()) { + for (org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t)); + } + if (src.hasTerm()) { + for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); + } + if (src.hasBinding()) { + tgt.setBinding(VersionConvertor_10_30.convertType(src.getBinding())); + } + if (src.hasFriendly()) { + for (org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t)); + } + if (src.hasLegal()) { + for (org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t)); + } return tgt; } @@ -101,7 +185,9 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -110,7 +196,9 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -119,7 +207,9 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -128,7 +218,9 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertType(src.getContent())); + } return tgt; } @@ -137,8 +229,12 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu3.model.Contract.SignatoryComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); - tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); + } if (src.hasSignature()) tgt.addSignature(new org.hl7.fhir.dstu3.model.Signature().setBlob(src.getSignature().getBytes())); return tgt; @@ -149,9 +245,15 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu2.model.Contract.SignatoryComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); - tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); - for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.setSignature(Base64.encodeBase64String(t.getBlob())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); + } + if (src.hasSignature()) { + for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.setSignature(Base64.encodeBase64String(t.getBlob())); + } return tgt; } @@ -160,8 +262,12 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.TermActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermActorComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertReference(src.getActor())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasActor()) { + tgt.setEntity(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasRole()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -170,8 +276,12 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.TermAgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermAgentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getEntity())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasEntity()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getEntity())); + } + if (src.hasRole()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -180,17 +290,39 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setIssued(src.getIssued()); - tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setSubType(VersionConvertor_10_30.convertCodeableConcept(src.getSubType())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Contract.TermActorComponent t : src.getActor()) tgt.addAgent(convertTermAgentComponent(t)); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t)); - for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasApplies()) { + tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasSubType()) { + tgt.setSubType(VersionConvertor_10_30.convertCodeableConcept(src.getSubType())); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActionReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.dstu2.model.Contract.TermActorComponent t : src.getActor()) tgt.addAgent(convertTermAgentComponent(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasValuedItem()) { + for (org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + } return tgt; } @@ -199,17 +331,39 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setIssued(src.getIssued()); - tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setSubType(VersionConvertor_10_30.convertCodeableConcept(src.getSubType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Contract.TermAgentComponent t : src.getAgent()) tgt.addActor(convertTermAgentComponent(t)); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t)); - for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasApplies()) { + tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasSubType()) { + tgt.setSubType(VersionConvertor_10_30.convertCodeableConcept(src.getSubType())); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActionReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.Contract.TermAgentComponent t : src.getAgent()) tgt.addActor(convertTermAgentComponent(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasValuedItem()) { + for (org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + } return tgt; } @@ -218,14 +372,30 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setEffectiveTime(src.getEffectiveTime()); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); - tgt.setFactor(src.getFactor()); - tgt.setPoints(src.getPoints()); - tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasEffectiveTime()) { + tgt.setEffectiveTime(src.getEffectiveTime()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasUnitPrice()) { + tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); + } + if (src.hasFactor()) { + tgt.setFactor(src.getFactor()); + } + if (src.hasPoints()) { + tgt.setPoints(src.getPoints()); + } + if (src.hasNet()) { + tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + } return tgt; } @@ -234,14 +404,30 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setEffectiveTime(src.getEffectiveTime()); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); - tgt.setFactor(src.getFactor()); - tgt.setPoints(src.getPoints()); - tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasEffectiveTime()) { + tgt.setEffectiveTime(src.getEffectiveTime()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasUnitPrice()) { + tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); + } + if (src.hasFactor()) { + tgt.setFactor(src.getFactor()); + } + if (src.hasPoints()) { + tgt.setPoints(src.getPoints()); + } + if (src.hasNet()) { + tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + } return tgt; } @@ -250,14 +436,30 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setEffectiveTime(src.getEffectiveTime()); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); - tgt.setFactor(src.getFactor()); - tgt.setPoints(src.getPoints()); - tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasEffectiveTime()) { + tgt.setEffectiveTime(src.getEffectiveTime()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasUnitPrice()) { + tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); + } + if (src.hasFactor()) { + tgt.setFactor(src.getFactor()); + } + if (src.hasPoints()) { + tgt.setPoints(src.getPoints()); + } + if (src.hasNet()) { + tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + } return tgt; } @@ -266,14 +468,30 @@ public class Contract10_30 { return null; org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setEffectiveTime(src.getEffectiveTime()); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); - tgt.setFactor(src.getFactor()); - tgt.setPoints(src.getPoints()); - tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasEffectiveTime()) { + tgt.setEffectiveTime(src.getEffectiveTime()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasUnitPrice()) { + tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice())); + } + if (src.hasFactor()) { + tgt.setFactor(src.getFactor()); + } + if (src.hasPoints()) { + tgt.setPoints(src.getPoints()); + } + if (src.hasNet()) { + tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DataElement10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DataElement10_30.java index baa69e945..b38b8020e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DataElement10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DataElement10_30.java @@ -2,7 +2,6 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; - import java.util.ArrayList; import java.util.List; @@ -13,24 +12,48 @@ public class DataElement10_30 { return null; org.hl7.fhir.dstu2.model.DataElement tgt = new org.hl7.fhir.dstu2.model.DataElement(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setCopyright(src.getCopyright()); - tgt.setStringency(convertDataElementStringency(src.getStringency())); - for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_30.convertElementDefinition(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasStringency()) { + tgt.setStringency(convertDataElementStringency(src.getStringency())); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_30.convertElementDefinition(t)); + } return tgt; } @@ -39,24 +62,44 @@ public class DataElement10_30 { return null; org.hl7.fhir.dstu3.model.DataElement tgt = new org.hl7.fhir.dstu3.model.DataElement(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgt.setCopyright(src.getCopyright()); - tgt.setStringency(convertDataElementStringency(src.getStringency())); - for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasStringency()) { + tgt.setStringency(convertDataElementStringency(src.getStringency())); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } List slicePaths = new ArrayList(); for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) @@ -71,8 +114,12 @@ public class DataElement10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -81,8 +128,12 @@ public class DataElement10_30 { return null; org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -91,10 +142,18 @@ public class DataElement10_30 { return null; org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComment(src.getComments()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } return tgt; } @@ -103,10 +162,18 @@ public class DataElement10_30 { return null; org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComments(src.getComment()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DetectedIssue10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DetectedIssue10_30.java index fc0be0ce5..41bc4ab84 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DetectedIssue10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DetectedIssue10_30.java @@ -10,17 +10,35 @@ public class DetectedIssue10_30 { return null; org.hl7.fhir.dstu2.model.DetectedIssue tgt = new org.hl7.fhir.dstu2.model.DetectedIssue(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_30.convertReference(t)); - tgt.setDetail(src.getDetail()); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasSeverity()) { + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + } + if (src.hasImplicated()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasDetail()) { + tgt.setDetail(src.getDetail()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setReference(src.getReference()); - for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasReference()) { + tgt.setReference(src.getReference()); + } + if (src.hasMitigation()) { + for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -29,17 +47,35 @@ public class DetectedIssue10_30 { return null; org.hl7.fhir.dstu3.model.DetectedIssue tgt = new org.hl7.fhir.dstu3.model.DetectedIssue(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_30.convertReference(t)); - tgt.setDetail(src.getDetail()); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasSeverity()) { + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + } + if (src.hasImplicated()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasDetail()) { + tgt.setDetail(src.getDetail()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setReference(src.getReference()); - for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasReference()) { + tgt.setReference(src.getReference()); + } + if (src.hasMitigation()) { + for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -48,10 +84,14 @@ public class DetectedIssue10_30 { return null; org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } return tgt; } @@ -60,10 +100,14 @@ public class DetectedIssue10_30 { return null; org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Device10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Device10_30.java index 3ef4fa10f..210f8861a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Device10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Device10_30.java @@ -10,23 +10,53 @@ public class Device10_30 { return null; org.hl7.fhir.dstu2.model.Device tgt = new org.hl7.fhir.dstu2.model.Device(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } if (src.hasUdi()) tgt.setUdi(src.getUdi().getDeviceIdentifier()); - tgt.setStatus(convertDeviceStatus(src.getStatus())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setLotNumber(src.getLotNumber()); - tgt.setManufacturer(src.getManufacturer()); - tgt.setManufactureDate(src.getManufactureDate()); - tgt.setExpiry(src.getExpirationDate()); - tgt.setModel(src.getModel()); - tgt.setVersion(src.getVersion()); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); + if (src.hasStatus()) { + tgt.setStatus(convertDeviceStatus(src.getStatus())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasLotNumber()) { + tgt.setLotNumber(src.getLotNumber()); + } + if (src.hasManufacturer()) { + tgt.setManufacturer(src.getManufacturer()); + } + if (src.hasManufactureDate()) { + tgt.setManufactureDate(src.getManufactureDate()); + } + if (src.hasExpirationDate()) { + tgt.setExpiry(src.getExpirationDate()); + } + if (src.hasModel()) { + tgt.setModel(src.getModel()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasOwner()) { + tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); + } return tgt; } @@ -35,22 +65,54 @@ public class Device10_30 { return null; org.hl7.fhir.dstu3.model.Device tgt = new org.hl7.fhir.dstu3.model.Device(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setUdi((new org.hl7.fhir.dstu3.model.Device.DeviceUdiComponent()).setDeviceIdentifier(src.getUdi())); - tgt.setStatus(convertDeviceStatus(src.getStatus())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setLotNumber(src.getLotNumber()); - tgt.setManufacturer(src.getManufacturer()); - tgt.setManufactureDate(src.getManufactureDate()); - tgt.setExpirationDate(src.getExpiry()); - tgt.setModel(src.getModel()); - tgt.setVersion(src.getVersion()); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasUdi()) { + tgt.setUdi((new org.hl7.fhir.dstu3.model.Device.DeviceUdiComponent()).setDeviceIdentifier(src.getUdi())); + } + if (src.hasStatus()) { + tgt.setStatus(convertDeviceStatus(src.getStatus())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasLotNumber()) { + tgt.setLotNumber(src.getLotNumber()); + } + if (src.hasManufacturer()) { + tgt.setManufacturer(src.getManufacturer()); + } + if (src.hasManufactureDate()) { + tgt.setManufactureDate(src.getManufactureDate()); + } + if (src.hasExpiry()) { + tgt.setExpirationDate(src.getExpiry()); + } + if (src.hasModel()) { + tgt.setModel(src.getModel()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasOwner()) { + tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu2.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceComponent10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceComponent10_30.java index 8ac04058f..36b418a37 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceComponent10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceComponent10_30.java @@ -10,16 +10,36 @@ public class DeviceComponent10_30 { return null; org.hl7.fhir.dstu2.model.DeviceComponent tgt = new org.hl7.fhir.dstu2.model.DeviceComponent(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setLastSystemChange(src.getLastSystemChange()); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOperationalStatus()) tgt.addOperationalStatus(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setParameterGroup(VersionConvertor_10_30.convertCodeableConcept(src.getParameterGroup())); - tgt.setMeasurementPrinciple(convertMeasmntPrinciple(src.getMeasurementPrinciple())); - for (org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification()) tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t)); - tgt.setLanguageCode(VersionConvertor_10_30.convertCodeableConcept(src.getLanguageCode())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasLastSystemChange()) { + tgt.setLastSystemChange(src.getLastSystemChange()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOperationalStatus()) tgt.addOperationalStatus(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasParameterGroup()) { + tgt.setParameterGroup(VersionConvertor_10_30.convertCodeableConcept(src.getParameterGroup())); + } + if (src.hasMeasurementPrinciple()) { + tgt.setMeasurementPrinciple(convertMeasmntPrinciple(src.getMeasurementPrinciple())); + } + if (src.hasProductionSpecification()) { + for (org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification()) tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t)); + } + if (src.hasLanguageCode()) { + tgt.setLanguageCode(VersionConvertor_10_30.convertCodeableConcept(src.getLanguageCode())); + } return tgt; } @@ -28,16 +48,36 @@ public class DeviceComponent10_30 { return null; org.hl7.fhir.dstu3.model.DeviceComponent tgt = new org.hl7.fhir.dstu3.model.DeviceComponent(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setLastSystemChange(src.getLastSystemChange()); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getOperationalStatus()) tgt.addOperationalStatus(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setParameterGroup(VersionConvertor_10_30.convertCodeableConcept(src.getParameterGroup())); - tgt.setMeasurementPrinciple(convertMeasmntPrinciple(src.getMeasurementPrinciple())); - for (org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification()) tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t)); - tgt.setLanguageCode(VersionConvertor_10_30.convertCodeableConcept(src.getLanguageCode())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasLastSystemChange()) { + tgt.setLastSystemChange(src.getLastSystemChange()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getOperationalStatus()) tgt.addOperationalStatus(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasParameterGroup()) { + tgt.setParameterGroup(VersionConvertor_10_30.convertCodeableConcept(src.getParameterGroup())); + } + if (src.hasMeasurementPrinciple()) { + tgt.setMeasurementPrinciple(convertMeasmntPrinciple(src.getMeasurementPrinciple())); + } + if (src.hasProductionSpecification()) { + for (org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification()) tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t)); + } + if (src.hasLanguageCode()) { + tgt.setLanguageCode(VersionConvertor_10_30.convertCodeableConcept(src.getLanguageCode())); + } return tgt; } @@ -46,9 +86,15 @@ public class DeviceComponent10_30 { return null; org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent tgt = new org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSpecType(VersionConvertor_10_30.convertCodeableConcept(src.getSpecType())); - tgt.setComponentId(VersionConvertor_10_30.convertIdentifier(src.getComponentId())); - tgt.setProductionSpec(src.getProductionSpec()); + if (src.hasSpecType()) { + tgt.setSpecType(VersionConvertor_10_30.convertCodeableConcept(src.getSpecType())); + } + if (src.hasComponentId()) { + tgt.setComponentId(VersionConvertor_10_30.convertIdentifier(src.getComponentId())); + } + if (src.hasProductionSpec()) { + tgt.setProductionSpec(src.getProductionSpec()); + } return tgt; } @@ -57,9 +103,15 @@ public class DeviceComponent10_30 { return null; org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSpecType(VersionConvertor_10_30.convertCodeableConcept(src.getSpecType())); - tgt.setComponentId(VersionConvertor_10_30.convertIdentifier(src.getComponentId())); - tgt.setProductionSpec(src.getProductionSpec()); + if (src.hasSpecType()) { + tgt.setSpecType(VersionConvertor_10_30.convertCodeableConcept(src.getSpecType())); + } + if (src.hasComponentId()) { + tgt.setComponentId(VersionConvertor_10_30.convertIdentifier(src.getComponentId())); + } + if (src.hasProductionSpec()) { + tgt.setProductionSpec(src.getProductionSpec()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceMetric10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceMetric10_30.java index 330ea73ae..0444f24a3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceMetric10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceMetric10_30.java @@ -10,16 +10,36 @@ public class DeviceMetric10_30 { return null; org.hl7.fhir.dstu2.model.DeviceMetric tgt = new org.hl7.fhir.dstu2.model.DeviceMetric(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setUnit(VersionConvertor_10_30.convertCodeableConcept(src.getUnit())); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - tgt.setColor(convertDeviceMetricColor(src.getColor())); - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - tgt.setMeasurementPeriod(VersionConvertor_10_30.convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasUnit()) { + tgt.setUnit(VersionConvertor_10_30.convertCodeableConcept(src.getUnit())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + } + if (src.hasColor()) { + tgt.setColor(convertDeviceMetricColor(src.getColor())); + } + if (src.hasCategory()) { + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + } + if (src.hasMeasurementPeriod()) { + tgt.setMeasurementPeriod(VersionConvertor_10_30.convertTiming(src.getMeasurementPeriod())); + } + if (src.hasCalibration()) { + for (org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } return tgt; } @@ -28,16 +48,36 @@ public class DeviceMetric10_30 { return null; org.hl7.fhir.dstu3.model.DeviceMetric tgt = new org.hl7.fhir.dstu3.model.DeviceMetric(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setUnit(VersionConvertor_10_30.convertCodeableConcept(src.getUnit())); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - tgt.setColor(convertDeviceMetricColor(src.getColor())); - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - tgt.setMeasurementPeriod(VersionConvertor_10_30.convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasUnit()) { + tgt.setUnit(VersionConvertor_10_30.convertCodeableConcept(src.getUnit())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_30.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + } + if (src.hasColor()) { + tgt.setColor(convertDeviceMetricColor(src.getColor())); + } + if (src.hasCategory()) { + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + } + if (src.hasMeasurementPeriod()) { + tgt.setMeasurementPeriod(VersionConvertor_10_30.convertTiming(src.getMeasurementPeriod())); + } + if (src.hasCalibration()) { + for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } return tgt; } @@ -46,9 +86,15 @@ public class DeviceMetric10_30 { return null; org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - tgt.setTime(src.getTime()); + if (src.hasType()) { + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + } + if (src.hasState()) { + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } return tgt; } @@ -57,9 +103,15 @@ public class DeviceMetric10_30 { return null; org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - tgt.setTime(src.getTime()); + if (src.hasType()) { + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + } + if (src.hasState()) { + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceUseStatement10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceUseStatement10_30.java index 2a8f12f97..3848e19d4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceUseStatement10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DeviceUseStatement10_30.java @@ -11,15 +11,33 @@ public class DeviceUseStatement10_30 { return null; org.hl7.fhir.dstu2.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu2.model.DeviceUseStatement(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setBodySite(VersionConvertor_10_30.convertType(src.getBodySite())); - tgt.setWhenUsed(VersionConvertor_10_30.convertPeriod(src.getWhenUsed())); - tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication()) tgt.addIndication(VersionConvertor_10_30.convertCodeableConcept(t)); - for (Annotation t : src.getNote()) tgt.addNotes(t.getText()); - tgt.setRecordedOn(src.getRecordedOn()); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setTiming(VersionConvertor_10_30.convertType(src.getTiming())); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_30.convertType(src.getBodySite())); + } + if (src.hasWhenUsed()) { + tgt.setWhenUsed(VersionConvertor_10_30.convertPeriod(src.getWhenUsed())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasIndication()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication()) tgt.addIndication(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (Annotation t : src.getNote()) tgt.addNotes(t.getText()); + } + if (src.hasRecordedOn()) { + tgt.setRecordedOn(src.getRecordedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_30.convertType(src.getTiming())); + } return tgt; } @@ -30,14 +48,30 @@ public class DeviceUseStatement10_30 { VersionConvertor_10_30.copyDomainResource(src, tgt); if (src.hasBodySiteCodeableConcept()) tgt.setBodySite(VersionConvertor_10_30.convertCodeableConcept(src.getBodySiteCodeableConcept())); - tgt.setWhenUsed(VersionConvertor_10_30.convertPeriod(src.getWhenUsed())); - tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication()) tgt.addIndication(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue()); - tgt.setRecordedOn(src.getRecordedOn()); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setTiming(VersionConvertor_10_30.convertType(src.getTiming())); + if (src.hasWhenUsed()) { + tgt.setWhenUsed(VersionConvertor_10_30.convertPeriod(src.getWhenUsed())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasIndication()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication()) tgt.addIndication(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasNotes()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue()); + } + if (src.hasRecordedOn()) { + tgt.setRecordedOn(src.getRecordedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_30.convertType(src.getTiming())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DiagnosticReport10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DiagnosticReport10_30.java index 5888ad0eb..ae774cba9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DiagnosticReport10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DiagnosticReport10_30.java @@ -10,22 +10,54 @@ public class DiagnosticReport10_30 { return null; org.hl7.fhir.dstu2.model.DiagnosticReport tgt = new org.hl7.fhir.dstu2.model.DiagnosticReport(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addRequest(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addImage(convertDiagnosticReportImageComponent(t)); - tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addCodedDiagnosis(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_30.convertAttachment(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addRequest(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + } + if (src.hasConclusion()) { + tgt.setConclusion(src.getConclusion()); + } + if (src.hasCodedDiagnosis()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addCodedDiagnosis(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_30.convertAttachment(t)); + } return tgt; } @@ -34,22 +66,54 @@ public class DiagnosticReport10_30 { return null; org.hl7.fhir.dstu3.model.DiagnosticReport tgt = new org.hl7.fhir.dstu3.model.DiagnosticReport(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRequest()) tgt.addBasedOn(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addImage(convertDiagnosticReportImageComponent(t)); - tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addCodedDiagnosis(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_30.convertAttachment(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasRequest()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRequest()) tgt.addBasedOn(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + } + if (src.hasConclusion()) { + tgt.setConclusion(src.getConclusion()); + } + if (src.hasCodedDiagnosis()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addCodedDiagnosis(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_30.convertAttachment(t)); + } return tgt; } @@ -58,8 +122,12 @@ public class DiagnosticReport10_30 { return null; org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent tgt = new org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setComment(src.getComment()); - tgt.setLink(VersionConvertor_10_30.convertReference(src.getLink())); + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasLink()) { + tgt.setLink(VersionConvertor_10_30.convertReference(src.getLink())); + } return tgt; } @@ -68,8 +136,12 @@ public class DiagnosticReport10_30 { return null; org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent tgt = new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setComment(src.getComment()); - tgt.setLink(VersionConvertor_10_30.convertReference(src.getLink())); + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasLink()) { + tgt.setLink(VersionConvertor_10_30.convertReference(src.getLink())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentManifest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentManifest10_30.java index aac0adf87..79d602bdc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentManifest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentManifest10_30.java @@ -10,18 +10,42 @@ public class DocumentManifest10_30 { return null; org.hl7.fhir.dstu2.model.DocumentManifest tgt = new org.hl7.fhir.dstu2.model.DocumentManifest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - tgt.setCreated(src.getCreated()); - tgt.setSource(src.getSource()); - tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestContentComponent t : src.getContent()) tgt.addContent(convertDocumentManifestContentComponent(t)); - for (org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasSource()) { + tgt.setSource(src.getSource()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestContentComponent t : src.getContent()) tgt.addContent(convertDocumentManifestContentComponent(t)); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + } return tgt; } @@ -30,18 +54,42 @@ public class DocumentManifest10_30 { return null; org.hl7.fhir.dstu3.model.DocumentManifest tgt = new org.hl7.fhir.dstu3.model.DocumentManifest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - tgt.setCreated(src.getCreated()); - tgt.setSource(src.getSource()); - tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestContentComponent t : src.getContent()) tgt.addContent(convertDocumentManifestContentComponent(t)); - for (org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasSource()) { + tgt.setSource(src.getSource()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestContentComponent t : src.getContent()) tgt.addContent(convertDocumentManifestContentComponent(t)); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + } return tgt; } @@ -50,7 +98,9 @@ public class DocumentManifest10_30 { return null; org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestContentComponent tgt = new org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestContentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setP(VersionConvertor_10_30.convertType(src.getP())); + if (src.hasP()) { + tgt.setP(VersionConvertor_10_30.convertType(src.getP())); + } return tgt; } @@ -59,7 +109,9 @@ public class DocumentManifest10_30 { return null; org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestContentComponent tgt = new org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestContentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setP(VersionConvertor_10_30.convertType(src.getP())); + if (src.hasP()) { + tgt.setP(VersionConvertor_10_30.convertType(src.getP())); + } return tgt; } @@ -68,8 +120,12 @@ public class DocumentManifest10_30 { return null; org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestRelatedComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasRef()) { + tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + } return tgt; } @@ -78,8 +134,12 @@ public class DocumentManifest10_30 { return null; org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestRelatedComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasRef()) { + tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentReference10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentReference10_30.java index 9e8341580..eea210aca 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentReference10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/DocumentReference10_30.java @@ -45,23 +45,57 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu3.model.DocumentReference tgt = new org.hl7.fhir.dstu3.model.DocumentReference(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); - tgt.setAuthenticator(VersionConvertor_10_30.convertReference(src.getAuthenticator())); - tgt.setCreated(src.getCreated()); - tgt.setIndexed(src.getIndexed()); - tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); - tgt.setDocStatus(convertDocStatus(src.getDocStatus())); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); + } + if (src.hasAuthenticator()) { + tgt.setAuthenticator(VersionConvertor_10_30.convertReference(src.getAuthenticator())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasIndexed()) { + tgt.setIndexed(src.getIndexed()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDocStatus()) { + tgt.setDocStatus(convertDocStatus(src.getDocStatus())); + } + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) { + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + } return tgt; } @@ -70,23 +104,57 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu2.model.DocumentReference tgt = new org.hl7.fhir.dstu2.model.DocumentReference(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); - tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); - tgt.setAuthenticator(VersionConvertor_10_30.convertReference(src.getAuthenticator())); - tgt.setCreated(src.getCreated()); - tgt.setIndexed(src.getIndexed()); - tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); - tgt.setDocStatus(convertDocStatus(src.getDocStatus())); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_30.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.setClass_(VersionConvertor_10_30.convertCodeableConcept(src.getClass_())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_30.convertReference(src.getCustodian())); + } + if (src.hasAuthenticator()) { + tgt.setAuthenticator(VersionConvertor_10_30.convertReference(src.getAuthenticator())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasIndexed()) { + tgt.setIndexed(src.getIndexed()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDocStatus()) { + tgt.setDocStatus(convertDocStatus(src.getDocStatus())); + } + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) { + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + } return tgt; } @@ -95,8 +163,12 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAttachment(VersionConvertor_10_30.convertAttachment(src.getAttachment())); - tgt.addFormat(VersionConvertor_10_30.convertCoding(src.getFormat())); + if (src.hasAttachment()) { + tgt.setAttachment(VersionConvertor_10_30.convertAttachment(src.getAttachment())); + } + if (src.hasFormat()) { + tgt.addFormat(VersionConvertor_10_30.convertCoding(src.getFormat())); + } return tgt; } @@ -105,8 +177,12 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAttachment(VersionConvertor_10_30.convertAttachment(src.getAttachment())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getFormat()) tgt.setFormat(VersionConvertor_10_30.convertCoding(t)); + if (src.hasAttachment()) { + tgt.setAttachment(VersionConvertor_10_30.convertAttachment(src.getAttachment())); + } + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getFormat()) tgt.setFormat(VersionConvertor_10_30.convertCoding(t)); + } return tgt; } @@ -115,13 +191,27 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setFacilityType(VersionConvertor_10_30.convertCodeableConcept(src.getFacilityType())); - tgt.setPracticeSetting(VersionConvertor_10_30.convertCodeableConcept(src.getPracticeSetting())); - tgt.setSourcePatientInfo(VersionConvertor_10_30.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasFacilityType()) { + tgt.setFacilityType(VersionConvertor_10_30.convertCodeableConcept(src.getFacilityType())); + } + if (src.hasPracticeSetting()) { + tgt.setPracticeSetting(VersionConvertor_10_30.convertCodeableConcept(src.getPracticeSetting())); + } + if (src.hasSourcePatientInfo()) { + tgt.setSourcePatientInfo(VersionConvertor_10_30.convertReference(src.getSourcePatientInfo())); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -130,13 +220,27 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setFacilityType(VersionConvertor_10_30.convertCodeableConcept(src.getFacilityType())); - tgt.setPracticeSetting(VersionConvertor_10_30.convertCodeableConcept(src.getPracticeSetting())); - tgt.setSourcePatientInfo(VersionConvertor_10_30.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasFacilityType()) { + tgt.setFacilityType(VersionConvertor_10_30.convertCodeableConcept(src.getFacilityType())); + } + if (src.hasPracticeSetting()) { + tgt.setPracticeSetting(VersionConvertor_10_30.convertCodeableConcept(src.getPracticeSetting())); + } + if (src.hasSourcePatientInfo()) { + tgt.setSourcePatientInfo(VersionConvertor_10_30.convertReference(src.getSourcePatientInfo())); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -145,8 +249,12 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasRef()) { + tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + } return tgt; } @@ -155,8 +263,12 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasRef()) { + tgt.setRef(VersionConvertor_10_30.convertReference(src.getRef())); + } return tgt; } @@ -165,8 +277,12 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + if (src.hasCode()) { + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } return tgt; } @@ -175,8 +291,12 @@ public class DocumentReference10_30 { return null; org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + if (src.hasCode()) { + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Encounter10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Encounter10_30.java index 316f64a83..a3be80529 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Encounter10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Encounter10_30.java @@ -10,23 +10,57 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu3.model.Encounter tgt = new org.hl7.fhir.dstu3.model.Encounter(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertEncounterState(src.getStatus())); - tgt.setClass_(convertEncounterClass(src.getClass_())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPriority(VersionConvertor_10_30.convertCodeableConcept(src.getPriority())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getIncomingReferral()) tgt.addIncomingReferral(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); - tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setLength(VersionConvertor_10_30.convertDuration(src.getLength())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); - tgt.setServiceProvider(VersionConvertor_10_30.convertReference(src.getServiceProvider())); - tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterState(src.getStatus())); + } + if (src.hasClass_()) { + tgt.setClass_(convertEncounterClass(src.getClass_())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(VersionConvertor_10_30.convertCodeableConcept(src.getPriority())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getIncomingReferral()) tgt.addIncomingReferral(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasLength()) { + tgt.setLength(VersionConvertor_10_30.convertDuration(src.getLength())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasHospitalization()) { + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) { + tgt.setServiceProvider(VersionConvertor_10_30.convertReference(src.getServiceProvider())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + } return tgt; } @@ -35,23 +69,57 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu2.model.Encounter tgt = new org.hl7.fhir.dstu2.model.Encounter(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertEncounterState(src.getStatus())); - tgt.setClass_(convertEncounterClass(src.getClass_())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPriority(VersionConvertor_10_30.convertCodeableConcept(src.getPriority())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addIncomingReferral(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); - tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setLength(VersionConvertor_10_30.convertDuration(src.getLength())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); - tgt.setServiceProvider(VersionConvertor_10_30.convertReference(src.getServiceProvider())); - tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterState(src.getStatus())); + } + if (src.hasClass_()) { + tgt.setClass_(convertEncounterClass(src.getClass_())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(VersionConvertor_10_30.convertCodeableConcept(src.getPriority())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addIncomingReferral(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_30.convertReference(src.getAppointment())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasLength()) { + tgt.setLength(VersionConvertor_10_30.convertDuration(src.getLength())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasHospitalization()) { + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) { + tgt.setServiceProvider(VersionConvertor_10_30.convertReference(src.getServiceProvider())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + } return tgt; } @@ -107,15 +175,33 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu3.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.dstu3.model.Encounter.EncounterHospitalizationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setPreAdmissionIdentifier(VersionConvertor_10_30.convertIdentifier(src.getPreAdmissionIdentifier())); - tgt.setOrigin(VersionConvertor_10_30.convertReference(src.getOrigin())); - tgt.setAdmitSource(VersionConvertor_10_30.convertCodeableConcept(src.getAdmitSource())); - tgt.setReAdmission(VersionConvertor_10_30.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); - tgt.setDischargeDisposition(VersionConvertor_10_30.convertCodeableConcept(src.getDischargeDisposition())); + if (src.hasPreAdmissionIdentifier()) { + tgt.setPreAdmissionIdentifier(VersionConvertor_10_30.convertIdentifier(src.getPreAdmissionIdentifier())); + } + if (src.hasOrigin()) { + tgt.setOrigin(VersionConvertor_10_30.convertReference(src.getOrigin())); + } + if (src.hasAdmitSource()) { + tgt.setAdmitSource(VersionConvertor_10_30.convertCodeableConcept(src.getAdmitSource())); + } + if (src.hasReAdmission()) { + tgt.setReAdmission(VersionConvertor_10_30.convertCodeableConcept(src.getReAdmission())); + } + if (src.hasDietPreference()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); + } + if (src.hasDischargeDisposition()) { + tgt.setDischargeDisposition(VersionConvertor_10_30.convertCodeableConcept(src.getDischargeDisposition())); + } return tgt; } @@ -124,15 +210,33 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setPreAdmissionIdentifier(VersionConvertor_10_30.convertIdentifier(src.getPreAdmissionIdentifier())); - tgt.setOrigin(VersionConvertor_10_30.convertReference(src.getOrigin())); - tgt.setAdmitSource(VersionConvertor_10_30.convertCodeableConcept(src.getAdmitSource())); - tgt.setReAdmission(VersionConvertor_10_30.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); - tgt.setDischargeDisposition(VersionConvertor_10_30.convertCodeableConcept(src.getDischargeDisposition())); + if (src.hasPreAdmissionIdentifier()) { + tgt.setPreAdmissionIdentifier(VersionConvertor_10_30.convertIdentifier(src.getPreAdmissionIdentifier())); + } + if (src.hasOrigin()) { + tgt.setOrigin(VersionConvertor_10_30.convertReference(src.getOrigin())); + } + if (src.hasAdmitSource()) { + tgt.setAdmitSource(VersionConvertor_10_30.convertCodeableConcept(src.getAdmitSource())); + } + if (src.hasReAdmission()) { + tgt.setReAdmission(VersionConvertor_10_30.convertCodeableConcept(src.getReAdmission())); + } + if (src.hasDietPreference()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); + } + if (src.hasDischargeDisposition()) { + tgt.setDischargeDisposition(VersionConvertor_10_30.convertCodeableConcept(src.getDischargeDisposition())); + } return tgt; } @@ -141,9 +245,15 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -152,9 +262,15 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -197,9 +313,15 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setIndividual(VersionConvertor_10_30.convertReference(src.getIndividual())); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasIndividual()) { + tgt.setIndividual(VersionConvertor_10_30.convertReference(src.getIndividual())); + } return tgt; } @@ -208,9 +330,15 @@ public class Encounter10_30 { return null; org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setIndividual(VersionConvertor_10_30.convertReference(src.getIndividual())); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasIndividual()) { + tgt.setIndividual(VersionConvertor_10_30.convertReference(src.getIndividual())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentRequest10_30.java index 145d9e4ed..e0d6a1ef8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentRequest10_30.java @@ -10,12 +10,24 @@ public class EnrollmentRequest10_30 { return null; org.hl7.fhir.dstu3.model.EnrollmentRequest tgt = new org.hl7.fhir.dstu3.model.EnrollmentRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCreated(src.getCreated()); - tgt.setProvider(VersionConvertor_10_30.convertReference(src.getProvider())); - tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setCoverage(VersionConvertor_10_30.convertReference(src.getCoverage())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasProvider()) { + tgt.setProvider(VersionConvertor_10_30.convertReference(src.getProvider())); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasCoverage()) { + tgt.setCoverage(VersionConvertor_10_30.convertReference(src.getCoverage())); + } return tgt; } @@ -24,9 +36,15 @@ public class EnrollmentRequest10_30 { return null; org.hl7.fhir.dstu2.model.EnrollmentRequest tgt = new org.hl7.fhir.dstu2.model.EnrollmentRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCreated(src.getCreated()); - tgt.setCoverage(VersionConvertor_10_30.convertReference(src.getCoverage())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasCoverage()) { + tgt.setCoverage(VersionConvertor_10_30.convertReference(src.getCoverage())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentResponse10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentResponse10_30.java index 3447411c4..3e74d2433 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentResponse10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EnrollmentResponse10_30.java @@ -10,13 +10,27 @@ public class EnrollmentResponse10_30 { return null; org.hl7.fhir.dstu3.model.EnrollmentResponse tgt = new org.hl7.fhir.dstu3.model.EnrollmentResponse(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setRequest(VersionConvertor_10_30.convertReference(src.getRequest())); - tgt.setDisposition(src.getDisposition()); - tgt.setCreated(src.getCreated()); - tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); - tgt.setRequestProvider(VersionConvertor_10_30.convertReference(src.getRequestProvider())); - tgt.setRequestOrganization(VersionConvertor_10_30.convertReference(src.getRequestOrganization())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasRequest()) { + tgt.setRequest(VersionConvertor_10_30.convertReference(src.getRequest())); + } + if (src.hasDisposition()) { + tgt.setDisposition(src.getDisposition()); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); + } + if (src.hasRequestProvider()) { + tgt.setRequestProvider(VersionConvertor_10_30.convertReference(src.getRequestProvider())); + } + if (src.hasRequestOrganization()) { + tgt.setRequestOrganization(VersionConvertor_10_30.convertReference(src.getRequestOrganization())); + } return tgt; } @@ -25,9 +39,15 @@ public class EnrollmentResponse10_30 { return null; org.hl7.fhir.dstu2.model.EnrollmentResponse tgt = new org.hl7.fhir.dstu2.model.EnrollmentResponse(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setDisposition(src.getDisposition()); - tgt.setCreated(src.getCreated()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasDisposition()) { + tgt.setDisposition(src.getDisposition()); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EpisodeOfCare10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EpisodeOfCare10_30.java index 03daba1d9..ac5535b2c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EpisodeOfCare10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/EpisodeOfCare10_30.java @@ -10,15 +10,33 @@ public class EpisodeOfCare10_30 { return null; org.hl7.fhir.dstu3.model.EpisodeOfCare tgt = new org.hl7.fhir.dstu3.model.EpisodeOfCare(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_30.convertReference(t)); - tgt.setCareManager(VersionConvertor_10_30.convertReference(src.getCareManager())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasReferralRequest()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCareManager()) { + tgt.setCareManager(VersionConvertor_10_30.convertReference(src.getCareManager())); + } return tgt; } @@ -27,15 +45,33 @@ public class EpisodeOfCare10_30 { return null; org.hl7.fhir.dstu2.model.EpisodeOfCare tgt = new org.hl7.fhir.dstu2.model.EpisodeOfCare(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_30.convertReference(t)); - tgt.setCareManager(VersionConvertor_10_30.convertReference(src.getCareManager())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasReferralRequest()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasCareManager()) { + tgt.setCareManager(VersionConvertor_10_30.convertReference(src.getCareManager())); + } return tgt; } @@ -86,8 +122,12 @@ public class EpisodeOfCare10_30 { return null; org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -96,8 +136,12 @@ public class EpisodeOfCare10_30 { return null; org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/FamilyMemberHistory10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/FamilyMemberHistory10_30.java index 349693170..6ac0e5d56 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/FamilyMemberHistory10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/FamilyMemberHistory10_30.java @@ -44,18 +44,38 @@ public class FamilyMemberHistory10_30 { return null; org.hl7.fhir.dstu3.model.FamilyMemberHistory tgt = new org.hl7.fhir.dstu3.model.FamilyMemberHistory(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBorn(VersionConvertor_10_30.convertType(src.getBorn())); - tgt.setAge(VersionConvertor_10_30.convertType(src.getAge())); - tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasStatus()) { + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBorn()) { + tgt.setBorn(VersionConvertor_10_30.convertType(src.getBorn())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_30.convertType(src.getAge())); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -64,18 +84,38 @@ public class FamilyMemberHistory10_30 { return null; org.hl7.fhir.dstu2.model.FamilyMemberHistory tgt = new org.hl7.fhir.dstu2.model.FamilyMemberHistory(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBorn(VersionConvertor_10_30.convertType(src.getBorn())); - tgt.setAge(VersionConvertor_10_30.convertType(src.getAge())); - tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasStatus()) { + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBorn()) { + tgt.setBorn(VersionConvertor_10_30.convertType(src.getBorn())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_30.convertType(src.getAge())); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -84,9 +124,15 @@ public class FamilyMemberHistory10_30 { return null; org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); - tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); + } return tgt; } @@ -95,9 +141,15 @@ public class FamilyMemberHistory10_30 { return null; org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); - tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_30.convertType(src.getOnset())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Flag10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Flag10_30.java index 2a6b526b9..eeaf5868a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Flag10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Flag10_30.java @@ -10,14 +10,30 @@ public class Flag10_30 { return null; org.hl7.fhir.dstu3.model.Flag tgt = new org.hl7.fhir.dstu3.model.Flag(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setStatus(convertFlagStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasStatus()) { + tgt.setStatus(convertFlagStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } return tgt; } @@ -26,14 +42,30 @@ public class Flag10_30 { return null; org.hl7.fhir.dstu2.model.Flag tgt = new org.hl7.fhir.dstu2.model.Flag(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setStatus(convertFlagStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasStatus()) { + tgt.setStatus(convertFlagStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Group10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Group10_30.java index 951106775..0958d0c32 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Group10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Group10_30.java @@ -10,14 +10,30 @@ public class Group10_30 { return null; org.hl7.fhir.dstu2.model.Group tgt = new org.hl7.fhir.dstu2.model.Group(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setType(convertGroupType(src.getType())); - tgt.setActual(src.getActual()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setName(src.getName()); - tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.dstu3.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertGroupType(src.getType())); + } + if (src.hasActual()) { + tgt.setActual(src.getActual()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuantity()) { + tgt.setQuantity(src.getQuantity()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.dstu3.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -26,14 +42,30 @@ public class Group10_30 { return null; org.hl7.fhir.dstu3.model.Group tgt = new org.hl7.fhir.dstu3.model.Group(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setType(convertGroupType(src.getType())); - tgt.setActual(src.getActual()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setName(src.getName()); - tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.dstu2.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertGroupType(src.getType())); + } + if (src.hasActual()) { + tgt.setActual(src.getActual()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuantity()) { + tgt.setQuantity(src.getQuantity()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.dstu2.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -42,10 +74,18 @@ public class Group10_30 { return null; org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setExclude(src.getExclude()); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasExclude()) { + tgt.setExclude(src.getExclude()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -54,10 +94,18 @@ public class Group10_30 { return null; org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setExclude(src.getExclude()); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasExclude()) { + tgt.setExclude(src.getExclude()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -66,9 +114,15 @@ public class Group10_30 { return null; org.hl7.fhir.dstu2.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.dstu2.model.Group.GroupMemberComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertReference(src.getEntity())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setInactive(src.getInactive()); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_30.convertReference(src.getEntity())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasInactive()) { + tgt.setInactive(src.getInactive()); + } return tgt; } @@ -77,9 +131,15 @@ public class Group10_30 { return null; org.hl7.fhir.dstu3.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.dstu3.model.Group.GroupMemberComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_30.convertReference(src.getEntity())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setInactive(src.getInactive()); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_30.convertReference(src.getEntity())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasInactive()) { + tgt.setInactive(src.getInactive()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/HealthcareService10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/HealthcareService10_30.java index 3bb198a61..78b6d55f8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/HealthcareService10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/HealthcareService10_30.java @@ -56,29 +56,65 @@ public class HealthcareService10_30 { return null; org.hl7.fhir.dstu2.model.HealthcareService tgt = new org.hl7.fhir.dstu2.model.HealthcareService(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setProvidedBy(VersionConvertor_10_30.convertReference(src.getProvidedBy())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasProvidedBy()) { + tgt.setProvidedBy(VersionConvertor_10_30.convertReference(src.getProvidedBy())); + } for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) { if (!tgt.hasServiceType()) tgt.addServiceType(); tgt.getServiceType().get(0).addSpecialty(VersionConvertor_10_30.convertCodeableConcept(t)); } - for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.setLocation(VersionConvertor_10_30.convertReference(t)); - tgt.setComment(src.getComment()); - tgt.setExtraDetails(src.getExtraDetails()); - tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setEligibility(VersionConvertor_10_30.convertCodeableConcept(src.getEligibility())); - tgt.setEligibilityNote(src.getEligibilityNote()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getProgramName()) tgt.addProgramName(t.getValue()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.setLocation(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasExtraDetails()) { + tgt.setExtraDetails(src.getExtraDetails()); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasEligibility()) { + tgt.setEligibility(VersionConvertor_10_30.convertCodeableConcept(src.getEligibility())); + } + if (src.hasEligibilityNote()) { + tgt.setEligibilityNote(src.getEligibilityNote()); + } + if (src.hasProgramName()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getProgramName()) tgt.addProgramName(t.getValue()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) { + tgt.setAppointmentRequired(src.getAppointmentRequired()); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) { + tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + } return tgt; } @@ -87,27 +123,63 @@ public class HealthcareService10_30 { return null; org.hl7.fhir.dstu3.model.HealthcareService tgt = new org.hl7.fhir.dstu3.model.HealthcareService(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setProvidedBy(VersionConvertor_10_30.convertReference(src.getProvidedBy())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasProvidedBy()) { + tgt.setProvidedBy(VersionConvertor_10_30.convertReference(src.getProvidedBy())); + } for (org.hl7.fhir.dstu2.model.HealthcareService.ServiceTypeComponent t : src.getServiceType()) { for (org.hl7.fhir.dstu2.model.CodeableConcept tj : t.getSpecialty()) tgt.addSpecialty(VersionConvertor_10_30.convertCodeableConcept(tj)); } - tgt.addLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setComment(src.getComment()); - tgt.setExtraDetails(src.getExtraDetails()); - tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setEligibility(VersionConvertor_10_30.convertCodeableConcept(src.getEligibility())); - tgt.setEligibilityNote(src.getEligibilityNote()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getProgramName()) tgt.addProgramName(t.getValue()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + if (src.hasLocation()) { + tgt.addLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasExtraDetails()) { + tgt.setExtraDetails(src.getExtraDetails()); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasEligibility()) { + tgt.setEligibility(VersionConvertor_10_30.convertCodeableConcept(src.getEligibility())); + } + if (src.hasEligibilityNote()) { + tgt.setEligibilityNote(src.getEligibilityNote()); + } + if (src.hasProgramName()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getProgramName()) tgt.addProgramName(t.getValue()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) { + tgt.setAppointmentRequired(src.getAppointmentRequired()); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) { + tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + } return tgt; } @@ -116,10 +188,18 @@ public class HealthcareService10_30 { return null; org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_30.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - tgt.setAllDay(src.getAllDay()); - tgt.setAvailableStartTime(src.getAvailableStartTime()); - tgt.setAvailableEndTime(src.getAvailableEndTime()); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_30.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) { + tgt.setAllDay(src.getAllDay()); + } + if (src.hasAvailableStartTime()) { + tgt.setAvailableStartTime(src.getAvailableStartTime()); + } + if (src.hasAvailableEndTime()) { + tgt.setAvailableEndTime(src.getAvailableEndTime()); + } return tgt; } @@ -128,10 +208,18 @@ public class HealthcareService10_30 { return null; org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_30.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - tgt.setAllDay(src.getAllDay()); - tgt.setAvailableStartTime(src.getAvailableStartTime()); - tgt.setAvailableEndTime(src.getAvailableEndTime()); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_30.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) { + tgt.setAllDay(src.getAllDay()); + } + if (src.hasAvailableStartTime()) { + tgt.setAvailableStartTime(src.getAvailableStartTime()); + } + if (src.hasAvailableEndTime()) { + tgt.setAvailableEndTime(src.getAvailableEndTime()); + } return tgt; } @@ -140,8 +228,12 @@ public class HealthcareService10_30 { return null; org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setDuring(VersionConvertor_10_30.convertPeriod(src.getDuring())); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDuring()) { + tgt.setDuring(VersionConvertor_10_30.convertPeriod(src.getDuring())); + } return tgt; } @@ -150,8 +242,12 @@ public class HealthcareService10_30 { return null; org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setDuring(VersionConvertor_10_30.convertPeriod(src.getDuring())); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDuring()) { + tgt.setDuring(VersionConvertor_10_30.convertPeriod(src.getDuring())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImagingStudy10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImagingStudy10_30.java index ed91cf1db..ec5bd3ab6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImagingStudy10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImagingStudy10_30.java @@ -10,20 +10,48 @@ public class ImagingStudy10_30 { return null; org.hl7.fhir.dstu3.model.ImagingStudy tgt = new org.hl7.fhir.dstu3.model.ImagingStudy(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUid(src.getUid()); - tgt.setAccession(VersionConvertor_10_30.convertIdentifier(src.getAccession())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getModalityList()) tgt.addModalityList(VersionConvertor_10_30.convertCoding(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setStarted(src.getStarted()); - tgt.setReferrer(VersionConvertor_10_30.convertReference(src.getReferrer())); - tgt.addInterpreter(VersionConvertor_10_30.convertReference(src.getInterpreter())); - tgt.setNumberOfSeries(src.getNumberOfSeries()); - tgt.setNumberOfInstances(src.getNumberOfInstances()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getProcedure()) tgt.addProcedureReference(VersionConvertor_10_30.convertReference(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } + if (src.hasAccession()) { + tgt.setAccession(VersionConvertor_10_30.convertIdentifier(src.getAccession())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasAvailability()) { + tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); + } + if (src.hasModalityList()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getModalityList()) tgt.addModalityList(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasStarted()) { + tgt.setStarted(src.getStarted()); + } + if (src.hasReferrer()) { + tgt.setReferrer(VersionConvertor_10_30.convertReference(src.getReferrer())); + } + if (src.hasInterpreter()) { + tgt.addInterpreter(VersionConvertor_10_30.convertReference(src.getInterpreter())); + } + if (src.hasNumberOfSeries()) { + tgt.setNumberOfSeries(src.getNumberOfSeries()); + } + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } + if (src.hasProcedure()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getProcedure()) tgt.addProcedureReference(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSeries()) { + for (org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); + } return tgt; } @@ -32,20 +60,48 @@ public class ImagingStudy10_30 { return null; org.hl7.fhir.dstu2.model.ImagingStudy tgt = new org.hl7.fhir.dstu2.model.ImagingStudy(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUid(src.getUid()); - tgt.setAccession(VersionConvertor_10_30.convertIdentifier(src.getAccession())); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getModalityList()) tgt.addModalityList(VersionConvertor_10_30.convertCoding(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setStarted(src.getStarted()); - tgt.setReferrer(VersionConvertor_10_30.convertReference(src.getReferrer())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getInterpreter()) tgt.setInterpreter(VersionConvertor_10_30.convertReference(t)); - tgt.setNumberOfSeries(src.getNumberOfSeries()); - tgt.setNumberOfInstances(src.getNumberOfInstances()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProcedureReference()) tgt.addProcedure(VersionConvertor_10_30.convertReference(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } + if (src.hasAccession()) { + tgt.setAccession(VersionConvertor_10_30.convertIdentifier(src.getAccession())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasAvailability()) { + tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); + } + if (src.hasModalityList()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getModalityList()) tgt.addModalityList(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasStarted()) { + tgt.setStarted(src.getStarted()); + } + if (src.hasReferrer()) { + tgt.setReferrer(VersionConvertor_10_30.convertReference(src.getReferrer())); + } + if (src.hasInterpreter()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getInterpreter()) tgt.setInterpreter(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasNumberOfSeries()) { + tgt.setNumberOfSeries(src.getNumberOfSeries()); + } + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } + if (src.hasProcedureReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProcedureReference()) tgt.addProcedure(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSeries()) { + for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); + } return tgt; } @@ -54,16 +110,36 @@ public class ImagingStudy10_30 { return null; org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setUid(src.getUid()); - tgt.setNumber(src.getNumber()); - tgt.setModality(VersionConvertor_10_30.convertCoding(src.getModality())); - tgt.setDescription(src.getDescription()); - tgt.setNumberOfInstances(src.getNumberOfInstances()); - tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); - tgt.setBodySite(VersionConvertor_10_30.convertCoding(src.getBodySite())); - tgt.setLaterality(VersionConvertor_10_30.convertCoding(src.getLaterality())); - tgt.setStarted(src.getStarted()); - for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } + if (src.hasModality()) { + tgt.setModality(VersionConvertor_10_30.convertCoding(src.getModality())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } + if (src.hasAvailability()) { + tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); + } + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_30.convertCoding(src.getBodySite())); + } + if (src.hasLaterality()) { + tgt.setLaterality(VersionConvertor_10_30.convertCoding(src.getLaterality())); + } + if (src.hasStarted()) { + tgt.setStarted(src.getStarted()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + } return tgt; } @@ -72,16 +148,36 @@ public class ImagingStudy10_30 { return null; org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setUid(src.getUid()); - tgt.setNumber(src.getNumber()); - tgt.setModality(VersionConvertor_10_30.convertCoding(src.getModality())); - tgt.setDescription(src.getDescription()); - tgt.setNumberOfInstances(src.getNumberOfInstances()); - tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); - tgt.setBodySite(VersionConvertor_10_30.convertCoding(src.getBodySite())); - tgt.setLaterality(VersionConvertor_10_30.convertCoding(src.getLaterality())); - tgt.setStarted(src.getStarted()); - for (org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } + if (src.hasModality()) { + tgt.setModality(VersionConvertor_10_30.convertCoding(src.getModality())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } + if (src.hasAvailability()) { + tgt.setAvailability(convertInstanceAvailability(src.getAvailability())); + } + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_30.convertCoding(src.getBodySite())); + } + if (src.hasLaterality()) { + tgt.setLaterality(VersionConvertor_10_30.convertCoding(src.getLaterality())); + } + if (src.hasStarted()) { + tgt.setStarted(src.getStarted()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + } return tgt; } @@ -90,10 +186,18 @@ public class ImagingStudy10_30 { return null; org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setUid(src.getUid()); - tgt.setNumber(src.getNumber()); - tgt.setSopClass(src.getSopClass()); - tgt.setTitle(src.getTitle()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } + if (src.hasSopClass()) { + tgt.setSopClass(src.getSopClass()); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } return tgt; } @@ -102,10 +206,18 @@ public class ImagingStudy10_30 { return null; org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setUid(src.getUid()); - tgt.setNumber(src.getNumber()); - tgt.setSopClass(src.getSopClass()); - tgt.setTitle(src.getTitle()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } + if (src.hasSopClass()) { + tgt.setSopClass(src.getSopClass()); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Immunization10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Immunization10_30.java index 9b4f90483..77381ff89 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Immunization10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Immunization10_30.java @@ -4,7 +4,6 @@ import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.Immunization.ImmunizationPractitionerComponent; import org.hl7.fhir.exceptions.FHIRException; - import java.util.List; public class Immunization10_30 { @@ -14,28 +13,68 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu2.model.Immunization tgt = new org.hl7.fhir.dstu2.model.Immunization(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(src.getStatus().toCode()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(src.getStatus().toCode()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setWasNotGiven(src.getNotGiven()); - tgt.setReported(!src.getPrimarySource()); - tgt.setPerformer(VersionConvertor_10_30.convertReference(getPerformer(src.getPractitioner()))); - tgt.setRequester(VersionConvertor_10_30.convertReference(getRequester(src.getPractitioner()))); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setLotNumber(src.getLotNumber()); - tgt.setExpirationDate(src.getExpirationDate()); - tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSite())); - tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); - tgt.setDoseQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); - tgt.setExplanation(convertImmunizationExplanationComponent(src.getExplanation())); - for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) tgt.addReaction(convertImmunizationReactionComponent(t)); - for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent t : src.getVaccinationProtocol()) tgt.addVaccinationProtocol(convertImmunizationVaccinationProtocolComponent(t)); + if (src.hasVaccineCode()) { + tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasNotGiven()) { + tgt.setWasNotGiven(src.getNotGiven()); + } + if (src.hasPrimarySource()) { + tgt.setReported(!src.getPrimarySource()); + } + if (src.hasPractitioner()) { + tgt.setPerformer(VersionConvertor_10_30.convertReference(getPerformer(src.getPractitioner()))); + } + if (src.hasPractitioner()) { + tgt.setRequester(VersionConvertor_10_30.convertReference(getRequester(src.getPractitioner()))); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasManufacturer()) { + tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasLotNumber()) { + tgt.setLotNumber(src.getLotNumber()); + } + if (src.hasExpirationDate()) { + tgt.setExpirationDate(src.getExpirationDate()); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); + } + if (src.hasDoseQuantity()) { + tgt.setDoseQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getDoseQuantity())); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); + } + if (src.hasExplanation()) { + tgt.setExplanation(convertImmunizationExplanationComponent(src.getExplanation())); + } + if (src.hasReaction()) { + for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) tgt.addReaction(convertImmunizationReactionComponent(t)); + } + if (src.hasVaccinationProtocol()) { + for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent t : src.getVaccinationProtocol()) tgt.addVaccinationProtocol(convertImmunizationVaccinationProtocolComponent(t)); + } return tgt; } @@ -44,34 +83,70 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu3.model.Immunization tgt = new org.hl7.fhir.dstu3.model.Immunization(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } try { - tgt.setStatus(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.fromCode(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.fromCode(src.getStatus())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setNotGiven(src.getWasNotGiven()); - tgt.setPrimarySource(!src.getReported()); + if (src.hasVaccineCode()) { + tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasWasNotGiven()) { + tgt.setNotGiven(src.getWasNotGiven()); + } + if (src.hasReported()) { + tgt.setPrimarySource(!src.getReported()); + } if (src.hasPerformer()) tgt.addPractitioner().setActor(VersionConvertor_10_30.convertReference(src.getPerformer())).setRole(new org.hl7.fhir.dstu3.model.CodeableConcept().addCoding(new Coding().setSystem("http://hl7.org/fhir/v2/0443").setCode("AP"))); if (src.hasRequester()) tgt.addPractitioner().setActor(VersionConvertor_10_30.convertReference(src.getRequester())).setRole(new org.hl7.fhir.dstu3.model.CodeableConcept().addCoding(new Coding().setSystem("http://hl7.org/fhir/v2/0443").setCode("OP"))); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setLotNumber(src.getLotNumber()); - tgt.setExpirationDate(src.getExpirationDate()); - tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSite())); - tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); - tgt.setDoseQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.dstu2.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); - tgt.setExplanation(convertImmunizationExplanationComponent(src.getExplanation())); - for (org.hl7.fhir.dstu2.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) tgt.addReaction(convertImmunizationReactionComponent(t)); - for (org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent t : src.getVaccinationProtocol()) tgt.addVaccinationProtocol(convertImmunizationVaccinationProtocolComponent(t)); + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasManufacturer()) { + tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasLotNumber()) { + tgt.setLotNumber(src.getLotNumber()); + } + if (src.hasExpirationDate()) { + tgt.setExpirationDate(src.getExpirationDate()); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); + } + if (src.hasDoseQuantity()) { + tgt.setDoseQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getDoseQuantity())); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu2.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); + } + if (src.hasExplanation()) { + tgt.setExplanation(convertImmunizationExplanationComponent(src.getExplanation())); + } + if (src.hasReaction()) { + for (org.hl7.fhir.dstu2.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) tgt.addReaction(convertImmunizationReactionComponent(t)); + } + if (src.hasVaccinationProtocol()) { + for (org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent t : src.getVaccinationProtocol()) tgt.addVaccinationProtocol(convertImmunizationVaccinationProtocolComponent(t)); + } return tgt; } @@ -80,8 +155,12 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu2.model.Immunization.ImmunizationExplanationComponent tgt = new org.hl7.fhir.dstu2.model.Immunization.ImmunizationExplanationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonNotGiven()) tgt.addReasonNotGiven(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReasonNotGiven()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonNotGiven()) tgt.addReasonNotGiven(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -90,8 +169,12 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu3.model.Immunization.ImmunizationExplanationComponent tgt = new org.hl7.fhir.dstu3.model.Immunization.ImmunizationExplanationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonNotGiven()) tgt.addReasonNotGiven(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReasonNotGiven()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonNotGiven()) tgt.addReasonNotGiven(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -102,8 +185,12 @@ public class Immunization10_30 { VersionConvertor_10_30.copyElement(src, tgt); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDetail(VersionConvertor_10_30.convertReference(src.getDetail())); - tgt.setReported(src.getReported()); + if (src.hasDetail()) { + tgt.setDetail(VersionConvertor_10_30.convertReference(src.getDetail())); + } + if (src.hasReported()) { + tgt.setReported(src.getReported()); + } return tgt; } @@ -114,8 +201,12 @@ public class Immunization10_30 { VersionConvertor_10_30.copyElement(src, tgt); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDetail(VersionConvertor_10_30.convertReference(src.getDetail())); - tgt.setReported(src.getReported()); + if (src.hasDetail()) { + tgt.setDetail(VersionConvertor_10_30.convertReference(src.getDetail())); + } + if (src.hasReported()) { + tgt.setReported(src.getReported()); + } return tgt; } @@ -124,14 +215,30 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent tgt = new org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDoseSequence(src.getDoseSequence()); - tgt.setDescription(src.getDescription()); - tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); - tgt.setSeries(src.getSeries()); - tgt.setSeriesDoses(src.getSeriesDoses()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTargetDisease()) tgt.addTargetDisease(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDoseStatus(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatus())); - tgt.setDoseStatusReason(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatusReason())); + if (src.hasDoseSequence()) { + tgt.setDoseSequence(src.getDoseSequence()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAuthority()) { + tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); + } + if (src.hasSeries()) { + tgt.setSeries(src.getSeries()); + } + if (src.hasSeriesDoses()) { + tgt.setSeriesDoses(src.getSeriesDoses()); + } + if (src.hasTargetDisease()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTargetDisease()) tgt.addTargetDisease(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDoseStatus()) { + tgt.setDoseStatus(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatus())); + } + if (src.hasDoseStatusReason()) { + tgt.setDoseStatusReason(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatusReason())); + } return tgt; } @@ -140,14 +247,30 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent tgt = new org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDoseSequence(src.getDoseSequence()); - tgt.setDescription(src.getDescription()); - tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); - tgt.setSeries(src.getSeries()); - tgt.setSeriesDoses(src.getSeriesDoses()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getTargetDisease()) tgt.addTargetDisease(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setDoseStatus(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatus())); - tgt.setDoseStatusReason(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatusReason())); + if (src.hasDoseSequence()) { + tgt.setDoseSequence(src.getDoseSequence()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAuthority()) { + tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); + } + if (src.hasSeries()) { + tgt.setSeries(src.getSeries()); + } + if (src.hasSeriesDoses()) { + tgt.setSeriesDoses(src.getSeriesDoses()); + } + if (src.hasTargetDisease()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getTargetDisease()) tgt.addTargetDisease(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasDoseStatus()) { + tgt.setDoseStatus(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatus())); + } + if (src.hasDoseStatusReason()) { + tgt.setDoseStatusReason(VersionConvertor_10_30.convertCodeableConcept(src.getDoseStatusReason())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImmunizationRecommendation10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImmunizationRecommendation10_30.java index f844a82db..17722ecd7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImmunizationRecommendation10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImmunizationRecommendation10_30.java @@ -10,9 +10,15 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu2.model.ImmunizationRecommendation tgt = new org.hl7.fhir.dstu2.model.ImmunizationRecommendation(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasRecommendation()) { + for (org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + } return tgt; } @@ -21,9 +27,15 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu3.model.ImmunizationRecommendation tgt = new org.hl7.fhir.dstu3.model.ImmunizationRecommendation(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasRecommendation()) { + for (org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + } return tgt; } @@ -34,13 +46,27 @@ public class ImmunizationRecommendation10_30 { VersionConvertor_10_30.copyElement(src, tgt); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); - tgt.setDoseNumber(src.getDoseNumber()); - tgt.setForecastStatus(VersionConvertor_10_30.convertCodeableConcept(src.getForecastStatus())); - for (org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); - tgt.setProtocol(convertImmunizationRecommendationRecommendationProtocolComponent(src.getProtocol())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingImmunization()) tgt.addSupportingImmunization(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingPatientInformation()) tgt.addSupportingPatientInformation(VersionConvertor_10_30.convertReference(t)); + if (src.hasVaccineCode()) { + tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); + } + if (src.hasDoseNumber()) { + tgt.setDoseNumber(src.getDoseNumber()); + } + if (src.hasForecastStatus()) { + tgt.setForecastStatus(VersionConvertor_10_30.convertCodeableConcept(src.getForecastStatus())); + } + if (src.hasDateCriterion()) { + for (org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); + } + if (src.hasProtocol()) { + tgt.setProtocol(convertImmunizationRecommendationRecommendationProtocolComponent(src.getProtocol())); + } + if (src.hasSupportingImmunization()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingImmunization()) tgt.addSupportingImmunization(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasSupportingPatientInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingPatientInformation()) tgt.addSupportingPatientInformation(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -51,13 +77,27 @@ public class ImmunizationRecommendation10_30 { VersionConvertor_10_30.copyElement(src, tgt); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); - tgt.setDoseNumber(src.getDoseNumber()); - tgt.setForecastStatus(VersionConvertor_10_30.convertCodeableConcept(src.getForecastStatus())); - for (org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); - tgt.setProtocol(convertImmunizationRecommendationRecommendationProtocolComponent(src.getProtocol())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingImmunization()) tgt.addSupportingImmunization(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingPatientInformation()) tgt.addSupportingPatientInformation(VersionConvertor_10_30.convertReference(t)); + if (src.hasVaccineCode()) { + tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); + } + if (src.hasDoseNumber()) { + tgt.setDoseNumber(src.getDoseNumber()); + } + if (src.hasForecastStatus()) { + tgt.setForecastStatus(VersionConvertor_10_30.convertCodeableConcept(src.getForecastStatus())); + } + if (src.hasDateCriterion()) { + for (org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); + } + if (src.hasProtocol()) { + tgt.setProtocol(convertImmunizationRecommendationRecommendationProtocolComponent(src.getProtocol())); + } + if (src.hasSupportingImmunization()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingImmunization()) tgt.addSupportingImmunization(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasSupportingPatientInformation()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingPatientInformation()) tgt.addSupportingPatientInformation(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -66,8 +106,12 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setValue(src.getValue()); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -76,8 +120,12 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setValue(src.getValue()); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -86,10 +134,18 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent tgt = new org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDoseSequence(src.getDoseSequence()); - tgt.setDescription(src.getDescription()); - tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); - tgt.setSeries(src.getSeries()); + if (src.hasDoseSequence()) { + tgt.setDoseSequence(src.getDoseSequence()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAuthority()) { + tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); + } + if (src.hasSeries()) { + tgt.setSeries(src.getSeries()); + } return tgt; } @@ -98,10 +154,18 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent tgt = new org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setDoseSequence(src.getDoseSequence()); - tgt.setDescription(src.getDescription()); - tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); - tgt.setSeries(src.getSeries()); + if (src.hasDoseSequence()) { + tgt.setDoseSequence(src.getDoseSequence()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAuthority()) { + tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); + } + if (src.hasSeries()) { + tgt.setSeries(src.getSeries()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImplementationGuide10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImplementationGuide10_30.java index 5b3ff7d06..df04a482b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImplementationGuide10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ImplementationGuide10_30.java @@ -86,28 +86,56 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgt.setCopyright(src.getCopyright()); - tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - for (org.hl7.fhir.dstu2.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); - tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasDependency()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasBinary()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); + } + if (src.hasPage()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + } return tgt; } @@ -116,27 +144,57 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setCopyright(src.getCopyright()); - tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); - tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasDependency()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasBinary()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); + } + if (src.hasPage()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + } return tgt; } @@ -145,8 +203,12 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -155,8 +217,12 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -165,8 +231,12 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertGuideDependencyType(src.getType())); - tgt.setUri(src.getUri()); + if (src.hasType()) { + tgt.setType(convertGuideDependencyType(src.getType())); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -175,8 +245,12 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertGuideDependencyType(src.getType())); - tgt.setUri(src.getUri()); + if (src.hasType()) { + tgt.setType(convertGuideDependencyType(src.getType())); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -185,8 +259,12 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + } return tgt; } @@ -195,8 +273,12 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + } return tgt; } @@ -205,9 +287,15 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + } return tgt; } @@ -216,9 +304,15 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + } return tgt; } @@ -227,12 +321,24 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setExample(src.getPurpose() == org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setAcronym(src.getAcronym()); - tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); - tgt.setExampleFor(VersionConvertor_10_30.convertReference(src.getExampleFor())); + if (src.hasPurpose()) { + tgt.setExample(src.getPurpose() == org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAcronym()) { + tgt.setAcronym(src.getAcronym()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); + } + if (src.hasExampleFor()) { + tgt.setExampleFor(VersionConvertor_10_30.convertReference(src.getExampleFor())); + } return tgt; } @@ -245,11 +351,21 @@ public class ImplementationGuide10_30 { tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE); else tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.PROFILE); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setAcronym(src.getAcronym()); - tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); - tgt.setExampleFor(VersionConvertor_10_30.convertReference(src.getExampleFor())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAcronym()) { + tgt.setAcronym(src.getAcronym()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); + } + if (src.hasExampleFor()) { + tgt.setExampleFor(VersionConvertor_10_30.convertReference(src.getExampleFor())); + } return tgt; } @@ -258,13 +374,27 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSource(src.getSource()); - tgt.setName(src.getTitle()); - tgt.setKind(convertGuidePageKind(src.getKind())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getType()) tgt.addType(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); - tgt.setFormat(src.getFormat()); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasSource()) { + tgt.setSource(src.getSource()); + } + if (src.hasTitle()) { + tgt.setName(src.getTitle()); + } + if (src.hasKind()) { + tgt.setKind(convertGuidePageKind(src.getKind())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getType()) tgt.addType(t.getValue()); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); + } + if (src.hasFormat()) { + tgt.setFormat(src.getFormat()); + } + if (src.hasPage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -273,13 +403,27 @@ public class ImplementationGuide10_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSource(src.getSource()); - tgt.setTitle(src.getName()); - tgt.setKind(convertGuidePageKind(src.getKind())); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addType(t.getValue()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); - tgt.setFormat(src.getFormat()); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasSource()) { + tgt.setSource(src.getSource()); + } + if (src.hasName()) { + tgt.setTitle(src.getName()); + } + if (src.hasKind()) { + tgt.setKind(convertGuidePageKind(src.getKind())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addType(t.getValue()); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); + } + if (src.hasFormat()) { + tgt.setFormat(src.getFormat()); + } + if (src.hasPage()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/List10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/List10_30.java index c02a47f8c..5e315b227 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/List10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/List10_30.java @@ -10,19 +10,41 @@ public class List10_30 { return null; org.hl7.fhir.dstu2.model.List_ tgt = new org.hl7.fhir.dstu2.model.List_(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasStatus()) { + tgt.setStatus(convertListStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); - tgt.setMode(convertListMode(src.getMode())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasMode()) { + tgt.setMode(convertListMode(src.getMode())); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + } return tgt; } @@ -31,20 +53,40 @@ public class List10_30 { return null; org.hl7.fhir.dstu3.model.ListResource tgt = new org.hl7.fhir.dstu3.model.ListResource(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasStatus()) { + tgt.setStatus(convertListStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); - tgt.setMode(convertListMode(src.getMode())); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasMode()) { + tgt.setMode(convertListMode(src.getMode())); + } if (src.hasNote()) tgt.addNote(new org.hl7.fhir.dstu3.model.Annotation().setText(src.getNote())); - for (org.hl7.fhir.dstu2.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + } return tgt; } @@ -53,11 +95,17 @@ public class List10_30 { return null; org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent tgt = new org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent(); copyBackboneElement(src, tgt); - tgt.setFlag(VersionConvertor_10_30.convertCodeableConcept(src.getFlag())); - tgt.setDeleted(src.getDeleted()); + if (src.hasFlag()) { + tgt.setFlag(VersionConvertor_10_30.convertCodeableConcept(src.getFlag())); + } + if (src.hasDeleted()) { + tgt.setDeleted(src.getDeleted()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setItem(VersionConvertor_10_30.convertReference(src.getItem())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_30.convertReference(src.getItem())); + } return tgt; } @@ -66,11 +114,17 @@ public class List10_30 { return null; org.hl7.fhir.dstu2.model.List_.ListEntryComponent tgt = new org.hl7.fhir.dstu2.model.List_.ListEntryComponent(); copyBackboneElement(src, tgt); - tgt.setFlag(VersionConvertor_10_30.convertCodeableConcept(src.getFlag())); - tgt.setDeleted(src.getDeleted()); + if (src.hasFlag()) { + tgt.setFlag(VersionConvertor_10_30.convertCodeableConcept(src.getFlag())); + } + if (src.hasDeleted()) { + tgt.setDeleted(src.getDeleted()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setItem(VersionConvertor_10_30.convertReference(src.getItem())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_30.convertReference(src.getItem())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Location10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Location10_30.java index 7f96bdff5..a57ec696d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Location10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Location10_30.java @@ -10,18 +10,42 @@ public class Location10_30 { return null; org.hl7.fhir.dstu2.model.Location tgt = new org.hl7.fhir.dstu2.model.Location(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertLocationStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setMode(convertLocationMode(src.getMode())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); - tgt.setPhysicalType(VersionConvertor_10_30.convertCodeableConcept(src.getPhysicalType())); - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertLocationStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasMode()) { + tgt.setMode(convertLocationMode(src.getMode())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + } + if (src.hasPhysicalType()) { + tgt.setPhysicalType(VersionConvertor_10_30.convertCodeableConcept(src.getPhysicalType())); + } + if (src.hasPosition()) { + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + } return tgt; } @@ -30,18 +54,42 @@ public class Location10_30 { return null; org.hl7.fhir.dstu3.model.Location tgt = new org.hl7.fhir.dstu3.model.Location(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertLocationStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setMode(convertLocationMode(src.getMode())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); - tgt.setPhysicalType(VersionConvertor_10_30.convertCodeableConcept(src.getPhysicalType())); - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertLocationStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasMode()) { + tgt.setMode(convertLocationMode(src.getMode())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + } + if (src.hasPhysicalType()) { + tgt.setPhysicalType(VersionConvertor_10_30.convertCodeableConcept(src.getPhysicalType())); + } + if (src.hasPosition()) { + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + } return tgt; } @@ -76,9 +124,15 @@ public class Location10_30 { return null; org.hl7.fhir.dstu3.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.dstu3.model.Location.LocationPositionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLongitude(src.getLongitude()); - tgt.setLatitude(src.getLatitude()); - tgt.setAltitude(src.getAltitude()); + if (src.hasLongitude()) { + tgt.setLongitude(src.getLongitude()); + } + if (src.hasLatitude()) { + tgt.setLatitude(src.getLatitude()); + } + if (src.hasAltitude()) { + tgt.setAltitude(src.getAltitude()); + } return tgt; } @@ -87,9 +141,15 @@ public class Location10_30 { return null; org.hl7.fhir.dstu2.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.dstu2.model.Location.LocationPositionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLongitude(src.getLongitude()); - tgt.setLatitude(src.getLatitude()); - tgt.setAltitude(src.getAltitude()); + if (src.hasLongitude()) { + tgt.setLongitude(src.getLongitude()); + } + if (src.hasLatitude()) { + tgt.setLatitude(src.getLatitude()); + } + if (src.hasAltitude()) { + tgt.setAltitude(src.getAltitude()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Media10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Media10_30.java index b169fe043..901a5d741 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Media10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Media10_30.java @@ -40,18 +40,42 @@ public class Media10_30 { return null; org.hl7.fhir.dstu2.model.Media tgt = new org.hl7.fhir.dstu2.model.Media(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setType(convertDigitalMediaType(src.getType())); - tgt.setSubtype(VersionConvertor_10_30.convertCodeableConcept(src.getSubtype())); - tgt.setView(VersionConvertor_10_30.convertCodeableConcept(src.getView())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setOperator(VersionConvertor_10_30.convertReference(src.getOperator())); - tgt.setDeviceName(src.getDevice().getDisplay()); - tgt.setHeight(src.getHeight()); - tgt.setWidth(src.getWidth()); - tgt.setFrames(src.getFrames()); - tgt.setDuration(src.getDuration()); - tgt.setContent(VersionConvertor_10_30.convertAttachment(src.getContent())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertDigitalMediaType(src.getType())); + } + if (src.hasSubtype()) { + tgt.setSubtype(VersionConvertor_10_30.convertCodeableConcept(src.getSubtype())); + } + if (src.hasView()) { + tgt.setView(VersionConvertor_10_30.convertCodeableConcept(src.getView())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasOperator()) { + tgt.setOperator(VersionConvertor_10_30.convertReference(src.getOperator())); + } + if (src.hasDevice()) { + tgt.setDeviceName(src.getDevice().getDisplay()); + } + if (src.hasHeight()) { + tgt.setHeight(src.getHeight()); + } + if (src.hasWidth()) { + tgt.setWidth(src.getWidth()); + } + if (src.hasFrames()) { + tgt.setFrames(src.getFrames()); + } + if (src.hasDuration()) { + tgt.setDuration(src.getDuration()); + } + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertAttachment(src.getContent())); + } return tgt; } @@ -60,18 +84,42 @@ public class Media10_30 { return null; org.hl7.fhir.dstu3.model.Media tgt = new org.hl7.fhir.dstu3.model.Media(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setType(convertDigitalMediaType(src.getType())); - tgt.setSubtype(VersionConvertor_10_30.convertCodeableConcept(src.getSubtype())); - tgt.setView(VersionConvertor_10_30.convertCodeableConcept(src.getView())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setOperator(VersionConvertor_10_30.convertReference(src.getOperator())); - tgt.getDevice().setDisplay(src.getDeviceName()); - tgt.setHeight(src.getHeight()); - tgt.setWidth(src.getWidth()); - tgt.setFrames(src.getFrames()); - tgt.setDuration(src.getDuration()); - tgt.setContent(VersionConvertor_10_30.convertAttachment(src.getContent())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertDigitalMediaType(src.getType())); + } + if (src.hasSubtype()) { + tgt.setSubtype(VersionConvertor_10_30.convertCodeableConcept(src.getSubtype())); + } + if (src.hasView()) { + tgt.setView(VersionConvertor_10_30.convertCodeableConcept(src.getView())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasOperator()) { + tgt.setOperator(VersionConvertor_10_30.convertReference(src.getOperator())); + } + if (src.hasDeviceName()) { + tgt.getDevice().setDisplay(src.getDeviceName()); + } + if (src.hasHeight()) { + tgt.setHeight(src.getHeight()); + } + if (src.hasWidth()) { + tgt.setWidth(src.getWidth()); + } + if (src.hasFrames()) { + tgt.setFrames(src.getFrames()); + } + if (src.hasDuration()) { + tgt.setDuration(src.getDuration()); + } + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_30.convertAttachment(src.getContent())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Medication10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Medication10_30.java index 76d954284..f5a89b295 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Medication10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Medication10_30.java @@ -10,10 +10,18 @@ public class Medication10_30 { return null; org.hl7.fhir.dstu2.model.Medication tgt = new org.hl7.fhir.dstu2.model.Medication(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setIsBrand(src.getIsBrand()); - tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); - tgt.setPackage(convertMedicationPackageComponent(src.getPackage())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasIsBrand()) { + tgt.setIsBrand(src.getIsBrand()); + } + if (src.hasManufacturer()) { + tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); + } + if (src.hasPackage()) { + tgt.setPackage(convertMedicationPackageComponent(src.getPackage())); + } return tgt; } @@ -22,10 +30,18 @@ public class Medication10_30 { return null; org.hl7.fhir.dstu3.model.Medication tgt = new org.hl7.fhir.dstu3.model.Medication(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setIsBrand(src.getIsBrand()); - tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); - tgt.setPackage(convertMedicationPackageComponent(src.getPackage())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasIsBrand()) { + tgt.setIsBrand(src.getIsBrand()); + } + if (src.hasManufacturer()) { + tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); + } + if (src.hasPackage()) { + tgt.setPackage(convertMedicationPackageComponent(src.getPackage())); + } return tgt; } @@ -34,8 +50,12 @@ public class Medication10_30 { return null; org.hl7.fhir.dstu2.model.Medication.MedicationPackageComponent tgt = new org.hl7.fhir.dstu2.model.Medication.MedicationPackageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContainer(VersionConvertor_10_30.convertCodeableConcept(src.getContainer())); - for (org.hl7.fhir.dstu3.model.Medication.MedicationPackageContentComponent t : src.getContent()) tgt.addContent(convertMedicationPackageContentComponent(t)); + if (src.hasContainer()) { + tgt.setContainer(VersionConvertor_10_30.convertCodeableConcept(src.getContainer())); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu3.model.Medication.MedicationPackageContentComponent t : src.getContent()) tgt.addContent(convertMedicationPackageContentComponent(t)); + } return tgt; } @@ -44,8 +64,12 @@ public class Medication10_30 { return null; org.hl7.fhir.dstu3.model.Medication.MedicationPackageComponent tgt = new org.hl7.fhir.dstu3.model.Medication.MedicationPackageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setContainer(VersionConvertor_10_30.convertCodeableConcept(src.getContainer())); - for (org.hl7.fhir.dstu2.model.Medication.MedicationPackageContentComponent t : src.getContent()) tgt.addContent(convertMedicationPackageContentComponent(t)); + if (src.hasContainer()) { + tgt.setContainer(VersionConvertor_10_30.convertCodeableConcept(src.getContainer())); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu2.model.Medication.MedicationPackageContentComponent t : src.getContent()) tgt.addContent(convertMedicationPackageContentComponent(t)); + } return tgt; } @@ -56,7 +80,9 @@ public class Medication10_30 { VersionConvertor_10_30.copyElement(src, tgt); if (src.hasItemReference()) tgt.setItem((org.hl7.fhir.dstu2.model.Reference) VersionConvertor_10_30.convertType(src.getItem())); - tgt.setAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getAmount())); + if (src.hasAmount()) { + tgt.setAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getAmount())); + } return tgt; } @@ -65,8 +91,12 @@ public class Medication10_30 { return null; org.hl7.fhir.dstu3.model.Medication.MedicationPackageContentComponent tgt = new org.hl7.fhir.dstu3.model.Medication.MedicationPackageContentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setItem(VersionConvertor_10_30.convertType(src.getItem())); - tgt.setAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getAmount())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_30.convertType(src.getItem())); + } + if (src.hasAmount()) { + tgt.setAmount(VersionConvertor_10_30.convertSimpleQuantity(src.getAmount())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationDispense10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationDispense10_30.java index bd53b34e9..ab2cda095 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationDispense10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationDispense10_30.java @@ -11,22 +11,50 @@ public class MedicationDispense10_30 { return null; org.hl7.fhir.dstu3.model.MedicationDispense tgt = new org.hl7.fhir.dstu3.model.MedicationDispense(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_30.convertReference(t)); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setDaysSupply(VersionConvertor_10_30.convertSimpleQuantity(src.getDaysSupply())); - tgt.setWhenPrepared(src.getWhenPrepared()); - tgt.setWhenHandedOver(src.getWhenHandedOver()); - tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDaysSupply()) { + tgt.setDaysSupply(VersionConvertor_10_30.convertSimpleQuantity(src.getDaysSupply())); + } + if (src.hasWhenPrepared()) { + tgt.setWhenPrepared(src.getWhenPrepared()); + } + if (src.hasWhenHandedOver()) { + tgt.setWhenHandedOver(src.getWhenHandedOver()); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); + } if (src.hasNote()) tgt.addNote().setText(src.getNote()); - for (org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); + } + if (src.hasSubstitution()) { + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + } return tgt; } @@ -35,21 +63,51 @@ public class MedicationDispense10_30 { return null; org.hl7.fhir.dstu2.model.MedicationDispense tgt = new org.hl7.fhir.dstu2.model.MedicationDispense(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_30.convertReference(t)); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); - tgt.setDaysSupply(VersionConvertor_10_30.convertSimpleQuantity(src.getDaysSupply())); - tgt.setWhenPrepared(src.getWhenPrepared()); - tgt.setWhenHandedOver(src.getWhenHandedOver()); - tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDaysSupply()) { + tgt.setDaysSupply(VersionConvertor_10_30.convertSimpleQuantity(src.getDaysSupply())); + } + if (src.hasWhenPrepared()) { + tgt.setWhenPrepared(src.getWhenPrepared()); + } + if (src.hasWhenHandedOver()) { + tgt.setWhenHandedOver(src.getWhenHandedOver()); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); + } + if (src.hasSubstitution()) { + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + } return tgt; } @@ -58,16 +116,32 @@ public class MedicationDispense10_30 { return null; org.hl7.fhir.dstu3.model.Dosage tgt = new org.hl7.fhir.dstu3.model.Dosage(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + } if (src.hasSiteCodeableConcept()) tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSiteCodeableConcept())); - tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - tgt.setDose(VersionConvertor_10_30.convertType(src.getDose())); - tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasDose()) { + tgt.setDose(VersionConvertor_10_30.convertType(src.getDose())); + } + if (src.hasRate()) { + tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); + } + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } @@ -76,15 +150,33 @@ public class MedicationDispense10_30 { return null; org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent tgt = new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); - tgt.setSite(VersionConvertor_10_30.convertType(src.getSite())); - tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - tgt.setDose(VersionConvertor_10_30.convertType(src.getDose())); - tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_30.convertType(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasDose()) { + tgt.setDose(VersionConvertor_10_30.convertType(src.getDose())); + } + if (src.hasRate()) { + tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); + } + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } @@ -131,9 +223,15 @@ public class MedicationDispense10_30 { return null; org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_30.convertReference(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -142,9 +240,15 @@ public class MedicationDispense10_30 { return null; org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_30.convertReference(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_30.convertReference(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationStatement10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationStatement10_30.java index 6c46dc671..8776ed443 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationStatement10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MedicationStatement10_30.java @@ -10,19 +10,37 @@ public class MedicationStatement10_30 { return null; org.hl7.fhir.dstu3.model.MedicationStatement tgt = new org.hl7.fhir.dstu3.model.MedicationStatement(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); - tgt.setInformationSource(VersionConvertor_10_30.convertReference(src.getInformationSource())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addDerivedFrom(VersionConvertor_10_30.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); + } + if (src.hasInformationSource()) { + tgt.setInformationSource(VersionConvertor_10_30.convertReference(src.getInformationSource())); + } + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addDerivedFrom(VersionConvertor_10_30.convertReference(t)); + } if (src.hasDateAsserted()) tgt.setDateAsserted(src.getDateAsserted()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonNotTaken()) tgt.addReasonNotTaken(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasReasonNotTaken()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonNotTaken()) tgt.addReasonNotTaken(VersionConvertor_10_30.convertCodeableConcept(t)); + } if (src.hasNote()) tgt.addNote().setText(src.getNote()); - for (org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + if (src.hasDosage()) { + for (org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + } return tgt; } @@ -31,18 +49,38 @@ public class MedicationStatement10_30 { return null; org.hl7.fhir.dstu2.model.MedicationStatement tgt = new org.hl7.fhir.dstu2.model.MedicationStatement(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); - tgt.setInformationSource(VersionConvertor_10_30.convertReference(src.getInformationSource())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDerivedFrom()) tgt.addSupportingInformation(VersionConvertor_10_30.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_30.convertType(src.getMedication())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); + } + if (src.hasInformationSource()) { + tgt.setInformationSource(VersionConvertor_10_30.convertReference(src.getInformationSource())); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDerivedFrom()) tgt.addSupportingInformation(VersionConvertor_10_30.convertReference(t)); + } if (src.hasDateAsserted()) tgt.setDateAsserted(src.getDateAsserted()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonNotTaken()) tgt.addReasonNotTaken(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + if (src.hasReasonNotTaken()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonNotTaken()) tgt.addReasonNotTaken(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasDosage()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + } return tgt; } @@ -51,15 +89,29 @@ public class MedicationStatement10_30 { return null; org.hl7.fhir.dstu3.model.Dosage tgt = new org.hl7.fhir.dstu3.model.Dosage(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + } if (src.hasSiteCodeableConcept()) tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSiteCodeableConcept())); - tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasRate()) { + tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); + } + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } @@ -68,14 +120,30 @@ public class MedicationStatement10_30 { return null; org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent tgt = new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); - tgt.setSite(VersionConvertor_10_30.convertType(src.getSite())); - tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_30.convertType(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_30.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasRate()) { + tgt.setRate(VersionConvertor_10_30.convertType(src.getRate())); + } + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_30.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MessageHeader10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MessageHeader10_30.java index ef842d48f..77ee37f57 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MessageHeader10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/MessageHeader10_30.java @@ -10,9 +10,15 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -21,9 +27,15 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -32,17 +44,39 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu2.model.MessageHeader tgt = new org.hl7.fhir.dstu2.model.MessageHeader(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setTimestamp(src.getTimestamp()); - tgt.setEvent(VersionConvertor_10_30.convertCoding(src.getEvent())); - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - tgt.setSource(convertMessageSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); - tgt.setEnterer(VersionConvertor_10_30.convertReference(src.getEnterer())); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setReceiver(VersionConvertor_10_30.convertReference(src.getReceiver())); - tgt.setResponsible(VersionConvertor_10_30.convertReference(src.getResponsible())); - tgt.setReason(VersionConvertor_10_30.convertCodeableConcept(src.getReason())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getFocus()) tgt.addData(VersionConvertor_10_30.convertReference(t)); + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasEvent()) { + tgt.setEvent(VersionConvertor_10_30.convertCoding(src.getEvent())); + } + if (src.hasResponse()) { + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + } + if (src.hasSource()) { + tgt.setSource(convertMessageSourceComponent(src.getSource())); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasEnterer()) { + tgt.setEnterer(VersionConvertor_10_30.convertReference(src.getEnterer())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasReceiver()) { + tgt.setReceiver(VersionConvertor_10_30.convertReference(src.getReceiver())); + } + if (src.hasResponsible()) { + tgt.setResponsible(VersionConvertor_10_30.convertReference(src.getResponsible())); + } + if (src.hasReason()) { + tgt.setReason(VersionConvertor_10_30.convertCodeableConcept(src.getReason())); + } + if (src.hasFocus()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getFocus()) tgt.addData(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -51,17 +85,39 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu3.model.MessageHeader tgt = new org.hl7.fhir.dstu3.model.MessageHeader(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setTimestamp(src.getTimestamp()); - tgt.setEvent(VersionConvertor_10_30.convertCoding(src.getEvent())); - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - tgt.setSource(convertMessageSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); - tgt.setEnterer(VersionConvertor_10_30.convertReference(src.getEnterer())); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setReceiver(VersionConvertor_10_30.convertReference(src.getReceiver())); - tgt.setResponsible(VersionConvertor_10_30.convertReference(src.getResponsible())); - tgt.setReason(VersionConvertor_10_30.convertCodeableConcept(src.getReason())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getData()) tgt.addFocus(VersionConvertor_10_30.convertReference(t)); + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasEvent()) { + tgt.setEvent(VersionConvertor_10_30.convertCoding(src.getEvent())); + } + if (src.hasResponse()) { + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + } + if (src.hasSource()) { + tgt.setSource(convertMessageSourceComponent(src.getSource())); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasEnterer()) { + tgt.setEnterer(VersionConvertor_10_30.convertReference(src.getEnterer())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasReceiver()) { + tgt.setReceiver(VersionConvertor_10_30.convertReference(src.getReceiver())); + } + if (src.hasResponsible()) { + tgt.setResponsible(VersionConvertor_10_30.convertReference(src.getResponsible())); + } + if (src.hasReason()) { + tgt.setReason(VersionConvertor_10_30.convertCodeableConcept(src.getReason())); + } + if (src.hasData()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getData()) tgt.addFocus(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -70,9 +126,15 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setCode(convertResponseType(src.getCode())); - tgt.setDetails(VersionConvertor_10_30.convertReference(src.getDetails())); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasCode()) { + tgt.setCode(convertResponseType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_30.convertReference(src.getDetails())); + } return tgt; } @@ -81,9 +143,15 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu3.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.dstu3.model.MessageHeader.MessageHeaderResponseComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setCode(convertResponseType(src.getCode())); - tgt.setDetails(VersionConvertor_10_30.convertReference(src.getDetails())); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasCode()) { + tgt.setCode(convertResponseType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_30.convertReference(src.getDetails())); + } return tgt; } @@ -92,11 +160,21 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu3.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.dstu3.model.MessageHeader.MessageSourceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setSoftware(src.getSoftware()); - tgt.setVersion(src.getVersion()); - tgt.setContact(VersionConvertor_10_30.convertContactPoint(src.getContact())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSoftware()) { + tgt.setSoftware(src.getSoftware()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasContact()) { + tgt.setContact(VersionConvertor_10_30.convertContactPoint(src.getContact())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -105,11 +183,21 @@ public class MessageHeader10_30 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setSoftware(src.getSoftware()); - tgt.setVersion(src.getVersion()); - tgt.setContact(VersionConvertor_10_30.convertContactPoint(src.getContact())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSoftware()) { + tgt.setSoftware(src.getSoftware()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasContact()) { + tgt.setContact(VersionConvertor_10_30.convertContactPoint(src.getContact())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/NamingSystem10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/NamingSystem10_30.java index c54171bf0..ec8191ac3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/NamingSystem10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/NamingSystem10_30.java @@ -10,23 +10,45 @@ public class NamingSystem10_30 { return null; org.hl7.fhir.dstu3.model.NamingSystem tgt = new org.hl7.fhir.dstu3.model.NamingSystem(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); - tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } + if (src.hasResponsible()) { + tgt.setResponsible(src.getResponsible()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); - tgt.setReplacedBy(VersionConvertor_10_30.convertReference(src.getReplacedBy())); + if (src.hasUsage()) { + tgt.setUsage(src.getUsage()); + } + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } + if (src.hasReplacedBy()) { + tgt.setReplacedBy(VersionConvertor_10_30.convertReference(src.getReplacedBy())); + } return tgt; } @@ -35,22 +57,46 @@ public class NamingSystem10_30 { return null; org.hl7.fhir.dstu2.model.NamingSystem tgt = new org.hl7.fhir.dstu2.model.NamingSystem(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); - tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } + if (src.hasResponsible()) { + tgt.setResponsible(src.getResponsible()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); - tgt.setReplacedBy(VersionConvertor_10_30.convertReference(src.getReplacedBy())); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasUsage()) { + tgt.setUsage(src.getUsage()); + } + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } + if (src.hasReplacedBy()) { + tgt.setReplacedBy(VersionConvertor_10_30.convertReference(src.getReplacedBy())); + } return tgt; } @@ -59,8 +105,12 @@ public class NamingSystem10_30 { return null; org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent tgt = new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -69,8 +119,12 @@ public class NamingSystem10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -143,10 +197,18 @@ public class NamingSystem10_30 { return null; org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); - tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -155,10 +217,18 @@ public class NamingSystem10_30 { return null; org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); - tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Observation10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Observation10_30.java index f39c8f4b1..de472505e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Observation10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Observation10_30.java @@ -10,26 +10,66 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu3.model.Observation tgt = new org.hl7.fhir.dstu3.model.Observation(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertObservationStatus(src.getStatus())); - tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); - tgt.setInterpretation(VersionConvertor_10_30.convertCodeableConcept(src.getInterpretation())); - tgt.setComment(src.getComments()); - tgt.setBodySite(VersionConvertor_10_30.convertCodeableConcept(src.getBodySite())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - tgt.setSpecimen(VersionConvertor_10_30.convertReference(src.getSpecimen())); - tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent t : src.getRelated()) tgt.addRelated(convertObservationRelatedComponent(t)); - for (org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertObservationStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasInterpretation()) { + tgt.setInterpretation(VersionConvertor_10_30.convertCodeableConcept(src.getInterpretation())); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_30.convertCodeableConcept(src.getBodySite())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasSpecimen()) { + tgt.setSpecimen(VersionConvertor_10_30.convertReference(src.getSpecimen())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent t : src.getRelated()) tgt.addRelated(convertObservationRelatedComponent(t)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -38,26 +78,66 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu2.model.Observation tgt = new org.hl7.fhir.dstu2.model.Observation(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept c : src.getCategory()) tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(c)); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); - tgt.setInterpretation(VersionConvertor_10_30.convertCodeableConcept(src.getInterpretation())); - tgt.setComments(src.getComment()); - tgt.setBodySite(VersionConvertor_10_30.convertCodeableConcept(src.getBodySite())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - tgt.setSpecimen(VersionConvertor_10_30.convertReference(src.getSpecimen())); - tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent t : src.getRelated()) tgt.addRelated(convertObservationRelatedComponent(t)); - for (org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertObservationStatus(src.getStatus())); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept c : src.getCategory()) tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(c)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasInterpretation()) { + tgt.setInterpretation(VersionConvertor_10_30.convertCodeableConcept(src.getInterpretation())); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_30.convertCodeableConcept(src.getBodySite())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasSpecimen()) { + tgt.setSpecimen(VersionConvertor_10_30.convertReference(src.getSpecimen())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_30.convertReference(src.getDevice())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent t : src.getRelated()) tgt.addRelated(convertObservationRelatedComponent(t)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -66,10 +146,18 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -78,10 +166,18 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_30.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -90,11 +186,21 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLow(VersionConvertor_10_30.convertSimpleQuantity(src.getLow())); - tgt.setHigh(VersionConvertor_10_30.convertSimpleQuantity(src.getHigh())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getMeaning())); - tgt.setAge(VersionConvertor_10_30.convertRange(src.getAge())); - tgt.setText(src.getText()); + if (src.hasLow()) { + tgt.setLow(VersionConvertor_10_30.convertSimpleQuantity(src.getLow())); + } + if (src.hasHigh()) { + tgt.setHigh(VersionConvertor_10_30.convertSimpleQuantity(src.getHigh())); + } + if (src.hasMeaning()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getMeaning())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_30.convertRange(src.getAge())); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } return tgt; } @@ -103,11 +209,21 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLow(VersionConvertor_10_30.convertSimpleQuantity(src.getLow())); - tgt.setHigh(VersionConvertor_10_30.convertSimpleQuantity(src.getHigh())); - tgt.setMeaning(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setAge(VersionConvertor_10_30.convertRange(src.getAge())); - tgt.setText(src.getText()); + if (src.hasLow()) { + tgt.setLow(VersionConvertor_10_30.convertSimpleQuantity(src.getLow())); + } + if (src.hasHigh()) { + tgt.setHigh(VersionConvertor_10_30.convertSimpleQuantity(src.getHigh())); + } + if (src.hasType()) { + tgt.setMeaning(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_30.convertRange(src.getAge())); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } return tgt; } @@ -116,8 +232,12 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent tgt = new org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertObservationRelationshipType(src.getType())); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + if (src.hasType()) { + tgt.setType(convertObservationRelationshipType(src.getType())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } return tgt; } @@ -126,8 +246,12 @@ public class Observation10_30 { return null; org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent tgt = new org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertObservationRelationshipType(src.getType())); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + if (src.hasType()) { + tgt.setType(convertObservationRelationshipType(src.getType())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationDefinition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationDefinition10_30.java index 2b821f33a..a7c62eabe 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationDefinition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationDefinition10_30.java @@ -12,29 +12,61 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu2.model.OperationDefinition tgt = new org.hl7.fhir.dstu2.model.OperationDefinition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setRequirements(src.getPurpose()); - tgt.setIdempotent(src.getIdempotent()); - tgt.setCode(src.getCode()); - tgt.setNotes(src.getComment()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasIdempotent()) { + tgt.setIdempotent(src.getIdempotent()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasComment()) { + tgt.setNotes(src.getComment()); + } if (src.hasBase()) tgt.setBase(VersionConvertor_10_30.convertReference(src.getBase())); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.getType()) - for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); + } + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -43,29 +75,61 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu3.model.OperationDefinition tgt = new org.hl7.fhir.dstu3.model.OperationDefinition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setPurpose(src.getRequirements()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } if (src.hasIdempotent()) tgt.setIdempotent(src.getIdempotent()); - tgt.setCode(src.getCode()); - tgt.setComment(src.getNotes()); - tgt.setBase(VersionConvertor_10_30.convertReference(src.getBase())); - tgt.setSystem(src.getSystem()); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasNotes()) { + tgt.setComment(src.getNotes()); + } + if (src.hasBase()) { + tgt.setBase(VersionConvertor_10_30.convertReference(src.getBase())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + } tgt.setType(tgt.hasResource()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -74,8 +138,12 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent tgt = new org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -84,8 +152,12 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -94,8 +166,12 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setStrength(VersionConvertor_10_30.convertBindingStrength(src.getStrength())); - tgt.setValueSet(VersionConvertor_10_30.convertType(src.getValueSet())); + if (src.hasStrength()) { + tgt.setStrength(VersionConvertor_10_30.convertBindingStrength(src.getStrength())); + } + if (src.hasValueSet()) { + tgt.setValueSet(VersionConvertor_10_30.convertType(src.getValueSet())); + } return tgt; } @@ -104,8 +180,12 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setStrength(VersionConvertor_10_30.convertBindingStrength(src.getStrength())); - tgt.setValueSet(VersionConvertor_10_30.convertType(src.getValueSet())); + if (src.hasStrength()) { + tgt.setStrength(VersionConvertor_10_30.convertBindingStrength(src.getStrength())); + } + if (src.hasValueSet()) { + tgt.setValueSet(VersionConvertor_10_30.convertType(src.getValueSet())); + } return tgt; } @@ -114,20 +194,34 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } if (src.hasSearchType()) { - tgt.setType(src.getSearchType().toCode()); + if (src.hasSearchType()) { + tgt.setType(src.getSearchType().toCode()); + } } else tgt.setType(src.getType()); if (src.hasProfile()) tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); if (src.hasBinding()) tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -136,20 +230,40 @@ public class OperationDefinition10_30 { return null; org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } if (Utilities.existsInList(src.getType(), "token", "reference", "composite", "number", "date", "quantity", "uri")) { tgt.setType("string"); - tgt.setSearchType(SearchParamType.fromCode(src.getType())); + if (src.hasType()) { + tgt.setSearchType(SearchParamType.fromCode(src.getType())); + } } else { - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); } - tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationOutcome10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationOutcome10_30.java index c48e62398..c5d661e49 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationOutcome10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/OperationOutcome10_30.java @@ -178,7 +178,9 @@ public class OperationOutcome10_30 { return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome10_30 { return null; org.hl7.fhir.dstu2.model.OperationOutcome tgt = new org.hl7.fhir.dstu2.model.OperationOutcome(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -196,11 +200,21 @@ public class OperationOutcome10_30 { return null; org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_10_30.convertCodeableConcept(src.getDetails())); - tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_30.convertCodeableConcept(src.getDetails())); + } + if (src.hasDiagnostics()) { + tgt.setDiagnostics(src.getDiagnostics()); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } return tgt; } @@ -209,11 +223,21 @@ public class OperationOutcome10_30 { return null; org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_10_30.convertCodeableConcept(src.getDetails())); - tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_30.convertCodeableConcept(src.getDetails())); + } + if (src.hasDiagnostics()) { + tgt.setDiagnostics(src.getDiagnostics()); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Organization10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Organization10_30.java index 4a15613c9..3c9882804 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Organization10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Organization10_30.java @@ -10,14 +10,30 @@ public class Organization10_30 { return null; org.hl7.fhir.dstu3.model.Organization tgt = new org.hl7.fhir.dstu3.model.Organization(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setActive(src.getActive()); - tgt.addType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasType()) { + tgt.addType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } return tgt; } @@ -26,14 +42,30 @@ public class Organization10_30 { return null; org.hl7.fhir.dstu2.model.Organization tgt = new org.hl7.fhir.dstu2.model.Organization(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setActive(src.getActive()); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getTypeFirstRep())); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getTypeFirstRep())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_30.convertReference(src.getPartOf())); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } return tgt; } @@ -42,10 +74,18 @@ public class Organization10_30 { return null; org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setPurpose(VersionConvertor_10_30.convertCodeableConcept(src.getPurpose())); - tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + if (src.hasPurpose()) { + tgt.setPurpose(VersionConvertor_10_30.convertCodeableConcept(src.getPurpose())); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + } return tgt; } @@ -54,10 +94,18 @@ public class Organization10_30 { return null; org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setPurpose(VersionConvertor_10_30.convertCodeableConcept(src.getPurpose())); - tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + if (src.hasPurpose()) { + tgt.setPurpose(VersionConvertor_10_30.convertCodeableConcept(src.getPurpose())); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Parameters10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Parameters10_30.java index 783abfdd0..c9b755ab7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Parameters10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Parameters10_30.java @@ -10,7 +10,9 @@ public class Parameters10_30 { return null; org.hl7.fhir.dstu3.model.Parameters tgt = new org.hl7.fhir.dstu3.model.Parameters(); VersionConvertor_10_30.copyResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters10_30 { return null; org.hl7.fhir.dstu2.model.Parameters tgt = new org.hl7.fhir.dstu2.model.Parameters(); VersionConvertor_10_30.copyResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -28,10 +32,18 @@ public class Parameters10_30 { return null; org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setResource(VersionConvertor_10_30.convertResource(src.getResource())); - for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_30.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -40,10 +52,18 @@ public class Parameters10_30 { return null; org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - tgt.setResource(VersionConvertor_10_30.convertResource(src.getResource())); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_30.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Patient10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Patient10_30.java index 078237a94..124d89338 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Patient10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Patient10_30.java @@ -10,9 +10,15 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu3.model.Patient.AnimalComponent tgt = new org.hl7.fhir.dstu3.model.Patient.AnimalComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSpecies(VersionConvertor_10_30.convertCodeableConcept(src.getSpecies())); - tgt.setBreed(VersionConvertor_10_30.convertCodeableConcept(src.getBreed())); - tgt.setGenderStatus(VersionConvertor_10_30.convertCodeableConcept(src.getGenderStatus())); + if (src.hasSpecies()) { + tgt.setSpecies(VersionConvertor_10_30.convertCodeableConcept(src.getSpecies())); + } + if (src.hasBreed()) { + tgt.setBreed(VersionConvertor_10_30.convertCodeableConcept(src.getBreed())); + } + if (src.hasGenderStatus()) { + tgt.setGenderStatus(VersionConvertor_10_30.convertCodeableConcept(src.getGenderStatus())); + } return tgt; } @@ -21,9 +27,15 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu2.model.Patient.AnimalComponent tgt = new org.hl7.fhir.dstu2.model.Patient.AnimalComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSpecies(VersionConvertor_10_30.convertCodeableConcept(src.getSpecies())); - tgt.setBreed(VersionConvertor_10_30.convertCodeableConcept(src.getBreed())); - tgt.setGenderStatus(VersionConvertor_10_30.convertCodeableConcept(src.getGenderStatus())); + if (src.hasSpecies()) { + tgt.setSpecies(VersionConvertor_10_30.convertCodeableConcept(src.getSpecies())); + } + if (src.hasBreed()) { + tgt.setBreed(VersionConvertor_10_30.convertCodeableConcept(src.getBreed())); + } + if (src.hasGenderStatus()) { + tgt.setGenderStatus(VersionConvertor_10_30.convertCodeableConcept(src.getGenderStatus())); + } return tgt; } @@ -32,13 +44,27 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu3.model.Patient.ContactComponent tgt = new org.hl7.fhir.dstu3.model.Patient.ContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasRelationship()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -47,13 +73,27 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu2.model.Patient.ContactComponent tgt = new org.hl7.fhir.dstu2.model.Patient.ContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasRelationship()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_30.convertAddress(src.getAddress())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -94,23 +134,57 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu3.model.Patient tgt = new org.hl7.fhir.dstu3.model.Patient(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setMaritalStatus(VersionConvertor_10_30.convertCodeableConcept(src.getMaritalStatus())); - tgt.setMultipleBirth(VersionConvertor_10_30.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); - for (org.hl7.fhir.dstu2.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); - tgt.setAnimal(convertAnimalComponent(src.getAnimal())); - for (org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getCareProvider()) tgt.addGeneralPractitioner(VersionConvertor_10_30.convertReference(t)); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasMaritalStatus()) { + tgt.setMaritalStatus(VersionConvertor_10_30.convertCodeableConcept(src.getMaritalStatus())); + } + if (src.hasMultipleBirth()) { + tgt.setMultipleBirth(VersionConvertor_10_30.convertType(src.getMultipleBirth())); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } + if (src.hasAnimal()) { + tgt.setAnimal(convertAnimalComponent(src.getAnimal())); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasCareProvider()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getCareProvider()) tgt.addGeneralPractitioner(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -119,23 +193,57 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu2.model.Patient tgt = new org.hl7.fhir.dstu2.model.Patient(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setMaritalStatus(VersionConvertor_10_30.convertCodeableConcept(src.getMaritalStatus())); - tgt.setMultipleBirth(VersionConvertor_10_30.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); - for (org.hl7.fhir.dstu3.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); - tgt.setAnimal(convertAnimalComponent(src.getAnimal())); - for (org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getGeneralPractitioner()) tgt.addCareProvider(VersionConvertor_10_30.convertReference(t)); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasMaritalStatus()) { + tgt.setMaritalStatus(VersionConvertor_10_30.convertCodeableConcept(src.getMaritalStatus())); + } + if (src.hasMultipleBirth()) { + tgt.setMultipleBirth(VersionConvertor_10_30.convertType(src.getMultipleBirth())); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } + if (src.hasAnimal()) { + tgt.setAnimal(convertAnimalComponent(src.getAnimal())); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getGeneralPractitioner()) tgt.addCareProvider(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -144,8 +252,12 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLanguage(VersionConvertor_10_30.convertCodeableConcept(src.getLanguage())); - tgt.setPreferred(src.getPreferred()); + if (src.hasLanguage()) { + tgt.setLanguage(VersionConvertor_10_30.convertCodeableConcept(src.getLanguage())); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } return tgt; } @@ -154,8 +266,12 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLanguage(VersionConvertor_10_30.convertCodeableConcept(src.getLanguage())); - tgt.setPreferred(src.getPreferred()); + if (src.hasLanguage()) { + tgt.setLanguage(VersionConvertor_10_30.convertCodeableConcept(src.getLanguage())); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } return tgt; } @@ -164,8 +280,12 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOther(VersionConvertor_10_30.convertReference(src.getOther())); - tgt.setType(convertLinkType(src.getType())); + if (src.hasOther()) { + tgt.setOther(VersionConvertor_10_30.convertReference(src.getOther())); + } + if (src.hasType()) { + tgt.setType(convertLinkType(src.getType())); + } return tgt; } @@ -174,8 +294,12 @@ public class Patient10_30 { return null; org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOther(VersionConvertor_10_30.convertReference(src.getOther())); - tgt.setType(convertLinkType(src.getType())); + if (src.hasOther()) { + tgt.setOther(VersionConvertor_10_30.convertReference(src.getOther())); + } + if (src.hasType()) { + tgt.setType(convertLinkType(src.getType())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Person10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Person10_30.java index 0d0b88716..b34cf94d4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Person10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Person10_30.java @@ -44,16 +44,36 @@ public class Person10_30 { return null; org.hl7.fhir.dstu3.model.Person tgt = new org.hl7.fhir.dstu3.model.Person(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu2.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -62,16 +82,36 @@ public class Person10_30 { return null; org.hl7.fhir.dstu2.model.Person tgt = new org.hl7.fhir.dstu2.model.Person(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); - tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_30.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -80,8 +120,12 @@ public class Person10_30 { return null; org.hl7.fhir.dstu3.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.dstu3.model.Person.PersonLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } + if (src.hasAssurance()) { + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + } return tgt; } @@ -90,8 +134,12 @@ public class Person10_30 { return null; org.hl7.fhir.dstu2.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.dstu2.model.Person.PersonLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); + } + if (src.hasAssurance()) { + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Practitioner10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Practitioner10_30.java index dba28bec7..4a44a6916 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Practitioner10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Practitioner10_30.java @@ -10,17 +10,35 @@ public class Practitioner10_30 { return null; org.hl7.fhir.dstu3.model.Practitioner tgt = new org.hl7.fhir.dstu3.model.Practitioner(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setActive(src.getActive()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } if (src.hasName()) tgt.addName(VersionConvertor_10_30.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); - for (org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -29,16 +47,36 @@ public class Practitioner10_30 { return null; org.hl7.fhir.dstu2.model.Practitioner tgt = new org.hl7.fhir.dstu2.model.Practitioner(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.setName(VersionConvertor_10_30.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); - for (org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.setName(VersionConvertor_10_30.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_30.convertCodeableConcept(t)); + } return tgt; } @@ -47,10 +85,18 @@ public class Practitioner10_30 { return null; org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setIssuer(VersionConvertor_10_30.convertReference(src.getIssuer())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasIssuer()) { + tgt.setIssuer(VersionConvertor_10_30.convertReference(src.getIssuer())); + } return tgt; } @@ -59,10 +105,18 @@ public class Practitioner10_30 { return null; org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setIssuer(VersionConvertor_10_30.convertReference(src.getIssuer())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasIssuer()) { + tgt.setIssuer(VersionConvertor_10_30.convertReference(src.getIssuer())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Procedure10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Procedure10_30.java index ad72c1cea..d542bcea2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Procedure10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Procedure10_30.java @@ -10,25 +10,63 @@ public class Procedure10_30 { return null; org.hl7.fhir.dstu2.model.Procedure tgt = new org.hl7.fhir.dstu2.model.Procedure(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setStatus(convertProcedureStatus(src.getStatus())); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setNotPerformed(src.getNotDone()); - tgt.addReasonNotPerformed(VersionConvertor_10_30.convertCodeableConcept(src.getNotDoneReason())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setReason(VersionConvertor_10_30.convertType(src.getReasonCodeFirstRep())); - for (org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertProcedurePerformerComponent(t)); - tgt.setPerformed(VersionConvertor_10_30.convertType(src.getPerformed())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReport()) tgt.addReport(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getComplication()) tgt.addComplication(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getFollowUp()) tgt.addFollowUp(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setRequest(VersionConvertor_10_30.convertReference(src.getBasedOnFirstRep())); - for (org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertProcedureStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasNotDone()) { + tgt.setNotPerformed(src.getNotDone()); + } + if (src.hasNotDoneReason()) { + tgt.addReasonNotPerformed(VersionConvertor_10_30.convertCodeableConcept(src.getNotDoneReason())); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReasonCode()) { + tgt.setReason(VersionConvertor_10_30.convertType(src.getReasonCodeFirstRep())); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertProcedurePerformerComponent(t)); + } + if (src.hasPerformed()) { + tgt.setPerformed(VersionConvertor_10_30.convertType(src.getPerformed())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); + } + if (src.hasReport()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReport()) tgt.addReport(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasComplication()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getComplication()) tgt.addComplication(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasFollowUp()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getFollowUp()) tgt.addFollowUp(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasBasedOn()) { + tgt.setRequest(VersionConvertor_10_30.convertReference(src.getBasedOnFirstRep())); + } + if (src.hasFocalDevice()) { + for (org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + } return tgt; } @@ -37,27 +75,61 @@ public class Procedure10_30 { return null; org.hl7.fhir.dstu3.model.Procedure tgt = new org.hl7.fhir.dstu3.model.Procedure(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setStatus(convertProcedureStatus(src.getStatus())); - tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setNotDone(src.getNotPerformed()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertProcedureStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_30.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasNotPerformed()) { + tgt.setNotDone(src.getNotPerformed()); + } if (src.hasReasonNotPerformed()) tgt.setNotDoneReason(VersionConvertor_10_30.convertCodeableConcept(src.getReasonNotPerformed().get(0))); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + } if (src.hasReasonCodeableConcept()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(src.getReasonCodeableConcept())); - for (org.hl7.fhir.dstu2.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertProcedurePerformerComponent(t)); - tgt.setPerformed(VersionConvertor_10_30.convertType(src.getPerformed())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReport()) tgt.addReport(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getComplication()) tgt.addComplication(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getFollowUp()) tgt.addFollowUp(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.addBasedOn(VersionConvertor_10_30.convertReference(src.getRequest())); - for (org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu2.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertProcedurePerformerComponent(t)); + } + if (src.hasPerformed()) { + tgt.setPerformed(VersionConvertor_10_30.convertType(src.getPerformed())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); + } + if (src.hasReport()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReport()) tgt.addReport(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasComplication()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getComplication()) tgt.addComplication(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasFollowUp()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getFollowUp()) tgt.addFollowUp(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasRequest()) { + tgt.addBasedOn(VersionConvertor_10_30.convertReference(src.getRequest())); + } + if (src.hasFocalDevice()) { + for (org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + } return tgt; } @@ -66,8 +138,12 @@ public class Procedure10_30 { return null; org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); - tgt.setManipulated(VersionConvertor_10_30.convertReference(src.getManipulated())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); + } + if (src.hasManipulated()) { + tgt.setManipulated(VersionConvertor_10_30.convertReference(src.getManipulated())); + } return tgt; } @@ -76,8 +152,12 @@ public class Procedure10_30 { return null; org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); - tgt.setManipulated(VersionConvertor_10_30.convertReference(src.getManipulated())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); + } + if (src.hasManipulated()) { + tgt.setManipulated(VersionConvertor_10_30.convertReference(src.getManipulated())); + } return tgt; } @@ -86,8 +166,12 @@ public class Procedure10_30 { return null; org.hl7.fhir.dstu2.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.dstu2.model.Procedure.ProcedurePerformerComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); - tgt.setRole(VersionConvertor_10_30.convertCodeableConcept(src.getRole())); + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_30.convertCodeableConcept(src.getRole())); + } return tgt; } @@ -96,8 +180,12 @@ public class Procedure10_30 { return null; org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); - tgt.setRole(VersionConvertor_10_30.convertCodeableConcept(src.getRole())); + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_30.convertCodeableConcept(src.getRole())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ProcedureRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ProcedureRequest10_30.java index b47e82dfe..610c383f4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ProcedureRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ProcedureRequest10_30.java @@ -10,19 +10,41 @@ public class ProcedureRequest10_30 { return null; org.hl7.fhir.dstu3.model.ProcedureRequest tgt = new org.hl7.fhir.dstu3.model.ProcedureRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + } if (src.hasReasonCodeableConcept()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(src.getReasonCodeableConcept())); - tgt.setOccurrence(VersionConvertor_10_30.convertType(src.getScheduled())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); - tgt.setStatus(convertProcedureRequestStatus(src.getStatus())); - tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); - tgt.setAuthoredOn(src.getOrderedOn()); - tgt.setPriority(convertProcedureRequestPriority(src.getPriority())); + if (src.hasScheduled()) { + tgt.setOccurrence(VersionConvertor_10_30.convertType(src.getScheduled())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); + } + if (src.hasStatus()) { + tgt.setStatus(convertProcedureRequestStatus(src.getStatus())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + } + if (src.hasOrderedOn()) { + tgt.setAuthoredOn(src.getOrderedOn()); + } + if (src.hasPriority()) { + tgt.setPriority(convertProcedureRequestPriority(src.getPriority())); + } return tgt; } @@ -31,18 +53,42 @@ public class ProcedureRequest10_30 { return null; org.hl7.fhir.dstu2.model.ProcedureRequest tgt = new org.hl7.fhir.dstu2.model.ProcedureRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setReason(VersionConvertor_10_30.convertType(src.getReasonCodeFirstRep())); - tgt.setScheduled(VersionConvertor_10_30.convertType(src.getOccurrence())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); - tgt.setStatus(convertProcedureRequestStatus(src.getStatus())); - tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); - tgt.setOrderedOn(src.getAuthoredOn()); - tgt.setPriority(convertProcedureRequestPriority(src.getPriority())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasReasonCode()) { + tgt.setReason(VersionConvertor_10_30.convertType(src.getReasonCodeFirstRep())); + } + if (src.hasOccurrence()) { + tgt.setScheduled(VersionConvertor_10_30.convertType(src.getOccurrence())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); + } + if (src.hasStatus()) { + tgt.setStatus(convertProcedureRequestStatus(src.getStatus())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_30.convertType(src.getAsNeeded())); + } + if (src.hasAuthoredOn()) { + tgt.setOrderedOn(src.getAuthoredOn()); + } + if (src.hasPriority()) { + tgt.setPriority(convertProcedureRequestPriority(src.getPriority())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Provenance10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Provenance10_30.java index 15d8793ec..1e8a2ecc2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Provenance10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Provenance10_30.java @@ -10,16 +10,36 @@ public class Provenance10_30 { return null; org.hl7.fhir.dstu2.model.Provenance tgt = new org.hl7.fhir.dstu2.model.Provenance(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_10_30.convertReference(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setRecorded(src.getRecorded()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getReason()) tgt.addReason().addCoding(VersionConvertor_10_30.convertCoding(t)); - tgt.setActivity(new org.hl7.fhir.dstu2.model.CodeableConcept().addCoding(VersionConvertor_10_30.convertCoding(src.getActivity()))); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); - for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); - for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_10_30.convertSignature(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasRecorded()) { + tgt.setRecorded(src.getRecorded()); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getReason()) tgt.addReason().addCoding(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasActivity()) { + tgt.setActivity(new org.hl7.fhir.dstu2.model.CodeableConcept().addCoding(VersionConvertor_10_30.convertCoding(src.getActivity()))); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + if (src.hasEntity()) { + for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); + } + if (src.hasSignature()) { + for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_10_30.convertSignature(t)); + } return tgt; } @@ -28,16 +48,36 @@ public class Provenance10_30 { return null; org.hl7.fhir.dstu3.model.Provenance tgt = new org.hl7.fhir.dstu3.model.Provenance(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_10_30.convertReference(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); - tgt.setRecorded(src.getRecorded()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) for (org.hl7.fhir.dstu2.model.Coding tc : t.getCoding()) tgt.addReason(VersionConvertor_10_30.convertCoding(tc)); - for (org.hl7.fhir.dstu2.model.Coding t : src.getActivity().getCoding()) tgt.setActivity(VersionConvertor_10_30.convertCoding(t)); - tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - for (org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); - for (org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); - for (org.hl7.fhir.dstu2.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_10_30.convertSignature(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } + if (src.hasRecorded()) { + tgt.setRecorded(src.getRecorded()); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) for (org.hl7.fhir.dstu2.model.Coding tc : t.getCoding()) tgt.addReason(VersionConvertor_10_30.convertCoding(tc)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getActivity().getCoding()) tgt.setActivity(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasAgent()) { + for (org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + if (src.hasEntity()) { + for (org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); + } + if (src.hasSignature()) { + for (org.hl7.fhir.dstu2.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_10_30.convertSignature(t)); + } return tgt; } @@ -56,7 +96,9 @@ public class Provenance10_30 { return null; org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setWho(VersionConvertor_10_30.convertReference(src.getActor())); + if (src.hasActor()) { + tgt.setWho(VersionConvertor_10_30.convertReference(src.getActor())); + } return tgt; } @@ -65,10 +107,14 @@ public class Provenance10_30 { return null; org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setRole(convertProvenanceEntityRole(src.getRole())); + if (src.hasRole()) { + tgt.setRole(convertProvenanceEntityRole(src.getRole())); + } if (src.hasWhatReference() && src.getWhatReference().hasReference()) tgt.setReference(src.getWhatReference().getReference()); - for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.setAgent(convertProvenanceAgentComponent(t)); + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.setAgent(convertProvenanceAgentComponent(t)); + } return tgt; } @@ -77,10 +123,14 @@ public class Provenance10_30 { return null; org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setRole(convertProvenanceEntityRole(src.getRole())); + if (src.hasRole()) { + tgt.setRole(convertProvenanceEntityRole(src.getRole())); + } if (src.hasReference()) tgt.setWhat(new org.hl7.fhir.dstu3.model.Reference().setReference(src.getReference())); - tgt.addAgent(convertProvenanceAgentComponent(src.getAgent())); + if (src.hasAgent()) { + tgt.addAgent(convertProvenanceAgentComponent(src.getAgent())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Questionnaire10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Questionnaire10_30.java index c66483666..7d9b80a67 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Questionnaire10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Questionnaire10_30.java @@ -11,19 +11,33 @@ public class Questionnaire10_30 { return null; org.hl7.fhir.dstu2.model.Questionnaire tgt = new org.hl7.fhir.dstu2.model.Questionnaire(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (ContactDetail t : src.getContact()) for (org.hl7.fhir.dstu3.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t1)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (ContactDetail t : src.getContact()) for (org.hl7.fhir.dstu3.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t1)); + } org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent root = tgt.getGroup(); - root.setTitle(src.getTitle()); + if (src.hasTitle()) { + root.setTitle(src.getTitle()); + } for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) { root.addConcept(VersionConvertor_10_30.convertCoding(t)); } - for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + if (src.hasSubjectType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) if (t.getType() == org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP) root.addGroup(convertQuestionnaireGroupComponent(t)); else @@ -65,11 +79,21 @@ public class Questionnaire10_30 { return null; org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent tgt = new org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_30.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) if (t.getType() == org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP) tgt.addGroup(convertQuestionnaireGroupComponent(t)); else @@ -82,14 +106,28 @@ public class Questionnaire10_30 { return null; org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_30.convertCoding(t)); - tgt.setText(src.getText()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } tgt.setType(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); - for (org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireQuestionComponent(t)); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + } + if (src.hasQuestion()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireQuestionComponent(t)); + } return tgt; } @@ -135,15 +173,33 @@ public class Questionnaire10_30 { return null; org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_30.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireQuestionType(src.getType())); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - tgt.setOptions(VersionConvertor_10_30.convertReference(src.getOptions())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getOption()) tgt.addOption().setValue(VersionConvertor_10_30.convertCoding(t)); - for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasType()) { + tgt.setType(convertQuestionnaireQuestionType(src.getType())); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasOptions()) { + tgt.setOptions(VersionConvertor_10_30.convertReference(src.getOptions())); + } + if (src.hasOption()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getOption()) tgt.addOption().setValue(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + } return tgt; } @@ -152,20 +208,36 @@ public class Questionnaire10_30 { return null; org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent tgt = new org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_30.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - tgt.setOptions(VersionConvertor_10_30.convertReference(src.getOptions())); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasOptions()) { + tgt.setOptions(VersionConvertor_10_30.convertReference(src.getOptions())); + } for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) if (t.hasValueCoding()) try { tgt.addOption(VersionConvertor_10_30.convertCoding(t.getValueCoding())); } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireGroupComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireGroupComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/QuestionnaireResponse10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/QuestionnaireResponse10_30.java index f52907f01..abc3b2acf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/QuestionnaireResponse10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/QuestionnaireResponse10_30.java @@ -10,9 +10,15 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) if (t.hasAnswer()) tgt.addQuestion(convertQuestionnaireItemToQuestion(t)); else @@ -25,9 +31,15 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } return tgt; } @@ -36,17 +48,35 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_10_30.convertReference(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaire(VersionConvertor_10_30.convertReference(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasAuthored()) { + tgt.setAuthored(src.getAuthored()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } if (src.getItem().size() != 1) throw new FHIRException("multiple root items not supported"); - tgt.setGroup(convertQuestionnaireItemToGroup(src.getItem().get(0))); + if (src.hasItem()) { + tgt.setGroup(convertQuestionnaireItemToGroup(src.getItem().get(0))); + } return tgt; } @@ -55,14 +85,30 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu3.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu3.model.QuestionnaireResponse(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_10_30.convertReference(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); - tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaire(VersionConvertor_10_30.convertReference(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); + } + if (src.hasAuthored()) { + tgt.setAuthored(src.getAuthored()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } if (src.hasGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(src.getGroup())); return tgt; @@ -73,11 +119,21 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + } + if (src.hasQuestion()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); + } return tgt; } @@ -86,8 +142,12 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireItemToGroup(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireItemToGroup(t)); + } return tgt; } @@ -96,8 +156,12 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + } return tgt; } @@ -106,9 +170,15 @@ public class QuestionnaireResponse10_30 { return null; org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ReferralRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ReferralRequest10_30.java index 0dba57c46..ccf9ef230 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ReferralRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ReferralRequest10_30.java @@ -47,19 +47,45 @@ public class ReferralRequest10_30 { return null; org.hl7.fhir.dstu2.model.ReferralRequest tgt = new org.hl7.fhir.dstu2.model.ReferralRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertReferralStatus(src.getStatus())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setPriority(convertReferralPriorityCode(src.getPriority())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setFulfillmentTime(VersionConvertor_10_30.convertPeriod(src.getOccurrencePeriod())); - tgt.setRequester(VersionConvertor_10_30.convertReference(src.getRequester().getAgent())); - tgt.setSpecialty(VersionConvertor_10_30.convertCodeableConcept(src.getSpecialty())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept cc : src.getReasonCode()) tgt.setReason(VersionConvertor_10_30.convertCodeableConcept(cc)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceRequested()) tgt.addServiceRequested(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInformation(VersionConvertor_10_30.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertReferralStatus(src.getStatus())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasPriority()) { + tgt.setPriority(convertReferralPriorityCode(src.getPriority())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasOccurrencePeriod()) { + tgt.setFulfillmentTime(VersionConvertor_10_30.convertPeriod(src.getOccurrencePeriod())); + } + if (src.hasRequester()) { + tgt.setRequester(VersionConvertor_10_30.convertReference(src.getRequester().getAgent())); + } + if (src.hasSpecialty()) { + tgt.setSpecialty(VersionConvertor_10_30.convertCodeableConcept(src.getSpecialty())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept cc : src.getReasonCode()) tgt.setReason(VersionConvertor_10_30.convertCodeableConcept(cc)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasServiceRequested()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceRequested()) tgt.addServiceRequested(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInformation(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -68,19 +94,45 @@ public class ReferralRequest10_30 { return null; org.hl7.fhir.dstu3.model.ReferralRequest tgt = new org.hl7.fhir.dstu3.model.ReferralRequest(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setStatus(convertReferralStatus(src.getStatus())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setPriority(convertReferralPriorityCode(src.getPriority())); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setOccurrence(VersionConvertor_10_30.convertPeriod(src.getFulfillmentTime())); - tgt.getRequester().setAgent(VersionConvertor_10_30.convertReference(src.getRequester())); - tgt.setSpecialty(VersionConvertor_10_30.convertCodeableConcept(src.getSpecialty())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); - tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(src.getReason())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceRequested()) tgt.addServiceRequested(VersionConvertor_10_30.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInfo(VersionConvertor_10_30.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertReferralStatus(src.getStatus())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasPriority()) { + tgt.setPriority(convertReferralPriorityCode(src.getPriority())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasFulfillmentTime()) { + tgt.setOccurrence(VersionConvertor_10_30.convertPeriod(src.getFulfillmentTime())); + } + if (src.hasRequester()) { + tgt.getRequester().setAgent(VersionConvertor_10_30.convertReference(src.getRequester())); + } + if (src.hasSpecialty()) { + tgt.setSpecialty(VersionConvertor_10_30.convertCodeableConcept(src.getSpecialty())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasReason()) { + tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(src.getReason())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasServiceRequested()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceRequested()) tgt.addServiceRequested(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInfo(VersionConvertor_10_30.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RelatedPerson10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RelatedPerson10_30.java index fa22bb003..5c1a5111b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RelatedPerson10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RelatedPerson10_30.java @@ -10,16 +10,36 @@ public class RelatedPerson10_30 { return null; org.hl7.fhir.dstu3.model.RelatedPerson tgt = new org.hl7.fhir.dstu3.model.RelatedPerson(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); - tgt.addName(VersionConvertor_10_30.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); + } + if (src.hasName()) { + tgt.addName(VersionConvertor_10_30.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -28,17 +48,35 @@ public class RelatedPerson10_30 { return null; org.hl7.fhir.dstu2.model.RelatedPerson tgt = new org.hl7.fhir.dstu2.model.RelatedPerson(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); + } if (!src.getName().isEmpty()) tgt.setName(VersionConvertor_10_30.convertHumanName(src.getName().get(0))); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); - tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RiskAssessment10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RiskAssessment10_30.java index 9937ea2e4..e39099f20 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RiskAssessment10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/RiskAssessment10_30.java @@ -10,15 +10,33 @@ public class RiskAssessment10_30 { return null; org.hl7.fhir.dstu2.model.RiskAssessment tgt = new org.hl7.fhir.dstu2.model.RiskAssessment(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setCondition(VersionConvertor_10_30.convertReference(src.getCondition())); - tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); - tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - tgt.setMitigation(src.getMitigation()); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasCondition()) { + tgt.setCondition(VersionConvertor_10_30.convertReference(src.getCondition())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_30.convertReference(src.getContext())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasBasis()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) { + tgt.setMitigation(src.getMitigation()); + } return tgt; } @@ -27,15 +45,33 @@ public class RiskAssessment10_30 { return null; org.hl7.fhir.dstu3.model.RiskAssessment tgt = new org.hl7.fhir.dstu3.model.RiskAssessment(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - tgt.setCondition(VersionConvertor_10_30.convertReference(src.getCondition())); - tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); - tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - tgt.setMitigation(src.getMitigation()); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); + } + if (src.hasCondition()) { + tgt.setCondition(VersionConvertor_10_30.convertReference(src.getCondition())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_30.convertReference(src.getEncounter())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_30.convertReference(src.getPerformer())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_30.convertCodeableConcept(src.getMethod())); + } + if (src.hasBasis()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) { + tgt.setMitigation(src.getMitigation()); + } return tgt; } @@ -44,11 +80,21 @@ public class RiskAssessment10_30 { return null; org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); - tgt.setProbability(VersionConvertor_10_30.convertType(src.getProbability())); - tgt.setRelativeRisk(src.getRelativeRisk()); - tgt.setWhen(VersionConvertor_10_30.convertType(src.getWhen())); - tgt.setRationale(src.getRationale()); + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); + } + if (src.hasProbability()) { + tgt.setProbability(VersionConvertor_10_30.convertType(src.getProbability())); + } + if (src.hasRelativeRisk()) { + tgt.setRelativeRisk(src.getRelativeRisk()); + } + if (src.hasWhen()) { + tgt.setWhen(VersionConvertor_10_30.convertType(src.getWhen())); + } + if (src.hasRationale()) { + tgt.setRationale(src.getRationale()); + } return tgt; } @@ -57,11 +103,21 @@ public class RiskAssessment10_30 { return null; org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); - tgt.setProbability(VersionConvertor_10_30.convertType(src.getProbability())); - tgt.setRelativeRisk(src.getRelativeRisk()); - tgt.setWhen(VersionConvertor_10_30.convertType(src.getWhen())); - tgt.setRationale(src.getRationale()); + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_30.convertCodeableConcept(src.getOutcome())); + } + if (src.hasProbability()) { + tgt.setProbability(VersionConvertor_10_30.convertType(src.getProbability())); + } + if (src.hasRelativeRisk()) { + tgt.setRelativeRisk(src.getRelativeRisk()); + } + if (src.hasWhen()) { + tgt.setWhen(VersionConvertor_10_30.convertType(src.getWhen())); + } + if (src.hasRationale()) { + tgt.setRationale(src.getRationale()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Schedule10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Schedule10_30.java index 284ba98c1..e4e773f10 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Schedule10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Schedule10_30.java @@ -10,11 +10,21 @@ public class Schedule10_30 { return null; org.hl7.fhir.dstu2.model.Schedule tgt = new org.hl7.fhir.dstu2.model.Schedule(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_30.convertReference(src.getActorFirstRep())); - tgt.setPlanningHorizon(VersionConvertor_10_30.convertPeriod(src.getPlanningHorizon())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_30.convertReference(src.getActorFirstRep())); + } + if (src.hasPlanningHorizon()) { + tgt.setPlanningHorizon(VersionConvertor_10_30.convertPeriod(src.getPlanningHorizon())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -23,11 +33,21 @@ public class Schedule10_30 { return null; org.hl7.fhir.dstu3.model.Schedule tgt = new org.hl7.fhir.dstu3.model.Schedule(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addServiceType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.addActor(VersionConvertor_10_30.convertReference(src.getActor())); - tgt.setPlanningHorizon(VersionConvertor_10_30.convertPeriod(src.getPlanningHorizon())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addServiceType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.addActor(VersionConvertor_10_30.convertReference(src.getActor())); + } + if (src.hasPlanningHorizon()) { + tgt.setPlanningHorizon(VersionConvertor_10_30.convertPeriod(src.getPlanningHorizon())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SearchParameter10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SearchParameter10_30.java index 4ab2b1967..657a49a7a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SearchParameter10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SearchParameter10_30.java @@ -11,24 +11,52 @@ public class SearchParameter10_30 { return null; org.hl7.fhir.dstu2.model.SearchParameter tgt = new org.hl7.fhir.dstu2.model.SearchParameter(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); - tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); - org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression()); - tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasExpression()) { + org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression()); + } + if (src.hasXpath()) { + tgt.setXpath(src.getXpath()); + } + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -37,24 +65,50 @@ public class SearchParameter10_30 { return null; org.hl7.fhir.dstu3.model.SearchParameter tgt = new org.hl7.fhir.dstu3.model.SearchParameter(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCode(src.getCode()); - tgt.addBase(src.getBase()); - tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + tgt.addBase(src.getBase()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } tgt.setExpression(ToolingExtensions.readStringExtension(src, ToolingExtensions.EXT_EXPRESSION)); - tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpath()) { + tgt.setXpath(src.getXpath()); + } + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -63,8 +117,12 @@ public class SearchParameter10_30 { return null; org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent tgt = new org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -73,8 +131,12 @@ public class SearchParameter10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Slot10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Slot10_30.java index d2149fe8d..e78870166 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Slot10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Slot10_30.java @@ -10,14 +10,26 @@ public class Slot10_30 { return null; org.hl7.fhir.dstu3.model.Slot tgt = new org.hl7.fhir.dstu3.model.Slot(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } if (src.hasType()) tgt.addServiceType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setSchedule(VersionConvertor_10_30.convertReference(src.getSchedule())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setOverbooked(src.getOverbooked()); - tgt.setComment(src.getComment()); + if (src.hasSchedule()) { + tgt.setSchedule(VersionConvertor_10_30.convertReference(src.getSchedule())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasOverbooked()) { + tgt.setOverbooked(src.getOverbooked()); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -26,13 +38,27 @@ public class Slot10_30 { return null; org.hl7.fhir.dstu2.model.Slot tgt = new org.hl7.fhir.dstu2.model.Slot(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setSchedule(VersionConvertor_10_30.convertReference(src.getSchedule())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setOverbooked(src.getOverbooked()); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasSchedule()) { + tgt.setSchedule(VersionConvertor_10_30.convertReference(src.getSchedule())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasOverbooked()) { + tgt.setOverbooked(src.getOverbooked()); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Specimen10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Specimen10_30.java index f84b03d2c..e87fb0d9b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Specimen10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Specimen10_30.java @@ -12,7 +12,9 @@ public class Specimen10_30 { } org.hl7.fhir.dstu2.model.Specimen tgt = new org.hl7.fhir.dstu2.model.Specimen(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } if (src.hasAccessionIdentifier()) tgt.setAccessionIdentifier(VersionConvertor_10_30.convertIdentifier(src.getAccessionIdentifier())); if (src.hasStatus()) @@ -23,11 +25,17 @@ public class Specimen10_30 { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); if (src.hasReceivedTime()) tgt.setReceivedTime(src.getReceivedTime()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_10_30.convertReference(t)); + if (src.hasParent()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_10_30.convertReference(t)); + } if (src.hasCollection()) tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); - for (org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addTreatment(convertSpecimenProcessingComponent(t)); - for (org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + if (src.hasProcessing()) { + for (org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addTreatment(convertSpecimenProcessingComponent(t)); + } + if (src.hasContainer()) { + for (org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + } return tgt; } @@ -54,7 +62,9 @@ public class Specimen10_30 { return null; org.hl7.fhir.dstu2.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.dstu2.model.Specimen.SpecimenContainerComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasType()) @@ -77,7 +87,9 @@ public class Specimen10_30 { tgt.setDescription(src.getDescription()); if (src.hasProcedure()) tgt.setProcedure(VersionConvertor_10_30.convertCodeableConcept(src.getProcedure())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_10_30.convertReference(t)); + if (src.hasAdditive()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_10_30.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/StructureDefinition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/StructureDefinition10_30.java index ef08d1852..2bcad832b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/StructureDefinition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/StructureDefinition10_30.java @@ -5,7 +5,6 @@ import org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.Utilities; - import java.util.ArrayList; import java.util.List; @@ -46,35 +45,81 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu2.model.StructureDefinition tgt = new org.hl7.fhir.dstu2.model.StructureDefinition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setDisplay(src.getTitle()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTitle()) { + tgt.setDisplay(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_10_30.convertCoding(t)); - tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - tgt.setAbstract(src.getAbstract()); - tgt.setContextType(convertExtensionContext(src.getContextType())); - for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); - tgt.setConstrainedType(src.getType()); - tgt.setBase(src.getBaseDefinition()); - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKeyword()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasContextType()) { + tgt.setContextType(convertExtensionContext(src.getContextType())); + } + if (src.hasContext()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); + } + if (src.hasType()) { + tgt.setConstrainedType(src.getType()); + } + if (src.hasBaseDefinition()) { + tgt.setBase(src.getBaseDefinition()); + } + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } if (tgt.hasBase()) { if (tgt.hasDifferential()) tgt.getDifferential().getElement().get(0).addType().setCode(tail(tgt.getBase())); @@ -89,32 +134,68 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu3.model.StructureDefinition tgt = new org.hl7.fhir.dstu3.model.StructureDefinition(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setTitle(src.getDisplay()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDisplay()) { + tgt.setTitle(src.getDisplay()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_10_30.convertCoding(t)); - tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind(), tgt.getId())); - tgt.setAbstract(src.getAbstract()); - tgt.setContextType(convertExtensionContext(src.getContextType())); - for (org.hl7.fhir.dstu2.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasCode()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_10_30.convertCoding(t)); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind(), tgt.getId())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasContextType()) { + tgt.setContextType(convertExtensionContext(src.getContextType())); + } + if (src.hasContext()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); + } if (src.hasConstrainedType()) tgt.setType(src.getConstrainedType()); else if (src.getSnapshot().hasElement()) @@ -123,10 +204,16 @@ public class StructureDefinition10_30 { tgt.setType(src.getDifferential().getElement().get(0).getPath()); else tgt.setType(src.getDifferential().getElement().get(0).getPath().substring(0, src.getDifferential().getElement().get(0).getPath().indexOf("."))); - tgt.setBaseDefinition(src.getBase()); + if (src.hasBase()) { + tgt.setBaseDefinition(src.getBase()); + } tgt.setDerivation(src.hasConstrainedType() ? org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT : org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } if (tgt.hasSnapshot()) tgt.getSnapshot().getElementFirstRep().getType().clear(); if (tgt.hasDifferential()) @@ -144,8 +231,12 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -154,8 +245,12 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -164,7 +259,9 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_30.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_30.convertElementDefinition(t)); + } return tgt; } @@ -222,10 +319,18 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComments(src.getComment()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } return tgt; } @@ -234,10 +339,18 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComment(src.getComments()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } return tgt; } @@ -246,7 +359,9 @@ public class StructureDefinition10_30 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_30.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_30.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Subscription10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Subscription10_30.java index a2d361030..ada80c4cf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Subscription10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Subscription10_30.java @@ -10,14 +10,30 @@ public class Subscription10_30 { return null; org.hl7.fhir.dstu3.model.Subscription tgt = new org.hl7.fhir.dstu3.model.Subscription(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setCriteria(src.getCriteria()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setReason(src.getReason()); - tgt.setStatus(convertSubscriptionStatus(src.getStatus())); - tgt.setError(src.getError()); - tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getTag()) tgt.addTag(VersionConvertor_10_30.convertCoding(t)); + if (src.hasCriteria()) { + tgt.setCriteria(src.getCriteria()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasReason()) { + tgt.setReason(src.getReason()); + } + if (src.hasStatus()) { + tgt.setStatus(convertSubscriptionStatus(src.getStatus())); + } + if (src.hasError()) { + tgt.setError(src.getError()); + } + if (src.hasChannel()) { + tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasTag()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getTag()) tgt.addTag(VersionConvertor_10_30.convertCoding(t)); + } return tgt; } @@ -26,14 +42,30 @@ public class Subscription10_30 { return null; org.hl7.fhir.dstu2.model.Subscription tgt = new org.hl7.fhir.dstu2.model.Subscription(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setCriteria(src.getCriteria()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); - tgt.setReason(src.getReason()); - tgt.setStatus(convertSubscriptionStatus(src.getStatus())); - tgt.setError(src.getError()); - tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(VersionConvertor_10_30.convertCoding(t)); + if (src.hasCriteria()) { + tgt.setCriteria(src.getCriteria()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_30.convertContactPoint(t)); + } + if (src.hasReason()) { + tgt.setReason(src.getReason()); + } + if (src.hasStatus()) { + tgt.setStatus(convertSubscriptionStatus(src.getStatus())); + } + if (src.hasError()) { + tgt.setError(src.getError()); + } + if (src.hasChannel()) { + tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasTag()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(VersionConvertor_10_30.convertCoding(t)); + } return tgt; } @@ -42,9 +74,15 @@ public class Subscription10_30 { return null; org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent tgt = new org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertSubscriptionChannelType(src.getType())); - tgt.setEndpoint(src.getEndpoint()); - tgt.setPayload(src.getPayload()); + if (src.hasType()) { + tgt.setType(convertSubscriptionChannelType(src.getType())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } + if (src.hasPayload()) { + tgt.setPayload(src.getPayload()); + } if (src.hasHeader()) tgt.setHeaderElement(VersionConvertor_10_30.convertString(src.getHeader().get(0))); return tgt; @@ -55,10 +93,18 @@ public class Subscription10_30 { return null; org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelComponent tgt = new org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(convertSubscriptionChannelType(src.getType())); - tgt.setEndpoint(src.getEndpoint()); - tgt.setPayload(src.getPayload()); - tgt.addHeader(src.getHeader()); + if (src.hasType()) { + tgt.setType(convertSubscriptionChannelType(src.getType())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } + if (src.hasPayload()) { + tgt.setPayload(src.getPayload()); + } + if (src.hasHeader()) { + tgt.addHeader(src.getHeader()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Substance10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Substance10_30.java index 413160599..7a4d195c7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Substance10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/Substance10_30.java @@ -10,12 +10,24 @@ public class Substance10_30 { return null; org.hl7.fhir.dstu2.model.Substance tgt = new org.hl7.fhir.dstu2.model.Substance(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -24,12 +36,24 @@ public class Substance10_30 { return null; org.hl7.fhir.dstu3.model.Substance tgt = new org.hl7.fhir.dstu3.model.Substance(); VersionConvertor_10_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -38,8 +62,12 @@ public class Substance10_30 { return null; org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setQuantity(VersionConvertor_10_30.convertRatio(src.getQuantity())); - tgt.setSubstance(VersionConvertor_10_30.convertReference(src.getSubstance())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertRatio(src.getQuantity())); + } + if (src.hasSubstance()) { + tgt.setSubstance(VersionConvertor_10_30.convertReference(src.getSubstance())); + } return tgt; } @@ -48,7 +76,9 @@ public class Substance10_30 { return null; org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setQuantity(VersionConvertor_10_30.convertRatio(src.getQuantity())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertRatio(src.getQuantity())); + } return tgt; } @@ -57,9 +87,15 @@ public class Substance10_30 { return null; org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setExpiry(src.getExpiry()); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasExpiry()) { + tgt.setExpiry(src.getExpiry()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } return tgt; } @@ -68,9 +104,15 @@ public class Substance10_30 { return null; org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setExpiry(src.getExpiry()); - tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasExpiry()) { + tgt.setExpiry(src.getExpiry()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyDelivery10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyDelivery10_30.java index 2255075df..d3832c0f9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyDelivery10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyDelivery10_30.java @@ -10,13 +10,27 @@ public class SupplyDelivery10_30 { return null; org.hl7.fhir.dstu3.model.SupplyDelivery tgt = new org.hl7.fhir.dstu3.model.SupplyDelivery(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setSupplier(VersionConvertor_10_30.convertReference(src.getSupplier())); - tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasStatus()) { + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasSupplier()) { + tgt.setSupplier(VersionConvertor_10_30.convertReference(src.getSupplier())); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); + } return tgt; } @@ -25,13 +39,27 @@ public class SupplyDelivery10_30 { return null; org.hl7.fhir.dstu2.model.SupplyDelivery tgt = new org.hl7.fhir.dstu2.model.SupplyDelivery(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); - tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); - tgt.setSupplier(VersionConvertor_10_30.convertReference(src.getSupplier())); - tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasStatus()) { + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); + } + if (src.hasSupplier()) { + tgt.setSupplier(VersionConvertor_10_30.convertReference(src.getSupplier())); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_30.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/TestScript10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/TestScript10_30.java index adffd85aa..50e200bd3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/TestScript10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/TestScript10_30.java @@ -186,24 +186,60 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - tgt.setCompareToSourceId(src.getCompareToSourceId()); - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setHeaderField(src.getHeaderField()); - tgt.setMinimumId(src.getMinimumId()); - tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - tgt.setPath(src.getPath()); - tgt.setResource(src.getResource()); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - tgt.setResponseCode(src.getResponseCode()); - tgt.setSourceId(src.getSourceId()); - tgt.setValidateProfileId(src.getValidateProfileId()); - tgt.setValue(src.getValue()); - tgt.setWarningOnly(src.getWarningOnly()); + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } + if (src.hasCompareToSourceId()) { + tgt.setCompareToSourceId(src.getCompareToSourceId()); + } + if (src.hasCompareToSourcePath()) { + tgt.setCompareToSourcePath(src.getCompareToSourcePath()); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasMinimumId()) { + tgt.setMinimumId(src.getMinimumId()); + } + if (src.hasNavigationLinks()) { + tgt.setNavigationLinks(src.getNavigationLinks()); + } + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } + if (src.hasResponseCode()) { + tgt.setResponseCode(src.getResponseCode()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasValidateProfileId()) { + tgt.setValidateProfileId(src.getValidateProfileId()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasWarningOnly()) { + tgt.setWarningOnly(src.getWarningOnly()); + } return tgt; } @@ -212,24 +248,60 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - tgt.setCompareToSourceId(src.getCompareToSourceId()); - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setHeaderField(src.getHeaderField()); - tgt.setMinimumId(src.getMinimumId()); - tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - tgt.setPath(src.getPath()); - tgt.setResource(src.getResource()); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - tgt.setResponseCode(src.getResponseCode()); - tgt.setSourceId(src.getSourceId()); - tgt.setValidateProfileId(src.getValidateProfileId()); - tgt.setValue(src.getValue()); - tgt.setWarningOnly(src.getWarningOnly()); + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } + if (src.hasCompareToSourceId()) { + tgt.setCompareToSourceId(src.getCompareToSourceId()); + } + if (src.hasCompareToSourcePath()) { + tgt.setCompareToSourcePath(src.getCompareToSourcePath()); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasMinimumId()) { + tgt.setMinimumId(src.getMinimumId()); + } + if (src.hasNavigationLinks()) { + tgt.setNavigationLinks(src.getNavigationLinks()); + } + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } + if (src.hasResponseCode()) { + tgt.setResponseCode(src.getResponseCode()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasValidateProfileId()) { + tgt.setValidateProfileId(src.getValidateProfileId()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasWarningOnly()) { + tgt.setWarningOnly(src.getWarningOnly()); + } return tgt; } @@ -238,8 +310,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -248,8 +324,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -258,20 +338,48 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); - tgt.setResource(src.getResource()); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setDestination(src.getDestination()); - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - tgt.setParams(src.getParams()); - for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - tgt.setResponseId(src.getResponseId()); - tgt.setSourceId(src.getSourceId()); - tgt.setTargetId(src.getTargetId()); - tgt.setUrl(src.getUrl()); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasEncodeRequestUrl()) { + tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); + } + if (src.hasParams()) { + tgt.setParams(src.getParams()); + } + if (src.hasRequestHeader()) { + for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasResponseId()) { + tgt.setResponseId(src.getResponseId()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasTargetId()) { + tgt.setTargetId(src.getTargetId()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -280,20 +388,48 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); - tgt.setResource(src.getResource()); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setDestination(src.getDestination()); - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - tgt.setParams(src.getParams()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - tgt.setResponseId(src.getResponseId()); - tgt.setSourceId(src.getSourceId()); - tgt.setTargetId(src.getTargetId()); - tgt.setUrl(src.getUrl()); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_30.convertCoding(src.getType())); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasEncodeRequestUrl()) { + tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); + } + if (src.hasParams()) { + tgt.setParams(src.getParams()); + } + if (src.hasRequestHeader()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasResponseId()) { + tgt.setResponseId(src.getResponseId()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasTargetId()) { + tgt.setTargetId(src.getTargetId()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -302,8 +438,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -312,8 +452,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -322,7 +466,9 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -331,7 +477,9 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -340,8 +488,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestActionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -350,8 +502,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -360,30 +516,66 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript tgt = new org.hl7.fhir.dstu2.model.TestScript(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -392,31 +584,65 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript tgt = new org.hl7.fhir.dstu3.model.TestScript(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_30.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -425,8 +651,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -435,8 +665,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -445,9 +679,15 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAutocreate(src.getAutocreate()); - tgt.setAutodelete(src.getAutodelete()); - tgt.setResource(VersionConvertor_10_30.convertReference(src.getResource())); + if (src.hasAutocreate()) { + tgt.setAutocreate(src.getAutocreate()); + } + if (src.hasAutodelete()) { + tgt.setAutodelete(src.getAutodelete()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_30.convertReference(src.getResource())); + } return tgt; } @@ -456,9 +696,15 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setAutocreate(src.getAutocreate()); - tgt.setAutodelete(src.getAutodelete()); - tgt.setResource(VersionConvertor_10_30.convertReference(src.getResource())); + if (src.hasAutocreate()) { + tgt.setAutocreate(src.getAutocreate()); + } + if (src.hasAutodelete()) { + tgt.setAutodelete(src.getAutodelete()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_30.convertReference(src.getResource())); + } return tgt; } @@ -467,12 +713,24 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setRequired(src.getRequired()); - tgt.setValidated(src.getValidated()); - tgt.setDescription(src.getDescription()); - tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setConformance(VersionConvertor_10_30.convertReference(src.getCapabilities())); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasValidated()) { + tgt.setValidated(src.getValidated()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasCapabilities()) { + tgt.setConformance(VersionConvertor_10_30.convertReference(src.getCapabilities())); + } return tgt; } @@ -481,12 +739,24 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setRequired(src.getRequired()); - tgt.setValidated(src.getValidated()); - tgt.setDescription(src.getDescription()); - tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setCapabilities(VersionConvertor_10_30.convertReference(src.getConformance())); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasValidated()) { + tgt.setValidated(src.getValidated()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasConformance()) { + tgt.setCapabilities(VersionConvertor_10_30.convertReference(src.getConformance())); + } return tgt; } @@ -495,8 +765,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -505,8 +779,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -515,8 +793,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setDescription(src.getDescription()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -525,8 +807,12 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setDescription(src.getDescription()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -535,7 +821,9 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -544,7 +832,9 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -553,7 +843,9 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -562,7 +854,9 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -571,9 +865,15 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -582,9 +882,15 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -593,10 +899,18 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setHeaderField(src.getHeaderField()); - tgt.setPath(src.getPath()); - tgt.setSourceId(src.getSourceId()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } return tgt; } @@ -605,10 +919,18 @@ public class TestScript10_30 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setHeaderField(src.getHeaderField()); - tgt.setPath(src.getPath()); - tgt.setSourceId(src.getSourceId()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ValueSet10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ValueSet10_30.java index 8025de030..46d783b98 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ValueSet10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/ValueSet10_30.java @@ -7,7 +7,6 @@ import org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode; import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.dstu3.terminologies.CodeSystemUtilities; import org.hl7.fhir.exceptions.FHIRException; - import java.util.List; public class ValueSet10_30 { @@ -17,9 +16,15 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -28,9 +33,15 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -39,9 +50,15 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_10_30.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasLanguage()) { + tgt.setLanguage(src.getLanguage()); + } + if (src.hasUse()) { + tgt.setUse(VersionConvertor_10_30.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -50,9 +67,15 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_10_30.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasLanguage()) { + tgt.setLanguage(src.getLanguage()); + } + if (src.hasUse()) { + tgt.setUse(VersionConvertor_10_30.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -61,10 +84,18 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -73,10 +104,18 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -85,9 +124,15 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -96,9 +141,15 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -149,59 +200,113 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet tgt = new org.hl7.fhir.dstu3.model.ValueSet(); VersionConvertor_10_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgt.setImmutable(src.getImmutable()); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setExtensible(src.getExtensible()); + if (src.hasImmutable()) { + tgt.setImmutable(src.getImmutable()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasExtensible()) { + tgt.setExtensible(src.getExtensible()); + } if (src.hasCompose()) { - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); - tgt.getCompose().setLockedDate(src.getLockedDate()); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } + if (src.hasLockedDate()) { + tgt.getCompose().setLockedDate(src.getLockedDate()); + } } if (src.hasCodeSystem() && advisor != null) { org.hl7.fhir.dstu3.model.CodeSystem tgtcs = new org.hl7.fhir.dstu3.model.CodeSystem(); VersionConvertor_10_30.copyDomainResource(src, tgtcs); - tgtcs.setUrl(src.getCodeSystem().getSystem()); - tgtcs.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); - tgtcs.setVersion(src.getCodeSystem().getVersion()); - tgtcs.setName(src.getName() + " Code System"); - tgtcs.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasCodeSystem()) { + tgtcs.setUrl(src.getCodeSystem().getSystem()); + } + if (src.hasIdentifier()) { + tgtcs.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasCodeSystem()) { + tgtcs.setVersion(src.getCodeSystem().getVersion()); + } + if (src.hasName()) { + tgtcs.setName(src.getName() + " Code System"); + } + if (src.hasStatus()) { + tgtcs.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgtcs.setExperimental(src.getExperimental()); - tgtcs.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgtcs.addContact(convertValueSetContactComponent(t)); + if (src.hasPublisher()) { + tgtcs.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgtcs.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgtcs.setDate(src.getDate()); - tgtcs.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgtcs.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgtcs.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgtcs.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - tgtcs.setPurpose(src.getRequirements()); - tgtcs.setCopyright(src.getCopyright()); + if (src.hasRequirements()) { + tgtcs.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgtcs.setCopyright(src.getCopyright()); + } tgtcs.setContent(CodeSystemContentMode.COMPLETE); - tgtcs.setCaseSensitive(src.getCodeSystem().getCaseSensitive()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs : src.getCodeSystem().getConcept()) processConcept(tgtcs.getConcept(), cs, tgtcs); + if (src.hasCodeSystem()) { + tgtcs.setCaseSensitive(src.getCodeSystem().getCaseSensitive()); + } + if (src.hasCodeSystem()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs : src.getCodeSystem().getConcept()) processConcept(tgtcs.getConcept(), cs, tgtcs); + } advisor.handleCodeSystem(tgtcs, tgt); tgt.setUserData("r2-cs", tgtcs); tgt.getCompose().addInclude().setSystem(tgtcs.getUrl()); } - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + if (src.hasExpansion()) { + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + } return tgt; } @@ -257,9 +362,15 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent(); VersionConvertor_10_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasImport()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); + } + if (src.hasInclude()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -273,7 +384,9 @@ public class ValueSet10_30 { if (noSystem == null || !t.getSystem().equals(noSystem)) tgt.addInclude(convertConceptSetComponent(t)); } - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasExclude()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -282,8 +395,12 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -292,8 +409,12 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); + } return tgt; } @@ -302,12 +423,24 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); - tgt.setTotal(src.getTotal()); - tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasTotal()) { + tgt.setTotal(src.getTotal()); + } + if (src.hasOffset()) { + tgt.setOffset(src.getOffset()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -316,12 +449,24 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); - tgt.setTotal(src.getTotal()); - tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasTotal()) { + tgt.setTotal(src.getTotal()); + } + if (src.hasOffset()) { + tgt.setOffset(src.getOffset()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -330,12 +475,24 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setAbstract(src.getAbstract()); - tgt.setVersion(src.getVersion()); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -344,12 +501,24 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setAbstract(src.getAbstract()); - tgt.setVersion(src.getVersion()); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -358,8 +527,12 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } return tgt; } @@ -368,8 +541,12 @@ public class ValueSet10_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_10_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Appointment10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Appointment10_40.java index e94249ad5..2a84bf10a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Appointment10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Appointment10_40.java @@ -10,18 +10,38 @@ public class Appointment10_40 { return null; org.hl7.fhir.r4.model.Appointment tgt = new org.hl7.fhir.r4.model.Appointment(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertAppointmentStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + } if (src.hasType()) tgt.addServiceType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setPriority(src.getPriority()); - tgt.setDescription(src.getDescription()); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_40.convertReference(t)); - tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + if (src.hasPriority()) { + tgt.setPriority(src.getPriority()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasMinutesDuration()) { + tgt.setMinutesDuration(src.getMinutesDuration()); + } + if (src.hasSlot()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } return tgt; } @@ -30,17 +50,39 @@ public class Appointment10_40 { return null; org.hl7.fhir.dstu2.model.Appointment tgt = new org.hl7.fhir.dstu2.model.Appointment(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertAppointmentStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPriority(src.getPriority()); - tgt.setDescription(src.getDescription()); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.r4.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_40.convertReference(t)); - tgt.setComment(src.getComment()); - for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(src.getPriority()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasMinutesDuration()) { + tgt.setMinutesDuration(src.getMinutesDuration()); + } + if (src.hasSlot()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } return tgt; } @@ -49,10 +91,18 @@ public class Appointment10_40 { return null; org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); - tgt.setRequired(convertParticipantRequired(src.getRequired())); - tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); + } + if (src.hasRequired()) { + tgt.setRequired(convertParticipantRequired(src.getRequired())); + } + if (src.hasStatus()) { + tgt.setStatus(convertParticipationStatus(src.getStatus())); + } return tgt; } @@ -61,10 +111,18 @@ public class Appointment10_40 { return null; org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); - tgt.setRequired(convertParticipantRequired(src.getRequired())); - tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); + } + if (src.hasRequired()) { + tgt.setRequired(convertParticipantRequired(src.getRequired())); + } + if (src.hasStatus()) { + tgt.setStatus(convertParticipationStatus(src.getStatus())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AppointmentResponse10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AppointmentResponse10_40.java index d1dee035e..ca7369cf1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AppointmentResponse10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AppointmentResponse10_40.java @@ -10,14 +10,30 @@ public class AppointmentResponse10_40 { return null; org.hl7.fhir.r4.model.AppointmentResponse tgt = new org.hl7.fhir.r4.model.AppointmentResponse(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setAppointment(VersionConvertor_10_40.convertReference(src.getAppointment())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_40.convertReference(src.getAppointment())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasParticipantType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); + } + if (src.hasParticipantStatus()) { + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -26,14 +42,30 @@ public class AppointmentResponse10_40 { return null; org.hl7.fhir.dstu2.model.AppointmentResponse tgt = new org.hl7.fhir.dstu2.model.AppointmentResponse(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setAppointment(VersionConvertor_10_40.convertReference(src.getAppointment())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_40.convertReference(src.getAppointment())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasParticipantType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_40.convertReference(src.getActor())); + } + if (src.hasParticipantStatus()) { + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AuditEvent10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AuditEvent10_40.java index 78a80899f..0cab2fff0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AuditEvent10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/AuditEvent10_40.java @@ -11,17 +11,37 @@ public class AuditEvent10_40 { org.hl7.fhir.r4.model.AuditEvent tgt = new org.hl7.fhir.r4.model.AuditEvent(); VersionConvertor_10_40.copyDomainResource(src, tgt); if (src.hasEvent()) { - tgt.setType(VersionConvertor_10_40.convertCoding(src.getEvent().getType())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(VersionConvertor_10_40.convertCoding(t)); - tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); - tgt.setRecorded(src.getEvent().getDateTime()); - tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); - tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(VersionConvertor_10_40.convertCoding(t)); + if (src.hasEvent()) { + tgt.setType(VersionConvertor_10_40.convertCoding(src.getEvent().getType())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasEvent()) { + tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); + } + if (src.hasEvent()) { + tgt.setRecorded(src.getEvent().getDateTime()); + } + if (src.hasEvent()) { + tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); + } + if (src.hasEvent()) { + tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(VersionConvertor_10_40.convertCoding(t)); + } + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) { + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + } + if (src.hasObject()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t)); } - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t)); - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t)); return tgt; } @@ -30,16 +50,36 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.dstu2.model.AuditEvent tgt = new org.hl7.fhir.dstu2.model.AuditEvent(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.getEvent().setType(VersionConvertor_10_40.convertCoding(src.getType())); - for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(VersionConvertor_10_40.convertCoding(t)); - tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); - tgt.getEvent().setDateTime(src.getRecorded()); - tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); - tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.r4.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(VersionConvertor_10_40.convertCoding(cc)); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t)); - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t)); + if (src.hasType()) { + tgt.getEvent().setType(VersionConvertor_10_40.convertCoding(src.getType())); + } + if (src.hasSubtype()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasAction()) { + tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); + } + if (src.hasRecorded()) { + tgt.getEvent().setDateTime(src.getRecorded()); + } + if (src.hasOutcome()) { + tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); + } + if (src.hasOutcomeDesc()) { + tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); + } + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.r4.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(VersionConvertor_10_40.convertCoding(cc)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) { + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + } + if (src.hasEntity()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t)); + } return tgt; } @@ -86,18 +126,38 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setWho(VersionConvertor_10_40.convertReference(src.getReference())); + if (src.hasRole()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasReference()) { + tgt.setWho(VersionConvertor_10_40.convertReference(src.getReference())); + } if (src.hasUserId()) tgt.getWho().setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getUserId())); - tgt.setAltId(src.getAltId()); - tgt.setName(src.getName()); - tgt.setRequestor(src.getRequestor()); - tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - tgt.setMedia(VersionConvertor_10_40.convertCoding(src.getMedia())); - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(VersionConvertor_10_40.convertCoding(t)); + if (src.hasAltId()) { + tgt.setAltId(src.getAltId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRequestor()) { + tgt.setRequestor(src.getRequestor()); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasMedia()) { + tgt.setMedia(VersionConvertor_10_40.convertCoding(src.getMedia())); + } + if (src.hasNetwork()) { + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + } + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(VersionConvertor_10_40.convertCoding(t)); + } return tgt; } @@ -106,21 +166,39 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_40.convertCodeableConcept(t)); + if (src.hasRole()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_40.convertCodeableConcept(t)); + } if (src.hasWho()) { if (src.getWho().hasIdentifier()) tgt.setUserId(VersionConvertor_10_40.convertIdentifier(src.getWho().getIdentifier())); if (src.getWho().hasReference() || src.getWho().hasDisplay() || src.getWho().hasExtension() || src.getWho().hasId()) tgt.setReference(VersionConvertor_10_40.convertReference(src.getWho())); } - tgt.setAltId(src.getAltId()); - tgt.setName(src.getName()); - tgt.setRequestor(src.getRequestor()); - tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - tgt.setMedia(VersionConvertor_10_40.convertCoding(src.getMedia())); - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.r4.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(VersionConvertor_10_40.convertCoding(cc)); + if (src.hasAltId()) { + tgt.setAltId(src.getAltId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRequestor()) { + tgt.setRequestor(src.getRequestor()); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasMedia()) { + tgt.setMedia(VersionConvertor_10_40.convertCoding(src.getMedia())); + } + if (src.hasNetwork()) { + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + } + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.r4.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(VersionConvertor_10_40.convertCoding(cc)); + } return tgt; } @@ -129,8 +207,12 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAddress(src.getAddress()); - tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } + if (src.hasType()) { + tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + } return tgt; } @@ -139,8 +221,12 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAddress(src.getAddress()); - tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } + if (src.hasType()) { + tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + } return tgt; } @@ -153,14 +239,30 @@ public class AuditEvent10_40 { tgt.getWhat().setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); if (src.hasReference()) tgt.setWhat(VersionConvertor_10_40.convertReference(src.getReference())); - tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); - tgt.setRole(VersionConvertor_10_40.convertCoding(src.getRole())); - tgt.setLifecycle(VersionConvertor_10_40.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCoding(t)); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_40.convertCoding(src.getRole())); + } + if (src.hasLifecycle()) { + tgt.setLifecycle(VersionConvertor_10_40.convertCoding(src.getLifecycle())); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasQuery()) { + tgt.setQuery(src.getQuery()); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -175,14 +277,30 @@ public class AuditEvent10_40 { if (src.getWhat().hasReference() || src.getWhat().hasDisplay() || src.getWhat().hasExtension() || src.getWhat().hasId()) tgt.setReference(VersionConvertor_10_40.convertReference(src.getWhat())); } - tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); - tgt.setRole(VersionConvertor_10_40.convertCoding(src.getRole())); - tgt.setLifecycle(VersionConvertor_10_40.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCoding(t)); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_40.convertCoding(src.getRole())); + } + if (src.hasLifecycle()) { + tgt.setLifecycle(VersionConvertor_10_40.convertCoding(src.getLifecycle())); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasQuery()) { + tgt.setQuery(src.getQuery()); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -191,7 +309,9 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } if (src.hasValueStringType()) tgt.setValue(src.getValueStringType().getValue().getBytes()); else if (src.hasValueBase64BinaryType()) @@ -204,7 +324,9 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } if (src.hasValue()) tgt.setValue(new org.hl7.fhir.r4.model.Base64BinaryType(src.getValue())); return tgt; @@ -287,10 +409,14 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSite(src.getSite()); + if (src.hasSite()) { + tgt.setSite(src.getSite()); + } if (src.hasIdentifier()) tgt.getObserver().setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCoding(t)); + } return tgt; } @@ -299,10 +425,14 @@ public class AuditEvent10_40 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSite(src.getSite()); + if (src.hasSite()) { + tgt.setSite(src.getSite()); + } if (src.hasObserver()) tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getObserver().getIdentifier())); - for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCoding(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Basic10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Basic10_40.java index bea50dcdd..ea884792b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Basic10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Basic10_40.java @@ -10,11 +10,21 @@ public class Basic10_40 { return null; org.hl7.fhir.r4.model.Basic tgt = new org.hl7.fhir.r4.model.Basic(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setCreated(src.getCreated()); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } return tgt; } @@ -23,11 +33,21 @@ public class Basic10_40 { return null; org.hl7.fhir.dstu2.model.Basic tgt = new org.hl7.fhir.dstu2.model.Basic(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setCreated(src.getCreated()); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Binary10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Binary10_40.java index 4aac9327f..96be11d7d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Binary10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Binary10_40.java @@ -10,7 +10,9 @@ public class Binary10_40 { return null; org.hl7.fhir.dstu2.model.Binary tgt = new org.hl7.fhir.dstu2.model.Binary(); VersionConvertor_10_40.copyResource(src, tgt); - tgt.setContentType(src.getContentType()); + if (src.hasContentType()) { + tgt.setContentType(src.getContentType()); + } tgt.setContent(src.getContent()); return tgt; } @@ -20,8 +22,12 @@ public class Binary10_40 { return null; org.hl7.fhir.r4.model.Binary tgt = new org.hl7.fhir.r4.model.Binary(); VersionConvertor_10_40.copyResource(src, tgt); - tgt.setContentType(src.getContentType()); - tgt.setContent(src.getContent()); + if (src.hasContentType()) { + tgt.setContentType(src.getContentType()); + } + if (src.hasContent()) { + tgt.setContent(src.getContent()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40.java index 865d641ff..436ce1764 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40.java @@ -11,12 +11,20 @@ public class Bundle10_40 { return null; org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); VersionConvertor_10_40.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_10_40.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_10_40.convertSignature(src.getSignature())); + } return tgt; } @@ -25,11 +33,17 @@ public class Bundle10_40 { return null; org.hl7.fhir.dstu2.model.Bundle tgt = new org.hl7.fhir.dstu2.model.Bundle(); VersionConvertor_10_40.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t, advisor)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t, advisor)); + } if (src.hasSignature()) tgt.setSignature(VersionConvertor_10_40.convertSignature(src.getSignature())); return tgt; @@ -44,12 +58,24 @@ public class Bundle10_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_10_40.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasFullUrl()) { + tgt.setFullUrl(src.getFullUrl()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_40.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -84,12 +110,24 @@ public class Bundle10_40 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); - tgt.setIfNoneMatch(src.getIfNoneMatch()); - tgt.setIfModifiedSince(src.getIfModifiedSince()); - tgt.setIfMatch(src.getIfMatch()); - tgt.setIfNoneExist(src.getIfNoneExist()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIfNoneMatch()) { + tgt.setIfNoneMatch(src.getIfNoneMatch()); + } + if (src.hasIfModifiedSince()) { + tgt.setIfModifiedSince(src.getIfModifiedSince()); + } + if (src.hasIfMatch()) { + tgt.setIfMatch(src.getIfMatch()); + } + if (src.hasIfNoneExist()) { + tgt.setIfNoneExist(src.getIfNoneExist()); + } return tgt; } @@ -98,12 +136,24 @@ public class Bundle10_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); - tgt.setIfNoneMatch(src.getIfNoneMatch()); - tgt.setIfModifiedSince(src.getIfModifiedSince()); - tgt.setIfMatch(src.getIfMatch()); - tgt.setIfNoneExist(src.getIfNoneExist()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIfNoneMatch()) { + tgt.setIfNoneMatch(src.getIfNoneMatch()); + } + if (src.hasIfModifiedSince()) { + tgt.setIfModifiedSince(src.getIfModifiedSince()); + } + if (src.hasIfMatch()) { + tgt.setIfMatch(src.getIfMatch()); + } + if (src.hasIfNoneExist()) { + tgt.setIfNoneExist(src.getIfNoneExist()); + } return tgt; } @@ -112,10 +162,18 @@ public class Bundle10_40 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); - tgt.setLocation(src.getLocation()); - tgt.setEtag(src.getEtag()); - tgt.setLastModified(src.getLastModified()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } + if (src.hasLocation()) { + tgt.setLocation(src.getLocation()); + } + if (src.hasEtag()) { + tgt.setEtag(src.getEtag()); + } + if (src.hasLastModified()) { + tgt.setLastModified(src.getLastModified()); + } return tgt; } @@ -124,10 +182,18 @@ public class Bundle10_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); - tgt.setLocation(src.getLocation()); - tgt.setEtag(src.getEtag()); - tgt.setLastModified(src.getLastModified()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } + if (src.hasLocation()) { + tgt.setLocation(src.getLocation()); + } + if (src.hasEtag()) { + tgt.setEtag(src.getEtag()); + } + if (src.hasLastModified()) { + tgt.setLastModified(src.getLastModified()); + } return tgt; } @@ -136,8 +202,12 @@ public class Bundle10_40 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); - tgt.setScore(src.getScore()); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } + if (src.hasScore()) { + tgt.setScore(src.getScore()); + } return tgt; } @@ -146,8 +216,12 @@ public class Bundle10_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); - tgt.setScore(src.getScore()); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } + if (src.hasScore()) { + tgt.setScore(src.getScore()); + } return tgt; } @@ -156,8 +230,12 @@ public class Bundle10_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -166,8 +244,12 @@ public class Bundle10_40 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CarePlan10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CarePlan10_40.java index 34f5aefb1..7ff2ff587 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CarePlan10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CarePlan10_40.java @@ -10,20 +10,40 @@ public class CarePlan10_40 { return null; org.hl7.fhir.r4.model.CarePlan tgt = new org.hl7.fhir.r4.model.CarePlan(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getContext())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getContext())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) if (!tgt.hasAuthor()) tgt.setAuthor(VersionConvertor_10_40.convertReference(t)); else tgt.addContributor(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } return tgt; } @@ -32,19 +52,41 @@ public class CarePlan10_40 { return null; org.hl7.fhir.dstu2.model.CarePlan tgt = new org.hl7.fhir.dstu2.model.CarePlan(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - tgt.setContext(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } if (src.hasAuthor()) tgt.addAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - for (org.hl7.fhir.r4.model.Reference t : src.getContributor()) tgt.addAuthor(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + if (src.hasContributor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getContributor()) tgt.addAuthor(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAddresses()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } return tgt; } @@ -53,9 +95,15 @@ public class CarePlan10_40 { return null; org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_40.convertAnnotation(t)); - tgt.setReference(VersionConvertor_10_40.convertReference(src.getReference())); - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasProgress()) { + for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_40.convertAnnotation(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_40.convertReference(src.getReference())); + } + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } return tgt; } @@ -64,9 +112,15 @@ public class CarePlan10_40 { return null; org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_40.convertAnnotation(t)); - tgt.setReference(VersionConvertor_10_40.convertReference(src.getReference())); - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasProgress()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_40.convertAnnotation(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_40.convertReference(src.getReference())); + } + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } return tgt; } @@ -75,19 +129,45 @@ public class CarePlan10_40 { return null; org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - tgt.setProhibited(src.getDoNotPerform()); - tgt.setScheduled(VersionConvertor_10_40.convertType(src.getScheduled())); - tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); - tgt.setProduct(VersionConvertor_10_40.convertType(src.getProduct())); - tgt.setDailyAmount(VersionConvertor_10_40.convertSimpleQuantity(src.getDailyAmount())); - tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } + if (src.hasDoNotPerform()) { + tgt.setProhibited(src.getDoNotPerform()); + } + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_10_40.convertType(src.getScheduled())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_10_40.convertType(src.getProduct())); + } + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_10_40.convertSimpleQuantity(src.getDailyAmount())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -96,19 +176,45 @@ public class CarePlan10_40 { return null; org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - tgt.setDoNotPerform(src.getProhibited()); - tgt.setScheduled(VersionConvertor_10_40.convertType(src.getScheduled())); - tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); - tgt.setProduct(VersionConvertor_10_40.convertType(src.getProduct())); - tgt.setDailyAmount(VersionConvertor_10_40.convertSimpleQuantity(src.getDailyAmount())); - tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } + if (src.hasProhibited()) { + tgt.setDoNotPerform(src.getProhibited()); + } + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_10_40.convertType(src.getScheduled())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_10_40.convertType(src.getProduct())); + } + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_10_40.convertSimpleQuantity(src.getDailyAmount())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Communication10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Communication10_40.java index 23958db94..1f40a23b9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Communication10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Communication10_40.java @@ -10,18 +10,42 @@ public class Communication10_40 { return null; org.hl7.fhir.r4.model.Communication tgt = new org.hl7.fhir.r4.model.Communication(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); - tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setSent(src.getSent()); - tgt.setReceived(src.getReceived()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasSent()) { + tgt.setSent(src.getSent()); + } + if (src.hasReceived()) { + tgt.setReceived(src.getReceived()); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } return tgt; } @@ -30,18 +54,42 @@ public class Communication10_40 { return null; org.hl7.fhir.dstu2.model.Communication tgt = new org.hl7.fhir.dstu2.model.Communication(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); - for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setSent(src.getSent()); - tgt.setReceived(src.getReceived()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasSent()) { + tgt.setSent(src.getSent()); + } + if (src.hasReceived()) { + tgt.setReceived(src.getReceived()); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } return tgt; } @@ -50,7 +98,9 @@ public class Communication10_40 { return null; org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + } return tgt; } @@ -59,7 +109,9 @@ public class Communication10_40 { return null; org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CommunicationRequest10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CommunicationRequest10_40.java index e5bc3a96e..f58e1d575 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CommunicationRequest10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/CommunicationRequest10_40.java @@ -10,20 +10,48 @@ public class CommunicationRequest10_40 { return null; org.hl7.fhir.dstu2.model.CommunicationRequest tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); - for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setRequester(VersionConvertor_10_40.convertReference(src.getRequester())); - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setScheduled(VersionConvertor_10_40.convertType(src.getOccurrence())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setRequestedOn(src.getAuthoredOn()); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setPriority(convertPriorityCode(src.getPriority())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasRequester()) { + tgt.setRequester(VersionConvertor_10_40.convertReference(src.getRequester())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasOccurrence()) { + tgt.setScheduled(VersionConvertor_10_40.convertType(src.getOccurrence())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasAuthoredOn()) { + tgt.setRequestedOn(src.getAuthoredOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasPriority()) { + tgt.setPriority(convertPriorityCode(src.getPriority())); + } return tgt; } @@ -32,20 +60,48 @@ public class CommunicationRequest10_40 { return null; org.hl7.fhir.r4.model.CommunicationRequest tgt = new org.hl7.fhir.r4.model.CommunicationRequest(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); - tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setRequester(VersionConvertor_10_40.convertReference(src.getRequester())); - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setOccurrence(VersionConvertor_10_40.convertType(src.getScheduled())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setAuthoredOn(src.getRequestedOn()); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setPriority(convertPriorityCode(src.getPriority())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_40.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasRequester()) { + tgt.setRequester(VersionConvertor_10_40.convertReference(src.getRequester())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasScheduled()) { + tgt.setOccurrence(VersionConvertor_10_40.convertType(src.getScheduled())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasRequestedOn()) { + tgt.setAuthoredOn(src.getRequestedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasPriority()) { + tgt.setPriority(convertPriorityCode(src.getPriority())); + } return tgt; } @@ -54,7 +110,9 @@ public class CommunicationRequest10_40 { return null; org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + } return tgt; } @@ -63,7 +121,9 @@ public class CommunicationRequest10_40 { return null; org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_40.convertType(src.getContent())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Composition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Composition10_40.java index d9a1c7f7e..974287ee4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Composition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Composition10_40.java @@ -10,22 +10,46 @@ public class Composition10_40 { return null; org.hl7.fhir.dstu2.model.Composition tgt = new org.hl7.fhir.dstu2.model.Composition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } if (src.hasCategory()) tgt.setClass_(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setTitle(src.getTitle()); - tgt.setStatus(convertCompositionStatus(src.getStatus())); - tgt.setConfidentiality(src.getConfidentiality().toCode()); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); - tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); - for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(convertCompositionStatus(src.getStatus())); + } + if (src.hasConfidentiality()) { + tgt.setConfidentiality(src.getConfidentiality().toCode()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasAttester()) { + for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasSection()) { + for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -34,25 +58,51 @@ public class Composition10_40 { return null; org.hl7.fhir.r4.model.Composition tgt = new org.hl7.fhir.r4.model.Composition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getClass_())); - tgt.setTitle(src.getTitle()); - tgt.setStatus(convertCompositionStatus(src.getStatus())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getClass_())); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(convertCompositionStatus(src.getStatus())); + } try { - tgt.setConfidentiality(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.fromCode(src.getConfidentiality())); + if (src.hasConfidentiality()) { + tgt.setConfidentiality(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.fromCode(src.getConfidentiality())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); - tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasAttester()) { + for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -97,8 +147,12 @@ public class Composition10_40 { VersionConvertor_10_40.copyElement(src, tgt); if (src.hasMode()) tgt.addMode(convertCompositionAttestationMode(src.getMode())); - tgt.setTime(src.getTime()); - tgt.setParty(VersionConvertor_10_40.convertReference(src.getParty())); + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_40.convertReference(src.getParty())); + } return tgt; } @@ -109,8 +163,12 @@ public class Composition10_40 { VersionConvertor_10_40.copyElement(src, tgt); if (src.hasMode()) tgt.setMode(convertCompositionAttestationMode(src.getMode().get(0).getValue())); - tgt.setTime(src.getTime()); - tgt.setParty(VersionConvertor_10_40.convertReference(src.getParty())); + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_40.convertReference(src.getParty())); + } return tgt; } @@ -119,9 +177,15 @@ public class Composition10_40 { return null; org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -130,9 +194,15 @@ public class Composition10_40 { return null; org.hl7.fhir.r4.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionEventComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -175,18 +245,34 @@ public class Composition10_40 { return null; org.hl7.fhir.r4.model.Composition.SectionComponent tgt = new org.hl7.fhir.r4.model.Composition.SectionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setText(VersionConvertor_10_40.convertNarrative(src.getText())); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasText()) { + tgt.setText(VersionConvertor_10_40.convertNarrative(src.getText())); + } try { - tgt.setMode(org.hl7.fhir.r4.model.Composition.SectionMode.fromCode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(org.hl7.fhir.r4.model.Composition.SectionMode.fromCode(src.getMode())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_40.convertReference(t)); - tgt.setEmptyReason(VersionConvertor_10_40.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasEmptyReason()) { + tgt.setEmptyReason(VersionConvertor_10_40.convertCodeableConcept(src.getEmptyReason())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -195,14 +281,30 @@ public class Composition10_40 { return null; org.hl7.fhir.dstu2.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu2.model.Composition.SectionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setText(VersionConvertor_10_40.convertNarrative(src.getText())); - tgt.setMode(src.getMode().toCode()); - tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r4.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_40.convertReference(t)); - tgt.setEmptyReason(VersionConvertor_10_40.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasText()) { + tgt.setText(VersionConvertor_10_40.convertNarrative(src.getText())); + } + if (src.hasMode()) { + tgt.setMode(src.getMode().toCode()); + } + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasEmptyReason()) { + tgt.setEmptyReason(VersionConvertor_10_40.convertCodeableConcept(src.getEmptyReason())); + } + if (src.hasSection()) { + for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ConceptMap10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ConceptMap10_40.java index e3eb4619e..514539dc6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ConceptMap10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ConceptMap10_40.java @@ -5,7 +5,6 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CanonicalType; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent; - import java.util.ArrayList; import java.util.List; @@ -50,26 +49,54 @@ public class ConceptMap10_40 { return null; org.hl7.fhir.dstu2.model.ConceptMap tgt = new org.hl7.fhir.dstu2.model.ConceptMap(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setSource(VersionConvertor_10_40.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_10_40.convertType(src.getTarget())); - for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_40.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_40.convertType(src.getTarget())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } return tgt; } @@ -78,8 +105,12 @@ public class ConceptMap10_40 { return null; org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -88,8 +119,12 @@ public class ConceptMap10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -152,9 +187,15 @@ public class ConceptMap10_40 { return null; org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setProperty(src.getElement()); - tgt.setSystem(src.getCodeSystem()); - tgt.setValue(src.getCode()); + if (src.hasElement()) { + tgt.setProperty(src.getElement()); + } + if (src.hasCodeSystem()) { + tgt.setSystem(src.getCodeSystem()); + } + if (src.hasCode()) { + tgt.setValue(src.getCode()); + } return tgt; } @@ -163,9 +204,15 @@ public class ConceptMap10_40 { return null; org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setElement(src.getProperty()); - tgt.setCodeSystem(src.getSystem()); - tgt.setCode(src.getValue()); + if (src.hasProperty()) { + tgt.setElement(src.getProperty()); + } + if (src.hasSystem()) { + tgt.setCodeSystem(src.getSystem()); + } + if (src.hasValue()) { + tgt.setCode(src.getValue()); + } return tgt; } @@ -176,9 +223,13 @@ public class ConceptMap10_40 { for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) { org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } tgt.addTarget(convertTargetElementComponent(t)); - res.add(new VersionConvertor_10_40.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem())); + if (src.hasCodeSystem()) { + res.add(new VersionConvertor_10_40.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem())); + } } return res; } @@ -189,8 +240,12 @@ public class ConceptMap10_40 { org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent(); VersionConvertor_10_40.copyElement(src, tgt); tgt.setCodeSystem(g.getSource()); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + } return tgt; } @@ -200,11 +255,21 @@ public class ConceptMap10_40 { org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent(); VersionConvertor_10_40.copyElement(src, tgt); tgt.setCodeSystem(g.getTarget()); - tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); - tgt.setComments(src.getComment()); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -213,11 +278,21 @@ public class ConceptMap10_40 { return null; org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); - tgt.setComment(src.getComments()); - for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Condition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Condition10_40.java index 1f1141ab9..b3691aed3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Condition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Condition10_40.java @@ -10,23 +10,49 @@ public class Condition10_40 { return null; org.hl7.fhir.dstu2.model.Condition tgt = new org.hl7.fhir.dstu2.model.Condition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setAsserter(VersionConvertor_10_40.convertReference(src.getAsserter())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasAsserter()) { + tgt.setAsserter(VersionConvertor_10_40.convertReference(src.getAsserter())); + } if (src.hasRecordedDate()) tgt.setDateRecorded(src.getRecordedDate()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); - tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - tgt.setSeverity(VersionConvertor_10_40.convertCodeableConcept(src.getSeverity())); - tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); - tgt.setAbatement(VersionConvertor_10_40.convertType(src.getAbatement())); - tgt.setStage(convertConditionStageComponent(src.getStageFirstRep())); - for (org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_40.convertCodeableConcept(t)); + if (src.hasVerificationStatus()) { + tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); + } + if (src.hasSeverity()) { + tgt.setSeverity(VersionConvertor_10_40.convertCodeableConcept(src.getSeverity())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); + } + if (src.hasAbatement()) { + tgt.setAbatement(VersionConvertor_10_40.convertType(src.getAbatement())); + } + if (src.hasStage()) { + tgt.setStage(convertConditionStageComponent(src.getStageFirstRep())); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_40.convertCodeableConcept(t)); + } return tgt; } @@ -35,23 +61,49 @@ public class Condition10_40 { return null; org.hl7.fhir.r4.model.Condition tgt = new org.hl7.fhir.r4.model.Condition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setAsserter(VersionConvertor_10_40.convertReference(src.getAsserter())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasAsserter()) { + tgt.setAsserter(VersionConvertor_10_40.convertReference(src.getAsserter())); + } if (src.hasDateRecorded()) tgt.setRecordedDate(src.getDateRecorded()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); - tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - tgt.setSeverity(VersionConvertor_10_40.convertCodeableConcept(src.getSeverity())); - tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); - tgt.setAbatement(VersionConvertor_10_40.convertType(src.getAbatement())); - tgt.addStage(convertConditionStageComponent(src.getStage())); - for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_40.convertCodeableConcept(t)); + if (src.hasVerificationStatus()) { + tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); + } + if (src.hasSeverity()) { + tgt.setSeverity(VersionConvertor_10_40.convertCodeableConcept(src.getSeverity())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); + } + if (src.hasAbatement()) { + tgt.setAbatement(VersionConvertor_10_40.convertType(src.getAbatement())); + } + if (src.hasStage()) { + tgt.addStage(convertConditionStageComponent(src.getStage())); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_40.convertCodeableConcept(t)); + } return tgt; } @@ -78,8 +130,12 @@ public class Condition10_40 { return null; org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.addCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + if (src.hasCode()) { + tgt.addCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -88,8 +144,12 @@ public class Condition10_40 { return null; org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept cc : src.getCode()) tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(cc)); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept cc : src.getCode()) tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(cc)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -98,8 +158,12 @@ public class Condition10_40 { return null; org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSummary(VersionConvertor_10_40.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.r4.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_40.convertReference(t)); + if (src.hasSummary()) { + tgt.setSummary(VersionConvertor_10_40.convertCodeableConcept(src.getSummary())); + } + if (src.hasAssessment()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -108,8 +172,12 @@ public class Condition10_40 { return null; org.hl7.fhir.r4.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionStageComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSummary(VersionConvertor_10_40.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_40.convertReference(t)); + if (src.hasSummary()) { + tgt.setSummary(VersionConvertor_10_40.convertCodeableConcept(src.getSummary())); + } + if (src.hasAssessment()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Conformance10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Conformance10_40.java index 5f09050ea..61358a884 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Conformance10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Conformance10_40.java @@ -44,32 +44,64 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance tgt = new org.hl7.fhir.dstu2.model.Conformance(); VersionConvertor_10_40.copyDomainResource(src, tgt, "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } if (src.hasImplementation()) tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown")) tgt.setAcceptUnknown(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue())); - for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r4.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_10_40.convertCanonicalToReference(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r4.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_10_40.convertCanonicalToReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -78,29 +110,63 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement tgt = new org.hl7.fhir.r4.model.CapabilityStatement(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } if (src.hasAcceptUnknown()) tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue())); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -109,8 +175,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -119,8 +189,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -129,9 +203,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setProfileElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getProfile())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -140,9 +220,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_10_40.convertCanonicalToReference(src.getProfileElement())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_10_40.convertCanonicalToReference(src.getProfileElement())); + } return tgt; } @@ -151,8 +237,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setUrl(src.getUrl()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -161,8 +251,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setUrl(src.getUrl()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -171,9 +265,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); - tgt.setReliableCache(src.getReliableCache()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) { + tgt.setReliableCache(src.getReliableCache()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } for (org.hl7.fhir.r4.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) { org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent event = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent(); tgt.addEvent(event); @@ -201,9 +301,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); - tgt.setReliableCache(src.getReliableCache()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) { + tgt.setReliableCache(src.getReliableCache()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) { org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT); e.addExtension(new org.hl7.fhir.r4.model.Extension("code", VersionConvertor_10_40.convertCoding(t.getCode()))); @@ -232,8 +338,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_10_40.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_10_40.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -242,8 +352,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_10_40.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_10_40.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -252,16 +366,32 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } if (src.getTransactionMode() == org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH || src.getTransactionMode() == org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH) tgt.addInteraction().setCode(SystemRestfulInteraction.BATCH); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu2.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -270,10 +400,18 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } boolean batch = false; boolean transaction = false; for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) { @@ -288,9 +426,15 @@ public class Conformance10_40 { tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH); else tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.TRANSACTION : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.NOTSUPPORTED); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r4.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -299,8 +443,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinitionElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinitionElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getDefinition())); + } return tgt; } @@ -309,8 +457,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_10_40.convertCanonicalToReference(src.getDefinitionElement())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinitionElement()) { + tgt.setDefinition(VersionConvertor_10_40.convertCanonicalToReference(src.getDefinitionElement())); + } return tgt; } @@ -319,18 +471,42 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getProfile())); - for (org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - tgt.setReadHistory(src.getReadHistory()); - tgt.setUpdateCreate(src.getUpdateCreate()); - tgt.setConditionalCreate(src.getConditionalCreate()); - tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getProfile())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } + if (src.hasReadHistory()) { + tgt.setReadHistory(src.getReadHistory()); + } + if (src.hasUpdateCreate()) { + tgt.setUpdateCreate(src.getUpdateCreate()); + } + if (src.hasConditionalCreate()) { + tgt.setConditionalCreate(src.getConditionalCreate()); + } + if (src.hasConditionalUpdate()) { + tgt.setConditionalUpdate(src.getConditionalUpdate()); + } + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -339,19 +515,41 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } if (src.hasProfile()) tgt.setProfile(VersionConvertor_10_40.convertCanonicalToReference(src.getProfileElement())); - for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - tgt.setReadHistory(src.getReadHistory()); - tgt.setUpdateCreate(src.getUpdateCreate()); - tgt.setConditionalCreate(src.getConditionalCreate()); - tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasInteraction()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } + if (src.hasReadHistory()) { + tgt.setReadHistory(src.getReadHistory()); + } + if (src.hasUpdateCreate()) { + tgt.setUpdateCreate(src.getUpdateCreate()); + } + if (src.hasConditionalCreate()) { + tgt.setConditionalCreate(src.getConditionalCreate()); + } + if (src.hasConditionalUpdate()) { + tgt.setConditionalUpdate(src.getConditionalUpdate()); + } + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -360,10 +558,18 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(src.getDefinition()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -372,10 +578,18 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(src.getDefinition()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -384,9 +598,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCors(src.getCors()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); + if (src.hasCors()) { + tgt.setCors(src.getCors()); + } + if (src.hasService()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -395,9 +615,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); + if (src.hasCors()) { + tgt.setCors(src.getCors()); + } + if (src.hasService()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -406,9 +632,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setVersion(src.getVersion()); - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasReleaseDate()) { + tgt.setReleaseDate(src.getReleaseDate()); + } return tgt; } @@ -417,9 +649,15 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setVersion(src.getVersion()); - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasReleaseDate()) { + tgt.setReleaseDate(src.getReleaseDate()); + } return tgt; } @@ -484,8 +722,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -494,8 +736,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -560,8 +806,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -570,8 +820,12 @@ public class Conformance10_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DataElement10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DataElement10_40.java index f0f474f61..38d477356 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DataElement10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DataElement10_40.java @@ -4,7 +4,6 @@ import org.hl7.fhir.convertors.VersionConvertor_10_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule; - import java.util.ArrayList; import java.util.List; @@ -17,27 +16,45 @@ public class DataElement10_40 { VersionConvertor_10_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl().replace("/DataElement/", "/StructureDefinition/de-")); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_40.convertCodeableConceptToUsageContext(t)); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } List slicePaths = new ArrayList(); for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); - tgt.getSnapshot().addElement(VersionConvertor_10_40.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + tgt.getSnapshot().addElement(VersionConvertor_10_40.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + } } tgt.setKind(StructureDefinitionKind.COMPLEXTYPE); tgt.setAbstract(false); @@ -52,8 +69,12 @@ public class DataElement10_40 { return null; org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -62,8 +83,12 @@ public class DataElement10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -72,10 +97,18 @@ public class DataElement10_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComment(src.getComments()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DetectedIssue10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DetectedIssue10_40.java index 23fd559c9..a7816da8b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DetectedIssue10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DetectedIssue10_40.java @@ -10,17 +10,35 @@ public class DetectedIssue10_40 { return null; org.hl7.fhir.dstu2.model.DetectedIssue tgt = new org.hl7.fhir.dstu2.model.DetectedIssue(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - for (org.hl7.fhir.r4.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_40.convertReference(t)); - tgt.setDetail(src.getDetail()); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasCode()) { + tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSeverity()) { + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + } + if (src.hasImplicated()) { + for (org.hl7.fhir.r4.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasDetail()) { + tgt.setDetail(src.getDetail()); + } if (src.hasIdentifiedDateTimeType()) tgt.setDateElement(VersionConvertor_10_40.convertDateTime(src.getIdentifiedDateTimeType())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setReference(src.getReference()); - for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasReference()) { + tgt.setReference(src.getReference()); + } + if (src.hasMitigation()) { + for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -29,17 +47,35 @@ public class DetectedIssue10_40 { return null; org.hl7.fhir.r4.model.DetectedIssue tgt = new org.hl7.fhir.r4.model.DetectedIssue(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_40.convertReference(t)); - tgt.setDetail(src.getDetail()); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasCategory()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + } + if (src.hasSeverity()) { + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + } + if (src.hasImplicated()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasDetail()) { + tgt.setDetail(src.getDetail()); + } if (src.hasDate()) tgt.setIdentified(VersionConvertor_10_40.convertDateTime(src.getDateElement())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setReference(src.getReference()); - for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasReference()) { + tgt.setReference(src.getReference()); + } + if (src.hasMitigation()) { + for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -48,10 +84,14 @@ public class DetectedIssue10_40 { return null; org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_40.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_40.convertCodeableConcept(src.getAction())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } return tgt; } @@ -60,10 +100,14 @@ public class DetectedIssue10_40 { return null; org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_40.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_40.convertCodeableConcept(src.getAction())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceMetric10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceMetric10_40.java index 6723e1b60..867f2fd14 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceMetric10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceMetric10_40.java @@ -10,16 +10,36 @@ public class DeviceMetric10_40 { return null; org.hl7.fhir.r4.model.DeviceMetric tgt = new org.hl7.fhir.r4.model.DeviceMetric(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setUnit(VersionConvertor_10_40.convertCodeableConcept(src.getUnit())); - tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_40.convertReference(src.getParent())); - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - tgt.setColor(convertDeviceMetricColor(src.getColor())); - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - tgt.setMeasurementPeriod(VersionConvertor_10_40.convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasUnit()) { + tgt.setUnit(VersionConvertor_10_40.convertCodeableConcept(src.getUnit())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_40.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + } + if (src.hasColor()) { + tgt.setColor(convertDeviceMetricColor(src.getColor())); + } + if (src.hasCategory()) { + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + } + if (src.hasMeasurementPeriod()) { + tgt.setMeasurementPeriod(VersionConvertor_10_40.convertTiming(src.getMeasurementPeriod())); + } + if (src.hasCalibration()) { + for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } return tgt; } @@ -28,16 +48,36 @@ public class DeviceMetric10_40 { return null; org.hl7.fhir.dstu2.model.DeviceMetric tgt = new org.hl7.fhir.dstu2.model.DeviceMetric(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setUnit(VersionConvertor_10_40.convertCodeableConcept(src.getUnit())); - tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_40.convertReference(src.getParent())); - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - tgt.setColor(convertDeviceMetricColor(src.getColor())); - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - tgt.setMeasurementPeriod(VersionConvertor_10_40.convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasUnit()) { + tgt.setUnit(VersionConvertor_10_40.convertCodeableConcept(src.getUnit())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_40.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + } + if (src.hasColor()) { + tgt.setColor(convertDeviceMetricColor(src.getColor())); + } + if (src.hasCategory()) { + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + } + if (src.hasMeasurementPeriod()) { + tgt.setMeasurementPeriod(VersionConvertor_10_40.convertTiming(src.getMeasurementPeriod())); + } + if (src.hasCalibration()) { + for (org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } return tgt; } @@ -46,9 +86,15 @@ public class DeviceMetric10_40 { return null; org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - tgt.setTime(src.getTime()); + if (src.hasType()) { + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + } + if (src.hasState()) { + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } return tgt; } @@ -57,9 +103,15 @@ public class DeviceMetric10_40 { return null; org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - tgt.setTime(src.getTime()); + if (src.hasType()) { + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + } + if (src.hasState()) { + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceUseStatement10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceUseStatement10_40.java index 1729e2a80..7ed3171c1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceUseStatement10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DeviceUseStatement10_40.java @@ -11,14 +11,30 @@ public class DeviceUseStatement10_40 { return null; org.hl7.fhir.dstu2.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu2.model.DeviceUseStatement(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setBodySite(VersionConvertor_10_40.convertType(src.getBodySite())); - tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addIndication(VersionConvertor_10_40.convertCodeableConcept(t)); - for (Annotation t : src.getNote()) tgt.addNotes(t.getText()); - tgt.setRecordedOn(src.getRecordedOn()); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setTiming(VersionConvertor_10_40.convertType(src.getTiming())); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_40.convertType(src.getBodySite())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addIndication(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (Annotation t : src.getNote()) tgt.addNotes(t.getText()); + } + if (src.hasRecordedOn()) { + tgt.setRecordedOn(src.getRecordedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_40.convertType(src.getTiming())); + } return tgt; } @@ -29,13 +45,27 @@ public class DeviceUseStatement10_40 { VersionConvertor_10_40.copyDomainResource(src, tgt); if (src.hasBodySiteCodeableConcept()) tgt.setBodySite(VersionConvertor_10_40.convertCodeableConcept(src.getBodySiteCodeableConcept())); - tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue()); - tgt.setRecordedOn(src.getRecordedOn()); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setTiming(VersionConvertor_10_40.convertType(src.getTiming())); + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasIndication()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasNotes()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue()); + } + if (src.hasRecordedOn()) { + tgt.setRecordedOn(src.getRecordedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_40.convertType(src.getTiming())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DiagnosticReport10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DiagnosticReport10_40.java index 5af988242..535a930b0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DiagnosticReport10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DiagnosticReport10_40.java @@ -10,21 +10,51 @@ public class DiagnosticReport10_40 { return null; org.hl7.fhir.dstu2.model.DiagnosticReport tgt = new org.hl7.fhir.dstu2.model.DiagnosticReport(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); - tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_40.convertAttachment(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.r4.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.r4.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasMedia()) { + for (org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + } + if (src.hasConclusion()) { + tgt.setConclusion(src.getConclusion()); + } + if (src.hasConclusionCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_40.convertAttachment(t)); + } return tgt; } @@ -33,21 +63,51 @@ public class DiagnosticReport10_40 { return null; org.hl7.fhir.r4.model.DiagnosticReport tgt = new org.hl7.fhir.r4.model.DiagnosticReport(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); - tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_40.convertAttachment(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); + } + if (src.hasConclusion()) { + tgt.setConclusion(src.getConclusion()); + } + if (src.hasCodedDiagnosis()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_40.convertAttachment(t)); + } return tgt; } @@ -56,8 +116,12 @@ public class DiagnosticReport10_40 { return null; org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent tgt = new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setComment(src.getComment()); - tgt.setLink(VersionConvertor_10_40.convertReference(src.getLink())); + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasLink()) { + tgt.setLink(VersionConvertor_10_40.convertReference(src.getLink())); + } return tgt; } @@ -66,8 +130,12 @@ public class DiagnosticReport10_40 { return null; org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setComment(src.getComment()); - tgt.setLink(VersionConvertor_10_40.convertReference(src.getLink())); + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasLink()) { + tgt.setLink(VersionConvertor_10_40.convertReference(src.getLink())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DocumentReference10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DocumentReference10_40.java index 49ad16c3d..124e2eecc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DocumentReference10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/DocumentReference10_40.java @@ -45,21 +45,51 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.dstu2.model.DocumentReference tgt = new org.hl7.fhir.dstu2.model.DocumentReference(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_40.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setClass_(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); - tgt.setAuthenticator(VersionConvertor_10_40.convertReference(src.getAuthenticator())); - tgt.setCreated(src.getDate()); - tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); - tgt.setDocStatus(convertDocStatus(src.getDocStatus())); - for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_40.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasCategory()) { + tgt.setClass_(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); + } + if (src.hasAuthenticator()) { + tgt.setAuthenticator(VersionConvertor_10_40.convertReference(src.getAuthenticator())); + } + if (src.hasDate()) { + tgt.setCreated(src.getDate()); + } + if (src.hasStatus()) { + tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDocStatus()) { + tgt.setDocStatus(convertDocStatus(src.getDocStatus())); + } + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) { + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + } return tgt; } @@ -68,21 +98,51 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.r4.model.DocumentReference tgt = new org.hl7.fhir.r4.model.DocumentReference(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_40.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getClass_())); - tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); - tgt.setAuthenticator(VersionConvertor_10_40.convertReference(src.getAuthenticator())); - tgt.setDate(src.getCreated()); - tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); - tgt.setDocStatus(convertDocStatus(src.getDocStatus())); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_40.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getClass_())); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_40.convertReference(src.getCustodian())); + } + if (src.hasAuthenticator()) { + tgt.setAuthenticator(VersionConvertor_10_40.convertReference(src.getAuthenticator())); + } + if (src.hasCreated()) { + tgt.setDate(src.getCreated()); + } + if (src.hasStatus()) { + tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDocStatus()) { + tgt.setDocStatus(convertDocStatus(src.getDocStatus())); + } + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) { + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + } return tgt; } @@ -91,8 +151,12 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAttachment(VersionConvertor_10_40.convertAttachment(src.getAttachment())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getFormat()) tgt.setFormat(VersionConvertor_10_40.convertCoding(t)); + if (src.hasAttachment()) { + tgt.setAttachment(VersionConvertor_10_40.convertAttachment(src.getAttachment())); + } + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getFormat()) tgt.setFormat(VersionConvertor_10_40.convertCoding(t)); + } return tgt; } @@ -101,8 +165,12 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAttachment(VersionConvertor_10_40.convertAttachment(src.getAttachment())); - tgt.addFormat(VersionConvertor_10_40.convertCoding(src.getFormat())); + if (src.hasAttachment()) { + tgt.setAttachment(VersionConvertor_10_40.convertAttachment(src.getAttachment())); + } + if (src.hasFormat()) { + tgt.addFormat(VersionConvertor_10_40.convertCoding(src.getFormat())); + } return tgt; } @@ -111,13 +179,27 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.addEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setFacilityType(VersionConvertor_10_40.convertCodeableConcept(src.getFacilityType())); - tgt.setPracticeSetting(VersionConvertor_10_40.convertCodeableConcept(src.getPracticeSetting())); - tgt.setSourcePatientInfo(VersionConvertor_10_40.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasEncounter()) { + tgt.addEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasFacilityType()) { + tgt.setFacilityType(VersionConvertor_10_40.convertCodeableConcept(src.getFacilityType())); + } + if (src.hasPracticeSetting()) { + tgt.setPracticeSetting(VersionConvertor_10_40.convertCodeableConcept(src.getPracticeSetting())); + } + if (src.hasSourcePatientInfo()) { + tgt.setSourcePatientInfo(VersionConvertor_10_40.convertReference(src.getSourcePatientInfo())); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -128,12 +210,24 @@ public class DocumentReference10_40 { VersionConvertor_10_40.copyElement(src, tgt); if (src.hasEncounter()) tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounterFirstRep())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setFacilityType(VersionConvertor_10_40.convertCodeableConcept(src.getFacilityType())); - tgt.setPracticeSetting(VersionConvertor_10_40.convertCodeableConcept(src.getPracticeSetting())); - tgt.setSourcePatientInfo(VersionConvertor_10_40.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.r4.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasFacilityType()) { + tgt.setFacilityType(VersionConvertor_10_40.convertCodeableConcept(src.getFacilityType())); + } + if (src.hasPracticeSetting()) { + tgt.setPracticeSetting(VersionConvertor_10_40.convertCodeableConcept(src.getPracticeSetting())); + } + if (src.hasSourcePatientInfo()) { + tgt.setSourcePatientInfo(VersionConvertor_10_40.convertReference(src.getSourcePatientInfo())); + } + if (src.hasRelated()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -142,7 +236,9 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } tgt.setRef(VersionConvertor_10_40.convertReference(src)); return tgt; } @@ -161,8 +257,12 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + if (src.hasCode()) { + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + } return tgt; } @@ -171,8 +271,12 @@ public class DocumentReference10_40 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + if (src.hasCode()) { + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Encounter10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Encounter10_40.java index e9ca08eb0..1cd7ee803 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Encounter10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Encounter10_40.java @@ -10,23 +10,57 @@ public class Encounter10_40 { return null; org.hl7.fhir.dstu2.model.Encounter tgt = new org.hl7.fhir.dstu2.model.Encounter(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertEncounterState(src.getStatus())); - tgt.setClass_(convertEncounterClass(src.getClass_())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPriority(VersionConvertor_10_40.convertCodeableConcept(src.getPriority())); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); - tgt.setAppointment(VersionConvertor_10_40.convertReference(src.getAppointmentFirstRep())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setLength(VersionConvertor_10_40.convertDuration(src.getLength())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); - tgt.setServiceProvider(VersionConvertor_10_40.convertReference(src.getServiceProvider())); - tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterState(src.getStatus())); + } + if (src.hasClass_()) { + tgt.setClass_(convertEncounterClass(src.getClass_())); + } + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(VersionConvertor_10_40.convertCodeableConcept(src.getPriority())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_40.convertReference(src.getAppointmentFirstRep())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasLength()) { + tgt.setLength(VersionConvertor_10_40.convertDuration(src.getLength())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasHospitalization()) { + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) { + tgt.setServiceProvider(VersionConvertor_10_40.convertReference(src.getServiceProvider())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + } return tgt; } @@ -35,23 +69,57 @@ public class Encounter10_40 { return null; org.hl7.fhir.r4.model.Encounter tgt = new org.hl7.fhir.r4.model.Encounter(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertEncounterState(src.getStatus())); - tgt.setClass_(convertEncounterClass(src.getClass_())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPriority(VersionConvertor_10_40.convertCodeableConcept(src.getPriority())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); - tgt.addAppointment(VersionConvertor_10_40.convertReference(src.getAppointment())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setLength(VersionConvertor_10_40.convertDuration(src.getLength())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); - tgt.setServiceProvider(VersionConvertor_10_40.convertReference(src.getServiceProvider())); - tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterState(src.getStatus())); + } + if (src.hasClass_()) { + tgt.setClass_(convertEncounterClass(src.getClass_())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(VersionConvertor_10_40.convertCodeableConcept(src.getPriority())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + tgt.addAppointment(VersionConvertor_10_40.convertReference(src.getAppointment())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasLength()) { + tgt.setLength(VersionConvertor_10_40.convertDuration(src.getLength())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasHospitalization()) { + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) { + tgt.setServiceProvider(VersionConvertor_10_40.convertReference(src.getServiceProvider())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + } return tgt; } @@ -107,15 +175,33 @@ public class Encounter10_40 { return null; org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setPreAdmissionIdentifier(VersionConvertor_10_40.convertIdentifier(src.getPreAdmissionIdentifier())); - tgt.setOrigin(VersionConvertor_10_40.convertReference(src.getOrigin())); - tgt.setAdmitSource(VersionConvertor_10_40.convertCodeableConcept(src.getAdmitSource())); - tgt.setReAdmission(VersionConvertor_10_40.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); - tgt.setDischargeDisposition(VersionConvertor_10_40.convertCodeableConcept(src.getDischargeDisposition())); + if (src.hasPreAdmissionIdentifier()) { + tgt.setPreAdmissionIdentifier(VersionConvertor_10_40.convertIdentifier(src.getPreAdmissionIdentifier())); + } + if (src.hasOrigin()) { + tgt.setOrigin(VersionConvertor_10_40.convertReference(src.getOrigin())); + } + if (src.hasAdmitSource()) { + tgt.setAdmitSource(VersionConvertor_10_40.convertCodeableConcept(src.getAdmitSource())); + } + if (src.hasReAdmission()) { + tgt.setReAdmission(VersionConvertor_10_40.convertCodeableConcept(src.getReAdmission())); + } + if (src.hasDietPreference()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); + } + if (src.hasDischargeDisposition()) { + tgt.setDischargeDisposition(VersionConvertor_10_40.convertCodeableConcept(src.getDischargeDisposition())); + } return tgt; } @@ -124,15 +210,33 @@ public class Encounter10_40 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setPreAdmissionIdentifier(VersionConvertor_10_40.convertIdentifier(src.getPreAdmissionIdentifier())); - tgt.setOrigin(VersionConvertor_10_40.convertReference(src.getOrigin())); - tgt.setAdmitSource(VersionConvertor_10_40.convertCodeableConcept(src.getAdmitSource())); - tgt.setReAdmission(VersionConvertor_10_40.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); - tgt.setDischargeDisposition(VersionConvertor_10_40.convertCodeableConcept(src.getDischargeDisposition())); + if (src.hasPreAdmissionIdentifier()) { + tgt.setPreAdmissionIdentifier(VersionConvertor_10_40.convertIdentifier(src.getPreAdmissionIdentifier())); + } + if (src.hasOrigin()) { + tgt.setOrigin(VersionConvertor_10_40.convertReference(src.getOrigin())); + } + if (src.hasAdmitSource()) { + tgt.setAdmitSource(VersionConvertor_10_40.convertCodeableConcept(src.getAdmitSource())); + } + if (src.hasReAdmission()) { + tgt.setReAdmission(VersionConvertor_10_40.convertCodeableConcept(src.getReAdmission())); + } + if (src.hasDietPreference()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); + } + if (src.hasDischargeDisposition()) { + tgt.setDischargeDisposition(VersionConvertor_10_40.convertCodeableConcept(src.getDischargeDisposition())); + } return tgt; } @@ -141,9 +245,15 @@ public class Encounter10_40 { return null; org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -152,9 +262,15 @@ public class Encounter10_40 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_40.convertReference(src.getLocation())); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -197,9 +313,15 @@ public class Encounter10_40 { return null; org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setIndividual(VersionConvertor_10_40.convertReference(src.getIndividual())); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasIndividual()) { + tgt.setIndividual(VersionConvertor_10_40.convertReference(src.getIndividual())); + } return tgt; } @@ -208,9 +330,15 @@ public class Encounter10_40 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setIndividual(VersionConvertor_10_40.convertReference(src.getIndividual())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasIndividual()) { + tgt.setIndividual(VersionConvertor_10_40.convertReference(src.getIndividual())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentRequest10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentRequest10_40.java index 6ad6f1709..0d901cf15 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentRequest10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentRequest10_40.java @@ -10,11 +10,21 @@ public class EnrollmentRequest10_40 { return null; org.hl7.fhir.r4.model.EnrollmentRequest tgt = new org.hl7.fhir.r4.model.EnrollmentRequest(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCreated(src.getCreated()); - tgt.setProvider(VersionConvertor_10_40.convertReference(src.getProvider())); - tgt.setCandidate(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setCoverage(VersionConvertor_10_40.convertReference(src.getCoverage())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasProvider()) { + tgt.setProvider(VersionConvertor_10_40.convertReference(src.getProvider())); + } + if (src.hasSubject()) { + tgt.setCandidate(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasCoverage()) { + tgt.setCoverage(VersionConvertor_10_40.convertReference(src.getCoverage())); + } return tgt; } @@ -23,9 +33,15 @@ public class EnrollmentRequest10_40 { return null; org.hl7.fhir.dstu2.model.EnrollmentRequest tgt = new org.hl7.fhir.dstu2.model.EnrollmentRequest(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCreated(src.getCreated()); - tgt.setCoverage(VersionConvertor_10_40.convertReference(src.getCoverage())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasCoverage()) { + tgt.setCoverage(VersionConvertor_10_40.convertReference(src.getCoverage())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentResponse10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentResponse10_40.java index 514a30fd2..018c78227 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentResponse10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EnrollmentResponse10_40.java @@ -10,12 +10,24 @@ public class EnrollmentResponse10_40 { return null; org.hl7.fhir.r4.model.EnrollmentResponse tgt = new org.hl7.fhir.r4.model.EnrollmentResponse(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setRequest(VersionConvertor_10_40.convertReference(src.getRequest())); - tgt.setDisposition(src.getDisposition()); - tgt.setCreated(src.getCreated()); - tgt.setOrganization(VersionConvertor_10_40.convertReference(src.getOrganization())); - tgt.setRequestProvider(VersionConvertor_10_40.convertReference(src.getRequestProvider())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasRequest()) { + tgt.setRequest(VersionConvertor_10_40.convertReference(src.getRequest())); + } + if (src.hasDisposition()) { + tgt.setDisposition(src.getDisposition()); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_40.convertReference(src.getOrganization())); + } + if (src.hasRequestProvider()) { + tgt.setRequestProvider(VersionConvertor_10_40.convertReference(src.getRequestProvider())); + } return tgt; } @@ -24,9 +36,15 @@ public class EnrollmentResponse10_40 { return null; org.hl7.fhir.dstu2.model.EnrollmentResponse tgt = new org.hl7.fhir.dstu2.model.EnrollmentResponse(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setDisposition(src.getDisposition()); - tgt.setCreated(src.getCreated()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasDisposition()) { + tgt.setDisposition(src.getDisposition()); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EpisodeOfCare10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EpisodeOfCare10_40.java index ef9a93c7f..a70e1133a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EpisodeOfCare10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/EpisodeOfCare10_40.java @@ -10,15 +10,33 @@ public class EpisodeOfCare10_40 { return null; org.hl7.fhir.dstu2.model.EpisodeOfCare tgt = new org.hl7.fhir.dstu2.model.EpisodeOfCare(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_40.convertReference(t)); - tgt.setCareManager(VersionConvertor_10_40.convertReference(src.getCareManager())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasReferralRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasCareManager()) { + tgt.setCareManager(VersionConvertor_10_40.convertReference(src.getCareManager())); + } return tgt; } @@ -27,15 +45,33 @@ public class EpisodeOfCare10_40 { return null; org.hl7.fhir.r4.model.EpisodeOfCare tgt = new org.hl7.fhir.r4.model.EpisodeOfCare(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_40.convertReference(t)); - tgt.setCareManager(VersionConvertor_10_40.convertReference(src.getCareManager())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasReferralRequest()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasCareManager()) { + tgt.setCareManager(VersionConvertor_10_40.convertReference(src.getCareManager())); + } return tgt; } @@ -86,8 +122,12 @@ public class EpisodeOfCare10_40 { return null; org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -96,8 +136,12 @@ public class EpisodeOfCare10_40 { return null; org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/FamilyMemberHistory10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/FamilyMemberHistory10_40.java index c7cf3f5af..a9f78250f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/FamilyMemberHistory10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/FamilyMemberHistory10_40.java @@ -44,17 +44,35 @@ public class FamilyMemberHistory10_40 { return null; org.hl7.fhir.r4.model.FamilyMemberHistory tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setRelationship(VersionConvertor_10_40.convertCodeableConcept(src.getRelationship())); - tgt.setBorn(VersionConvertor_10_40.convertType(src.getBorn())); - tgt.setAge(VersionConvertor_10_40.convertType(src.getAge())); - tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasStatus()) { + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_40.convertCodeableConcept(src.getRelationship())); + } + if (src.hasBorn()) { + tgt.setBorn(VersionConvertor_10_40.convertType(src.getBorn())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_40.convertType(src.getAge())); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -63,17 +81,35 @@ public class FamilyMemberHistory10_40 { return null; org.hl7.fhir.dstu2.model.FamilyMemberHistory tgt = new org.hl7.fhir.dstu2.model.FamilyMemberHistory(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setRelationship(VersionConvertor_10_40.convertCodeableConcept(src.getRelationship())); - tgt.setBorn(VersionConvertor_10_40.convertType(src.getBorn())); - tgt.setAge(VersionConvertor_10_40.convertType(src.getAge())); - tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); - for (org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasStatus()) { + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_40.convertCodeableConcept(src.getRelationship())); + } + if (src.hasBorn()) { + tgt.setBorn(VersionConvertor_10_40.convertType(src.getBorn())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_40.convertType(src.getAge())); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -82,9 +118,15 @@ public class FamilyMemberHistory10_40 { return null; org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); - tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); + } return tgt; } @@ -93,9 +135,15 @@ public class FamilyMemberHistory10_40 { return null; org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); - tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_40.convertType(src.getOnset())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Flag10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Flag10_40.java index 67ab4a5e6..4ca17c0dd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Flag10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Flag10_40.java @@ -10,14 +10,30 @@ public class Flag10_40 { return null; org.hl7.fhir.r4.model.Flag tgt = new org.hl7.fhir.r4.model.Flag(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); - tgt.setStatus(convertFlagStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + } + if (src.hasStatus()) { + tgt.setStatus(convertFlagStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } return tgt; } @@ -26,14 +42,30 @@ public class Flag10_40 { return null; org.hl7.fhir.dstu2.model.Flag tgt = new org.hl7.fhir.dstu2.model.Flag(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setStatus(convertFlagStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasStatus()) { + tgt.setStatus(convertFlagStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Group10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Group10_40.java index 99c7124c9..b4648b47e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Group10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Group10_40.java @@ -10,14 +10,30 @@ public class Group10_40 { return null; org.hl7.fhir.r4.model.Group tgt = new org.hl7.fhir.r4.model.Group(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setType(convertGroupType(src.getType())); - tgt.setActual(src.getActual()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setName(src.getName()); - tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.dstu2.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertGroupType(src.getType())); + } + if (src.hasActual()) { + tgt.setActual(src.getActual()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuantity()) { + tgt.setQuantity(src.getQuantity()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.dstu2.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -26,14 +42,30 @@ public class Group10_40 { return null; org.hl7.fhir.dstu2.model.Group tgt = new org.hl7.fhir.dstu2.model.Group(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setType(convertGroupType(src.getType())); - tgt.setActual(src.getActual()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setName(src.getName()); - tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.r4.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertGroupType(src.getType())); + } + if (src.hasActual()) { + tgt.setActual(src.getActual()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuantity()) { + tgt.setQuantity(src.getQuantity()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.r4.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -42,10 +74,18 @@ public class Group10_40 { return null; org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setExclude(src.getExclude()); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasExclude()) { + tgt.setExclude(src.getExclude()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -54,10 +94,18 @@ public class Group10_40 { return null; org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setExclude(src.getExclude()); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasExclude()) { + tgt.setExclude(src.getExclude()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -66,9 +114,15 @@ public class Group10_40 { return null; org.hl7.fhir.r4.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r4.model.Group.GroupMemberComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_40.convertReference(src.getEntity())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setInactive(src.getInactive()); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_40.convertReference(src.getEntity())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasInactive()) { + tgt.setInactive(src.getInactive()); + } return tgt; } @@ -77,9 +131,15 @@ public class Group10_40 { return null; org.hl7.fhir.dstu2.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.dstu2.model.Group.GroupMemberComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_40.convertReference(src.getEntity())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setInactive(src.getInactive()); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_40.convertReference(src.getEntity())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasInactive()) { + tgt.setInactive(src.getInactive()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/HealthcareService10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/HealthcareService10_40.java index 4848a138b..67999c812 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/HealthcareService10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/HealthcareService10_40.java @@ -56,29 +56,61 @@ public class HealthcareService10_40 { return null; org.hl7.fhir.r4.model.HealthcareService tgt = new org.hl7.fhir.r4.model.HealthcareService(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setProvidedBy(VersionConvertor_10_40.convertReference(src.getProvidedBy())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasProvidedBy()) { + tgt.setProvidedBy(VersionConvertor_10_40.convertReference(src.getProvidedBy())); + } for (org.hl7.fhir.dstu2.model.HealthcareService.ServiceTypeComponent t : src.getServiceType()) { for (org.hl7.fhir.dstu2.model.CodeableConcept tj : t.getSpecialty()) tgt.addSpecialty(VersionConvertor_10_40.convertCodeableConcept(tj)); } - tgt.addLocation(VersionConvertor_10_40.convertReference(src.getLocation())); - tgt.setComment(src.getComment()); - tgt.setExtraDetails(src.getExtraDetails()); - tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_40.convertCodeableConcept(t)); + if (src.hasLocation()) { + tgt.addLocation(VersionConvertor_10_40.convertReference(src.getLocation())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasExtraDetails()) { + tgt.setExtraDetails(src.getExtraDetails()); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } if (src.hasEligibility()) tgt.getEligibilityFirstRep().setCode(VersionConvertor_10_40.convertCodeableConcept(src.getEligibility())); if (src.hasEligibilityNote()) tgt.getEligibilityFirstRep().setComment(src.getEligibilityNote()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + if (src.hasProgramName()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) { + tgt.setAppointmentRequired(src.getAppointmentRequired()); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) { + tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + } return tgt; } @@ -87,30 +119,64 @@ public class HealthcareService10_40 { return null; org.hl7.fhir.dstu2.model.HealthcareService tgt = new org.hl7.fhir.dstu2.model.HealthcareService(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setProvidedBy(VersionConvertor_10_40.convertReference(src.getProvidedBy())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasProvidedBy()) { + tgt.setProvidedBy(VersionConvertor_10_40.convertReference(src.getProvidedBy())); + } for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) { if (!tgt.hasServiceType()) tgt.addServiceType(); tgt.getServiceType().get(0).addSpecialty(VersionConvertor_10_40.convertCodeableConcept(t)); } - for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.setLocation(VersionConvertor_10_40.convertReference(t)); - tgt.setComment(src.getComment()); - tgt.setExtraDetails(src.getExtraDetails()); - tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setEligibility(VersionConvertor_10_40.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); - tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.setLocation(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasExtraDetails()) { + tgt.setExtraDetails(src.getExtraDetails()); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasEligibility()) { + tgt.setEligibility(VersionConvertor_10_40.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); + } + if (src.hasEligibility()) { + tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); + } for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgram()) if (t.hasText()) tgt.addProgramName(t.getText()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) { + tgt.setAppointmentRequired(src.getAppointmentRequired()); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) { + tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + } return tgt; } @@ -119,10 +185,18 @@ public class HealthcareService10_40 { return null; org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - tgt.setAllDay(src.getAllDay()); - tgt.setAvailableStartTime(src.getAvailableStartTime()); - tgt.setAvailableEndTime(src.getAvailableEndTime()); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) { + tgt.setAllDay(src.getAllDay()); + } + if (src.hasAvailableStartTime()) { + tgt.setAvailableStartTime(src.getAvailableStartTime()); + } + if (src.hasAvailableEndTime()) { + tgt.setAvailableEndTime(src.getAvailableEndTime()); + } return tgt; } @@ -131,10 +205,18 @@ public class HealthcareService10_40 { return null; org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - tgt.setAllDay(src.getAllDay()); - tgt.setAvailableStartTime(src.getAvailableStartTime()); - tgt.setAvailableEndTime(src.getAvailableEndTime()); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) { + tgt.setAllDay(src.getAllDay()); + } + if (src.hasAvailableStartTime()) { + tgt.setAvailableStartTime(src.getAvailableStartTime()); + } + if (src.hasAvailableEndTime()) { + tgt.setAvailableEndTime(src.getAvailableEndTime()); + } return tgt; } @@ -143,8 +225,12 @@ public class HealthcareService10_40 { return null; org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setDuring(VersionConvertor_10_40.convertPeriod(src.getDuring())); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDuring()) { + tgt.setDuring(VersionConvertor_10_40.convertPeriod(src.getDuring())); + } return tgt; } @@ -153,8 +239,12 @@ public class HealthcareService10_40 { return null; org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setDuring(VersionConvertor_10_40.convertPeriod(src.getDuring())); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDuring()) { + tgt.setDuring(VersionConvertor_10_40.convertPeriod(src.getDuring())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ImplementationGuide10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ImplementationGuide10_40.java index b731301c8..b8e76bf6f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ImplementationGuide10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ImplementationGuide10_40.java @@ -5,7 +5,6 @@ import org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Enumeration; import org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration; - import java.util.List; public class ImplementationGuide10_40 { @@ -15,27 +14,53 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.r4.model.ImplementationGuide tgt = new org.hl7.fhir.r4.model.ImplementationGuide(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_40.convertCodeableConceptToUsageContext(t)); - tgt.setCopyright(src.getCopyright()); - tgt.addFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasFhirVersion()) { + tgt.addFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } + if (src.hasDependency()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasPage()) { + tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); + } return tgt; } @@ -44,29 +69,57 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setCopyright(src.getCopyright()); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } for (Enumeration v : src.getFhirVersion()) { tgt.setFhirVersion(v.asStringValue()); } - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasDefinition()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + } return tgt; } @@ -75,8 +128,12 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -85,8 +142,12 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -95,7 +156,9 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -105,7 +168,9 @@ public class ImplementationGuide10_40 { org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_10_40.copyElement(src, tgt); tgt.setType(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.REFERENCE); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -114,8 +179,12 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_10_40.convertCanonicalToReference(src.getProfileElement())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_10_40.convertCanonicalToReference(src.getProfileElement())); + } return tgt; } @@ -124,8 +193,12 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -134,9 +207,15 @@ public class ImplementationGuide10_40 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setId(src.getId()); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); + if (src.hasId()) { + tgt.setId(src.getId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -198,12 +277,18 @@ public class ImplementationGuide10_40 { org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); VersionConvertor_10_40.copyElement(src, tgt); if (src.hasSource()) { - tgt.setName(convertUriToUrl(src.getSourceElement())); + if (src.hasSourceElement()) { + tgt.setName(convertUriToUrl(src.getSourceElement())); + } + } + if (src.hasName()) { + tgt.setTitle(src.getName()); } - tgt.setTitle(src.getName()); if (src.hasKind()) tgt.setGeneration(convertPageGeneration(src.getKind())); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -214,10 +299,14 @@ public class ImplementationGuide10_40 { VersionConvertor_10_40.copyElement(src, tgt); if (src.hasNameUrlType()) tgt.setSource(src.getNameUrlType().getValue()); - tgt.setName(src.getTitle()); + if (src.hasTitle()) { + tgt.setName(src.getTitle()); + } if (src.hasGeneration()) tgt.setKind(convertPageGeneration(src.getGeneration())); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/List10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/List10_40.java index 79b71b57c..f769f7e58 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/List10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/List10_40.java @@ -10,20 +10,40 @@ public class List10_40 { return null; org.hl7.fhir.r4.model.ListResource tgt = new org.hl7.fhir.r4.model.ListResource(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasStatus()) { + tgt.setStatus(convertListStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); - tgt.setMode(convertListMode(src.getMode())); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasMode()) { + tgt.setMode(convertListMode(src.getMode())); + } if (src.hasNote()) tgt.addNote(new org.hl7.fhir.r4.model.Annotation().setText(src.getNote())); - for (org.hl7.fhir.dstu2.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + } return tgt; } @@ -32,19 +52,41 @@ public class List10_40 { return null; org.hl7.fhir.dstu2.model.List_ tgt = new org.hl7.fhir.dstu2.model.List_(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasStatus()) { + tgt.setStatus(convertListStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); - tgt.setMode(convertListMode(src.getMode())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.r4.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_40.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasMode()) { + tgt.setMode(convertListMode(src.getMode())); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + } return tgt; } @@ -53,11 +95,17 @@ public class List10_40 { return null; org.hl7.fhir.r4.model.ListResource.ListEntryComponent tgt = new org.hl7.fhir.r4.model.ListResource.ListEntryComponent(); copyBackboneElement(src, tgt); - tgt.setFlag(VersionConvertor_10_40.convertCodeableConcept(src.getFlag())); - tgt.setDeleted(src.getDeleted()); + if (src.hasFlag()) { + tgt.setFlag(VersionConvertor_10_40.convertCodeableConcept(src.getFlag())); + } + if (src.hasDeleted()) { + tgt.setDeleted(src.getDeleted()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setItem(VersionConvertor_10_40.convertReference(src.getItem())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_40.convertReference(src.getItem())); + } return tgt; } @@ -66,11 +114,17 @@ public class List10_40 { return null; org.hl7.fhir.dstu2.model.List_.ListEntryComponent tgt = new org.hl7.fhir.dstu2.model.List_.ListEntryComponent(); copyBackboneElement(src, tgt); - tgt.setFlag(VersionConvertor_10_40.convertCodeableConcept(src.getFlag())); - tgt.setDeleted(src.getDeleted()); + if (src.hasFlag()) { + tgt.setFlag(VersionConvertor_10_40.convertCodeableConcept(src.getFlag())); + } + if (src.hasDeleted()) { + tgt.setDeleted(src.getDeleted()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setItem(VersionConvertor_10_40.convertReference(src.getItem())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_40.convertReference(src.getItem())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Location10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Location10_40.java index 3adbabbc7..7e4441de1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Location10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Location10_40.java @@ -10,18 +10,42 @@ public class Location10_40 { return null; org.hl7.fhir.dstu2.model.Location tgt = new org.hl7.fhir.dstu2.model.Location(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertLocationStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setMode(convertLocationMode(src.getMode())); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getTypeFirstRep())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); - tgt.setPhysicalType(VersionConvertor_10_40.convertCodeableConcept(src.getPhysicalType())); - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertLocationStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasMode()) { + tgt.setMode(convertLocationMode(src.getMode())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getTypeFirstRep())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + } + if (src.hasPhysicalType()) { + tgt.setPhysicalType(VersionConvertor_10_40.convertCodeableConcept(src.getPhysicalType())); + } + if (src.hasPosition()) { + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + } return tgt; } @@ -30,18 +54,42 @@ public class Location10_40 { return null; org.hl7.fhir.r4.model.Location tgt = new org.hl7.fhir.r4.model.Location(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertLocationStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setMode(convertLocationMode(src.getMode())); - tgt.addType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); - tgt.setPhysicalType(VersionConvertor_10_40.convertCodeableConcept(src.getPhysicalType())); - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertLocationStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasMode()) { + tgt.setMode(convertLocationMode(src.getMode())); + } + if (src.hasType()) { + tgt.addType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + } + if (src.hasPhysicalType()) { + tgt.setPhysicalType(VersionConvertor_10_40.convertCodeableConcept(src.getPhysicalType())); + } + if (src.hasPosition()) { + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + } return tgt; } @@ -76,9 +124,15 @@ public class Location10_40 { return null; org.hl7.fhir.r4.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r4.model.Location.LocationPositionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLongitude(src.getLongitude()); - tgt.setLatitude(src.getLatitude()); - tgt.setAltitude(src.getAltitude()); + if (src.hasLongitude()) { + tgt.setLongitude(src.getLongitude()); + } + if (src.hasLatitude()) { + tgt.setLatitude(src.getLatitude()); + } + if (src.hasAltitude()) { + tgt.setAltitude(src.getAltitude()); + } return tgt; } @@ -87,9 +141,15 @@ public class Location10_40 { return null; org.hl7.fhir.dstu2.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.dstu2.model.Location.LocationPositionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLongitude(src.getLongitude()); - tgt.setLatitude(src.getLatitude()); - tgt.setAltitude(src.getAltitude()); + if (src.hasLongitude()) { + tgt.setLongitude(src.getLongitude()); + } + if (src.hasLatitude()) { + tgt.setLatitude(src.getLatitude()); + } + if (src.hasAltitude()) { + tgt.setAltitude(src.getAltitude()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationDispense10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationDispense10_40.java index 01bf4eec5..e6e0869a2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationDispense10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationDispense10_40.java @@ -12,22 +12,50 @@ public class MedicationDispense10_40 { return null; org.hl7.fhir.r4.model.MedicationDispense tgt = new org.hl7.fhir.r4.model.MedicationDispense(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_40.convertReference(t)); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); - tgt.setDaysSupply(VersionConvertor_10_40.convertSimpleQuantity(src.getDaysSupply())); - tgt.setWhenPrepared(src.getWhenPrepared()); - tgt.setWhenHandedOver(src.getWhenHandedOver()); - tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDaysSupply()) { + tgt.setDaysSupply(VersionConvertor_10_40.convertSimpleQuantity(src.getDaysSupply())); + } + if (src.hasWhenPrepared()) { + tgt.setWhenPrepared(src.getWhenPrepared()); + } + if (src.hasWhenHandedOver()) { + tgt.setWhenHandedOver(src.getWhenHandedOver()); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); + } if (src.hasNote()) tgt.addNote().setText(src.getNote()); - for (org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); + } + if (src.hasSubstitution()) { + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + } return tgt; } @@ -36,21 +64,51 @@ public class MedicationDispense10_40 { return null; org.hl7.fhir.dstu2.model.MedicationDispense tgt = new org.hl7.fhir.dstu2.model.MedicationDispense(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_40.convertReference(t)); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); - tgt.setDaysSupply(VersionConvertor_10_40.convertSimpleQuantity(src.getDaysSupply())); - tgt.setWhenPrepared(src.getWhenPrepared()); - tgt.setWhenHandedOver(src.getWhenHandedOver()); - tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); - for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDaysSupply()) { + tgt.setDaysSupply(VersionConvertor_10_40.convertSimpleQuantity(src.getDaysSupply())); + } + if (src.hasWhenPrepared()) { + tgt.setWhenPrepared(src.getWhenPrepared()); + } + if (src.hasWhenHandedOver()) { + tgt.setWhenHandedOver(src.getWhenHandedOver()); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); + } + if (src.hasSubstitution()) { + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + } return tgt; } @@ -59,13 +117,23 @@ public class MedicationDispense10_40 { return null; org.hl7.fhir.r4.model.Dosage tgt = new org.hl7.fhir.r4.model.Dosage(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); + } if (src.hasSiteCodeableConcept()) tgt.setSite(VersionConvertor_10_40.convertCodeableConcept(src.getSiteCodeableConcept())); - tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } if (src.hasDose() || src.hasRate()) { DosageDoseAndRateComponent dr = tgt.addDoseAndRate(); if (src.hasDose()) @@ -73,7 +141,9 @@ public class MedicationDispense10_40 { if (src.hasRate()) dr.setRate(VersionConvertor_10_40.convertType(src.getRate())); } - tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } @@ -82,15 +152,29 @@ public class MedicationDispense10_40 { return null; org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent tgt = new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); - tgt.setSite(VersionConvertor_10_40.convertType(src.getSite())); - tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_40.convertType(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } if (src.hasDoseAndRate() && src.getDoseAndRate().get(0).hasDose()) tgt.setDose(VersionConvertor_10_40.convertType(src.getDoseAndRate().get(0).getDose())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + } if (src.hasDoseAndRate() && src.getDoseAndRate().get(0).hasRate()) tgt.setRate(VersionConvertor_10_40.convertType(src.getDoseAndRate().get(0).getRate())); return tgt; @@ -113,9 +197,15 @@ public class MedicationDispense10_40 { return null; org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_40.convertReference(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.r4.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -124,9 +214,15 @@ public class MedicationDispense10_40 { return null; org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_40.convertReference(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_40.convertReference(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationStatement10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationStatement10_40.java index cea00448b..6d687156a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationStatement10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MedicationStatement10_40.java @@ -11,17 +11,35 @@ public class MedicationStatement10_40 { return null; org.hl7.fhir.dstu2.model.MedicationStatement tgt = new org.hl7.fhir.dstu2.model.MedicationStatement(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); - tgt.setInformationSource(VersionConvertor_10_40.convertReference(src.getInformationSource())); - for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addSupportingInformation(VersionConvertor_10_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); + } + if (src.hasInformationSource()) { + tgt.setInformationSource(VersionConvertor_10_40.convertReference(src.getInformationSource())); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addSupportingInformation(VersionConvertor_10_40.convertReference(t)); + } if (src.hasDateAsserted()) tgt.setDateAsserted(src.getDateAsserted()); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasDosage()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + } return tgt; } @@ -30,18 +48,34 @@ public class MedicationStatement10_40 { return null; org.hl7.fhir.r4.model.MedicationStatement tgt = new org.hl7.fhir.r4.model.MedicationStatement(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); - tgt.setInformationSource(VersionConvertor_10_40.convertReference(src.getInformationSource())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addDerivedFrom(VersionConvertor_10_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_40.convertType(src.getMedication())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); + } + if (src.hasInformationSource()) { + tgt.setInformationSource(VersionConvertor_10_40.convertReference(src.getInformationSource())); + } + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addDerivedFrom(VersionConvertor_10_40.convertReference(t)); + } if (src.hasDateAsserted()) tgt.setDateAsserted(src.getDateAsserted()); if (src.hasNote()) tgt.addNote().setText(src.getNote()); - for (org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + if (src.hasDosage()) { + for (org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + } return tgt; } @@ -50,19 +84,31 @@ public class MedicationStatement10_40 { return null; org.hl7.fhir.r4.model.Dosage tgt = new org.hl7.fhir.r4.model.Dosage(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); + } if (src.hasSiteCodeableConcept()) tgt.setSite(VersionConvertor_10_40.convertCodeableConcept(src.getSiteCodeableConcept())); - tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } if (src.hasRate()) { DosageDoseAndRateComponent dr = tgt.addDoseAndRate(); if (src.hasRate()) dr.setRate(VersionConvertor_10_40.convertType(src.getRate())); } - tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } @@ -71,15 +117,29 @@ public class MedicationStatement10_40 { return null; org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent tgt = new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); - tgt.setSite(VersionConvertor_10_40.convertType(src.getSite())); - tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_40.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_40.convertType(src.getAsNeeded())); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_40.convertType(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_40.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } if (src.hasDoseAndRate() && src.getDoseAndRate().get(0).hasRate()) tgt.setRate(VersionConvertor_10_40.convertType(src.getDoseAndRate().get(0).getRate())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_40.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MessageHeader10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MessageHeader10_40.java index caaa83931..3021311ad 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MessageHeader10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/MessageHeader10_40.java @@ -10,9 +10,15 @@ public class MessageHeader10_40 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -21,9 +27,15 @@ public class MessageHeader10_40 { return null; org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -32,15 +44,33 @@ public class MessageHeader10_40 { return null; org.hl7.fhir.r4.model.MessageHeader tgt = new org.hl7.fhir.r4.model.MessageHeader(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setEvent(VersionConvertor_10_40.convertCoding(src.getEvent())); - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - tgt.setSource(convertMessageSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); - tgt.setEnterer(VersionConvertor_10_40.convertReference(src.getEnterer())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.setResponsible(VersionConvertor_10_40.convertReference(src.getResponsible())); - tgt.setReason(VersionConvertor_10_40.convertCodeableConcept(src.getReason())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getData()) tgt.addFocus(VersionConvertor_10_40.convertReference(t)); + if (src.hasEvent()) { + tgt.setEvent(VersionConvertor_10_40.convertCoding(src.getEvent())); + } + if (src.hasResponse()) { + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + } + if (src.hasSource()) { + tgt.setSource(convertMessageSourceComponent(src.getSource())); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasEnterer()) { + tgt.setEnterer(VersionConvertor_10_40.convertReference(src.getEnterer())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasResponsible()) { + tgt.setResponsible(VersionConvertor_10_40.convertReference(src.getResponsible())); + } + if (src.hasReason()) { + tgt.setReason(VersionConvertor_10_40.convertCodeableConcept(src.getReason())); + } + if (src.hasData()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getData()) tgt.addFocus(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -51,14 +81,30 @@ public class MessageHeader10_40 { VersionConvertor_10_40.copyDomainResource(src, tgt); if (src.hasEventCoding()) tgt.setEvent(VersionConvertor_10_40.convertCoding(src.getEventCoding())); - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - tgt.setSource(convertMessageSourceComponent(src.getSource())); - for (org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); - tgt.setEnterer(VersionConvertor_10_40.convertReference(src.getEnterer())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.setResponsible(VersionConvertor_10_40.convertReference(src.getResponsible())); - tgt.setReason(VersionConvertor_10_40.convertCodeableConcept(src.getReason())); - for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) tgt.addData(VersionConvertor_10_40.convertReference(t)); + if (src.hasResponse()) { + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + } + if (src.hasSource()) { + tgt.setSource(convertMessageSourceComponent(src.getSource())); + } + if (src.hasDestination()) { + for (org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasEnterer()) { + tgt.setEnterer(VersionConvertor_10_40.convertReference(src.getEnterer())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasResponsible()) { + tgt.setResponsible(VersionConvertor_10_40.convertReference(src.getResponsible())); + } + if (src.hasReason()) { + tgt.setReason(VersionConvertor_10_40.convertCodeableConcept(src.getReason())); + } + if (src.hasFocus()) { + for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) tgt.addData(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -67,9 +113,15 @@ public class MessageHeader10_40 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setCode(convertResponseType(src.getCode())); - tgt.setDetails(VersionConvertor_10_40.convertReference(src.getDetails())); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasCode()) { + tgt.setCode(convertResponseType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_40.convertReference(src.getDetails())); + } return tgt; } @@ -78,9 +130,15 @@ public class MessageHeader10_40 { return null; org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setCode(convertResponseType(src.getCode())); - tgt.setDetails(VersionConvertor_10_40.convertReference(src.getDetails())); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasCode()) { + tgt.setCode(convertResponseType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_40.convertReference(src.getDetails())); + } return tgt; } @@ -89,11 +147,21 @@ public class MessageHeader10_40 { return null; org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setSoftware(src.getSoftware()); - tgt.setVersion(src.getVersion()); - tgt.setContact(VersionConvertor_10_40.convertContactPoint(src.getContact())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSoftware()) { + tgt.setSoftware(src.getSoftware()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasContact()) { + tgt.setContact(VersionConvertor_10_40.convertContactPoint(src.getContact())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -102,11 +170,21 @@ public class MessageHeader10_40 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setSoftware(src.getSoftware()); - tgt.setVersion(src.getVersion()); - tgt.setContact(VersionConvertor_10_40.convertContactPoint(src.getContact())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSoftware()) { + tgt.setSoftware(src.getSoftware()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasContact()) { + tgt.setContact(VersionConvertor_10_40.convertContactPoint(src.getContact())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/NamingSystem10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/NamingSystem10_40.java index 31de56b23..1d8881462 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/NamingSystem10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/NamingSystem10_40.java @@ -10,22 +10,42 @@ public class NamingSystem10_40 { return null; org.hl7.fhir.r4.model.NamingSystem tgt = new org.hl7.fhir.r4.model.NamingSystem(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); - tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } + if (src.hasResponsible()) { + tgt.setResponsible(src.getResponsible()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_40.convertCodeableConceptToUsageContext(t)); - tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUsage()) { + tgt.setUsage(src.getUsage()); + } + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -34,21 +54,43 @@ public class NamingSystem10_40 { return null; org.hl7.fhir.dstu2.model.NamingSystem tgt = new org.hl7.fhir.dstu2.model.NamingSystem(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); - tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } + if (src.hasResponsible()) { + tgt.setResponsible(src.getResponsible()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasUsage()) { + tgt.setUsage(src.getUsage()); + } + if (src.hasUniqueId()) { + for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -57,8 +99,12 @@ public class NamingSystem10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -67,8 +113,12 @@ public class NamingSystem10_40 { return null; org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent tgt = new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -141,10 +191,18 @@ public class NamingSystem10_40 { return null; org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); - tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -153,10 +211,18 @@ public class NamingSystem10_40 { return null; org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); - tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Observation10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Observation10_40.java index 86fbceb45..b11563075 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Observation10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Observation10_40.java @@ -10,28 +10,68 @@ public class Observation10_40 { return null; org.hl7.fhir.dstu2.model.Observation tgt = new org.hl7.fhir.dstu2.model.Observation(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept c : src.getCategory()) tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(c)); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); - tgt.setInterpretation(VersionConvertor_10_40.convertCodeableConcept(src.getInterpretationFirstRep())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertObservationStatus(src.getStatus())); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept c : src.getCategory()) tgt.setCategory(VersionConvertor_10_40.convertCodeableConcept(c)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasInterpretation()) { + tgt.setInterpretation(VersionConvertor_10_40.convertCodeableConcept(src.getInterpretationFirstRep())); + } if (src.hasNote()) tgt.setComments(src.getNoteFirstRep().getText()); - tgt.setBodySite(VersionConvertor_10_40.convertCodeableConcept(src.getBodySite())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); - tgt.setSpecimen(VersionConvertor_10_40.convertReference(src.getSpecimen())); - tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); - for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER)); - for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM)); - for (org.hl7.fhir.r4.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_40.convertCodeableConcept(src.getBodySite())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } + if (src.hasSpecimen()) { + tgt.setSpecimen(VersionConvertor_10_40.convertReference(src.getSpecimen())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasHasMember()) { + for (org.hl7.fhir.r4.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER)); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r4.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -40,29 +80,67 @@ public class Observation10_40 { return null; org.hl7.fhir.r4.model.Observation tgt = new org.hl7.fhir.r4.model.Observation(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setStatus(convertObservationStatus(src.getStatus())); - tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); - tgt.addInterpretation(VersionConvertor_10_40.convertCodeableConcept(src.getInterpretation())); - tgt.addNote().setText(src.getComments()); - tgt.setBodySite(VersionConvertor_10_40.convertCodeableConcept(src.getBodySite())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); - tgt.setSpecimen(VersionConvertor_10_40.convertReference(src.getSpecimen())); - tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertObservationStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_40.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasInterpretation()) { + tgt.addInterpretation(VersionConvertor_10_40.convertCodeableConcept(src.getInterpretation())); + } + if (src.hasComments()) { + tgt.addNote().setText(src.getComments()); + } + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_40.convertCodeableConcept(src.getBodySite())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } + if (src.hasSpecimen()) { + tgt.setSpecimen(VersionConvertor_10_40.convertReference(src.getSpecimen())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_40.convertReference(src.getDevice())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } for (org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent t : src.getRelated()) if (t.getType() == org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER) tgt.addHasMember(VersionConvertor_10_40.convertReference(t.getTarget())); else if (t.getType() == org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM) tgt.addDerivedFrom(VersionConvertor_10_40.convertReference(t.getTarget())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasComponent()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -71,10 +149,18 @@ public class Observation10_40 { return null; org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -83,10 +169,18 @@ public class Observation10_40 { return null; org.hl7.fhir.r4.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r4.model.Observation.ObservationComponentComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_40.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -95,11 +189,21 @@ public class Observation10_40 { return null; org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLow(VersionConvertor_10_40.convertSimpleQuantity(src.getLow())); - tgt.setHigh(VersionConvertor_10_40.convertSimpleQuantity(src.getHigh())); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getMeaning())); - tgt.setAge(VersionConvertor_10_40.convertRange(src.getAge())); - tgt.setText(src.getText()); + if (src.hasLow()) { + tgt.setLow(VersionConvertor_10_40.convertSimpleQuantity(src.getLow())); + } + if (src.hasHigh()) { + tgt.setHigh(VersionConvertor_10_40.convertSimpleQuantity(src.getHigh())); + } + if (src.hasMeaning()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getMeaning())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_40.convertRange(src.getAge())); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } return tgt; } @@ -108,11 +212,21 @@ public class Observation10_40 { return null; org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLow(VersionConvertor_10_40.convertSimpleQuantity(src.getLow())); - tgt.setHigh(VersionConvertor_10_40.convertSimpleQuantity(src.getHigh())); - tgt.setMeaning(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setAge(VersionConvertor_10_40.convertRange(src.getAge())); - tgt.setText(src.getText()); + if (src.hasLow()) { + tgt.setLow(VersionConvertor_10_40.convertSimpleQuantity(src.getLow())); + } + if (src.hasHigh()) { + tgt.setHigh(VersionConvertor_10_40.convertSimpleQuantity(src.getHigh())); + } + if (src.hasType()) { + tgt.setMeaning(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_40.convertRange(src.getAge())); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationDefinition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationDefinition10_40.java index 240e4eb9f..214a97267 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationDefinition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationDefinition10_40.java @@ -15,29 +15,61 @@ public class OperationDefinition10_40 { return null; org.hl7.fhir.r4.model.OperationDefinition tgt = new org.hl7.fhir.r4.model.OperationDefinition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setPurpose(src.getRequirements()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } if (src.hasIdempotent()) tgt.setAffectsState(!src.getIdempotent()); - tgt.setCode(src.getCode()); - tgt.setComment(src.getNotes()); - tgt.setBaseElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getBase())); - tgt.setSystem(src.getSystem()); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasNotes()) { + tgt.setComment(src.getNotes()); + } + if (src.hasBase()) { + tgt.setBaseElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getBase())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + } tgt.setType(tgt.hasResource()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -46,29 +78,61 @@ public class OperationDefinition10_40 { return null; org.hl7.fhir.dstu2.model.OperationDefinition tgt = new org.hl7.fhir.dstu2.model.OperationDefinition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setRequirements(src.getPurpose()); - tgt.setIdempotent(!src.getAffectsState()); - tgt.setCode(src.getCode()); - tgt.setNotes(src.getComment()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasAffectsState()) { + tgt.setIdempotent(!src.getAffectsState()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasComment()) { + tgt.setNotes(src.getComment()); + } if (src.hasBase()) tgt.setBase(VersionConvertor_10_40.convertCanonicalToReference(src.getBaseElement())); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.getType()) - for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); + } + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -77,8 +141,12 @@ public class OperationDefinition10_40 { return null; org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent tgt = new org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -87,8 +155,12 @@ public class OperationDefinition10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -130,19 +202,35 @@ public class OperationDefinition10_40 { return null; org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } if (src.hasSearchType()) { - tgt.setType(src.getSearchType().toCode()); + if (src.hasSearchType()) { + tgt.setType(src.getSearchType().toCode()); + } } else tgt.setType(src.getType()); - for (org.hl7.fhir.r4.model.UriType t : src.getTargetProfile()) tgt.setProfile(new Reference(t.getValue())); + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r4.model.UriType t : src.getTargetProfile()) tgt.setProfile(new Reference(t.getValue())); + } if (src.hasBinding()) tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -151,20 +239,40 @@ public class OperationDefinition10_40 { return null; org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } if (Utilities.existsInList(src.getType(), "token", "reference", "composite", "number", "date", "quantity", "uri")) { tgt.setType("string"); - tgt.setSearchType(SearchParamType.fromCode(src.getType())); + if (src.hasType()) { + tgt.setSearchType(SearchParamType.fromCode(src.getType())); + } } else { - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + } + if (src.hasProfile()) { + tgt.addTargetProfile(src.getProfile().getReference()); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); } - tgt.addTargetProfile(src.getProfile().getReference()); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationOutcome10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationOutcome10_40.java index 2498e87f8..c6ab803d8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationOutcome10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/OperationOutcome10_40.java @@ -178,7 +178,9 @@ public class OperationOutcome10_40 { return null; org.hl7.fhir.r4.model.OperationOutcome tgt = new org.hl7.fhir.r4.model.OperationOutcome(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome10_40 { return null; org.hl7.fhir.dstu2.model.OperationOutcome tgt = new org.hl7.fhir.dstu2.model.OperationOutcome(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -196,11 +200,21 @@ public class OperationOutcome10_40 { return null; org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_10_40.convertCodeableConcept(src.getDetails())); - tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_40.convertCodeableConcept(src.getDetails())); + } + if (src.hasDiagnostics()) { + tgt.setDiagnostics(src.getDiagnostics()); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } return tgt; } @@ -209,11 +223,21 @@ public class OperationOutcome10_40 { return null; org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_10_40.convertCodeableConcept(src.getDetails())); - tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_40.convertCodeableConcept(src.getDetails())); + } + if (src.hasDiagnostics()) { + tgt.setDiagnostics(src.getDiagnostics()); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Organization10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Organization10_40.java index 627857558..29bbc0e40 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Organization10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Organization10_40.java @@ -10,14 +10,30 @@ public class Organization10_40 { return null; org.hl7.fhir.r4.model.Organization tgt = new org.hl7.fhir.r4.model.Organization(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setActive(src.getActive()); - tgt.addType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasType()) { + tgt.addType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } return tgt; } @@ -26,14 +42,30 @@ public class Organization10_40 { return null; org.hl7.fhir.dstu2.model.Organization tgt = new org.hl7.fhir.dstu2.model.Organization(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setActive(src.getActive()); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getTypeFirstRep())); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); - for (org.hl7.fhir.r4.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getTypeFirstRep())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_40.convertReference(src.getPartOf())); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } return tgt; } @@ -42,10 +74,18 @@ public class Organization10_40 { return null; org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setPurpose(VersionConvertor_10_40.convertCodeableConcept(src.getPurpose())); - tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + if (src.hasPurpose()) { + tgt.setPurpose(VersionConvertor_10_40.convertCodeableConcept(src.getPurpose())); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + } return tgt; } @@ -54,10 +94,18 @@ public class Organization10_40 { return null; org.hl7.fhir.r4.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.r4.model.Organization.OrganizationContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setPurpose(VersionConvertor_10_40.convertCodeableConcept(src.getPurpose())); - tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + if (src.hasPurpose()) { + tgt.setPurpose(VersionConvertor_10_40.convertCodeableConcept(src.getPurpose())); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Parameters10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Parameters10_40.java index 1e5b3274b..c7237187f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Parameters10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Parameters10_40.java @@ -10,7 +10,9 @@ public class Parameters10_40 { return null; org.hl7.fhir.dstu2.model.Parameters tgt = new org.hl7.fhir.dstu2.model.Parameters(); VersionConvertor_10_40.copyResource(src, tgt); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters10_40 { return null; org.hl7.fhir.r4.model.Parameters tgt = new org.hl7.fhir.r4.model.Parameters(); VersionConvertor_10_40.copyResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -28,10 +32,18 @@ public class Parameters10_40 { return null; org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setResource(VersionConvertor_10_40.convertResource(src.getResource())); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_40.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -40,10 +52,18 @@ public class Parameters10_40 { return null; org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - tgt.setResource(VersionConvertor_10_40.convertResource(src.getResource())); - for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_40.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Patient10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Patient10_40.java index 6f000ae74..b5635e556 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Patient10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Patient10_40.java @@ -39,13 +39,27 @@ public class Patient10_40 { return null; org.hl7.fhir.r4.model.Patient.ContactComponent tgt = new org.hl7.fhir.r4.model.Patient.ContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setOrganization(VersionConvertor_10_40.convertReference(src.getOrganization())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasRelationship()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_40.convertReference(src.getOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -54,13 +68,27 @@ public class Patient10_40 { return null; org.hl7.fhir.dstu2.model.Patient.ContactComponent tgt = new org.hl7.fhir.dstu2.model.Patient.ContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setOrganization(VersionConvertor_10_40.convertReference(src.getOrganization())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + if (src.hasRelationship()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_40.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_40.convertAddress(src.getAddress())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_40.convertReference(src.getOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -101,24 +129,56 @@ public class Patient10_40 { return null; org.hl7.fhir.r4.model.Patient tgt = new org.hl7.fhir.r4.model.Patient(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setMaritalStatus(VersionConvertor_10_40.convertCodeableConcept(src.getMaritalStatus())); - tgt.setMultipleBirth(VersionConvertor_10_40.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); - for (org.hl7.fhir.dstu2.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasMaritalStatus()) { + tgt.setMaritalStatus(VersionConvertor_10_40.convertCodeableConcept(src.getMaritalStatus())); + } + if (src.hasMultipleBirth()) { + tgt.setMultipleBirth(VersionConvertor_10_40.convertType(src.getMultipleBirth())); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasAnimal()) tgt.addExtension(convertAnimalComponent(src.getAnimal())); - for (org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getCareProvider()) tgt.addGeneralPractitioner(VersionConvertor_10_40.convertReference(t)); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasCareProvider()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getCareProvider()) tgt.addGeneralPractitioner(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -127,24 +187,56 @@ public class Patient10_40 { return null; org.hl7.fhir.dstu2.model.Patient tgt = new org.hl7.fhir.dstu2.model.Patient(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setMaritalStatus(VersionConvertor_10_40.convertCodeableConcept(src.getMaritalStatus())); - tgt.setMultipleBirth(VersionConvertor_10_40.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); - for (org.hl7.fhir.r4.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_40.convertType(src.getDeceased())); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasMaritalStatus()) { + tgt.setMaritalStatus(VersionConvertor_10_40.convertCodeableConcept(src.getMaritalStatus())); + } + if (src.hasMultipleBirth()) { + tgt.setMultipleBirth(VersionConvertor_10_40.convertType(src.getMultipleBirth())); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/patient-animal")) tgt.setAnimal(convertAnimalComponent(src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-animal"))); - for (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getGeneralPractitioner()) tgt.addCareProvider(VersionConvertor_10_40.convertReference(t)); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r4.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.r4.model.Reference t : src.getGeneralPractitioner()) tgt.addCareProvider(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -153,8 +245,12 @@ public class Patient10_40 { return null; org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLanguage(VersionConvertor_10_40.convertCodeableConcept(src.getLanguage())); - tgt.setPreferred(src.getPreferred()); + if (src.hasLanguage()) { + tgt.setLanguage(VersionConvertor_10_40.convertCodeableConcept(src.getLanguage())); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } return tgt; } @@ -163,8 +259,12 @@ public class Patient10_40 { return null; org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLanguage(VersionConvertor_10_40.convertCodeableConcept(src.getLanguage())); - tgt.setPreferred(src.getPreferred()); + if (src.hasLanguage()) { + tgt.setLanguage(VersionConvertor_10_40.convertCodeableConcept(src.getLanguage())); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } return tgt; } @@ -173,8 +273,12 @@ public class Patient10_40 { return null; org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOther(VersionConvertor_10_40.convertReference(src.getOther())); - tgt.setType(convertLinkType(src.getType())); + if (src.hasOther()) { + tgt.setOther(VersionConvertor_10_40.convertReference(src.getOther())); + } + if (src.hasType()) { + tgt.setType(convertLinkType(src.getType())); + } return tgt; } @@ -183,8 +287,12 @@ public class Patient10_40 { return null; org.hl7.fhir.r4.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r4.model.Patient.PatientLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOther(VersionConvertor_10_40.convertReference(src.getOther())); - tgt.setType(convertLinkType(src.getType())); + if (src.hasOther()) { + tgt.setOther(VersionConvertor_10_40.convertReference(src.getOther())); + } + if (src.hasType()) { + tgt.setType(convertLinkType(src.getType())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Person10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Person10_40.java index 161af4be8..7103edbf2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Person10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Person10_40.java @@ -44,16 +44,36 @@ public class Person10_40 { return null; org.hl7.fhir.r4.model.Person tgt = new org.hl7.fhir.r4.model.Person(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu2.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -62,16 +82,36 @@ public class Person10_40 { return null; org.hl7.fhir.dstu2.model.Person tgt = new org.hl7.fhir.dstu2.model.Person(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); - tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.r4.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_40.convertAttachment(src.getPhoto())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_40.convertReference(src.getManagingOrganization())); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -80,8 +120,12 @@ public class Person10_40 { return null; org.hl7.fhir.dstu2.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.dstu2.model.Person.PersonLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + } + if (src.hasAssurance()) { + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + } return tgt; } @@ -90,8 +134,12 @@ public class Person10_40 { return null; org.hl7.fhir.r4.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r4.model.Person.PersonLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_40.convertReference(src.getTarget())); + } + if (src.hasAssurance()) { + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Practitioner10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Practitioner10_40.java index 8867911ee..9e99e0e07 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Practitioner10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Practitioner10_40.java @@ -10,16 +10,36 @@ public class Practitioner10_40 { return null; org.hl7.fhir.dstu2.model.Practitioner tgt = new org.hl7.fhir.dstu2.model.Practitioner(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.setName(VersionConvertor_10_40.convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); - for (org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_40.convertCodeableConcept(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.setName(VersionConvertor_10_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_40.convertCodeableConcept(t)); + } return tgt; } @@ -28,17 +48,35 @@ public class Practitioner10_40 { return null; org.hl7.fhir.r4.model.Practitioner tgt = new org.hl7.fhir.r4.model.Practitioner(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setActive(src.getActive()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } if (src.hasName()) tgt.addName(VersionConvertor_10_40.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); - tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); - for (org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_40.convertCodeableConcept(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_40.convertAddress(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_40.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_40.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_40.convertCodeableConcept(t)); + } return tgt; } @@ -47,10 +85,18 @@ public class Practitioner10_40 { return null; org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setIssuer(VersionConvertor_10_40.convertReference(src.getIssuer())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasIssuer()) { + tgt.setIssuer(VersionConvertor_10_40.convertReference(src.getIssuer())); + } return tgt; } @@ -59,10 +105,18 @@ public class Practitioner10_40 { return null; org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); - tgt.setIssuer(VersionConvertor_10_40.convertReference(src.getIssuer())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_40.convertPeriod(src.getPeriod())); + } + if (src.hasIssuer()) { + tgt.setIssuer(VersionConvertor_10_40.convertReference(src.getIssuer())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Questionnaire10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Questionnaire10_40.java index fee945e75..3a9bc7b0a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Questionnaire10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Questionnaire10_40.java @@ -12,19 +12,33 @@ public class Questionnaire10_40 { return null; org.hl7.fhir.dstu2.model.Questionnaire tgt = new org.hl7.fhir.dstu2.model.Questionnaire(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r4.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t1)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r4.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t1)); + } org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent root = tgt.getGroup(); - root.setTitle(src.getTitle()); + if (src.hasTitle()) { + root.setTitle(src.getTitle()); + } for (org.hl7.fhir.r4.model.Coding t : src.getCode()) { root.addConcept(VersionConvertor_10_40.convertCoding(t)); } - for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + if (src.hasSubjectType()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) if (t.getType() == org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP) root.addGroup(convertQuestionnaireGroupComponent(t)); else @@ -66,11 +80,21 @@ public class Questionnaire10_40 { return null; org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent tgt = new org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_40.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) if (t.getType() == org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP) tgt.addGroup(convertQuestionnaireGroupComponent(t)); else @@ -83,14 +107,28 @@ public class Questionnaire10_40 { return null; org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_40.convertCoding(t)); - tgt.setText(src.getText()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } tgt.setType(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); - for (org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireQuestionComponent(t)); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + } + if (src.hasQuestion()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireQuestionComponent(t)); + } return tgt; } @@ -136,20 +174,36 @@ public class Questionnaire10_40 { return null; org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent tgt = new org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_40.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - tgt.setOptions(VersionConvertor_10_40.convertCanonicalToReference(src.getAnswerValueSetElement())); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasAnswerValueSetElement()) { + tgt.setOptions(VersionConvertor_10_40.convertCanonicalToReference(src.getAnswerValueSetElement())); + } for (QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) if (t.hasValueCoding()) try { tgt.addOption(VersionConvertor_10_40.convertCoding(t.getValueCoding())); } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireGroupComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireGroupComponent(t)); + } return tgt; } @@ -158,15 +212,33 @@ public class Questionnaire10_40 { return null; org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_40.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireQuestionType(src.getType())); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - tgt.setAnswerValueSetElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getOptions())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getOption()) tgt.addAnswerOption().setValue(VersionConvertor_10_40.convertCoding(t)); - for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasType()) { + tgt.setType(convertQuestionnaireQuestionType(src.getType())); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasOptions()) { + tgt.setAnswerValueSetElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getOptions())); + } + if (src.hasOption()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getOption()) tgt.addAnswerOption().setValue(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/QuestionnaireResponse10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/QuestionnaireResponse10_40.java index b03e77104..84aef8183 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/QuestionnaireResponse10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/QuestionnaireResponse10_40.java @@ -10,8 +10,12 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) if (t.hasAnswer()) tgt.addQuestion(convertQuestionnaireItemToQuestion(t)); else @@ -24,9 +28,15 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } return tgt; } @@ -35,17 +45,35 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_10_40.convertCanonicalToReference(src.getQuestionnaireElement())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaireElement()) { + tgt.setQuestionnaire(VersionConvertor_10_40.convertCanonicalToReference(src.getQuestionnaireElement())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasAuthored()) { + tgt.setAuthored(src.getAuthored()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } if (src.getItem().size() != 1) throw new FHIRException("multiple root items not supported"); - tgt.setGroup(convertQuestionnaireItemToGroup(src.getItem().get(0))); + if (src.hasItem()) { + tgt.setGroup(convertQuestionnaireItemToGroup(src.getItem().get(0))); + } return tgt; } @@ -54,14 +82,30 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaireElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); - tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaireElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_40.convertReference(src.getAuthor())); + } + if (src.hasAuthored()) { + tgt.setAuthored(src.getAuthored()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_40.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } if (src.hasGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(src.getGroup())); return tgt; @@ -72,10 +116,18 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + } + if (src.hasQuestion()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); + } return tgt; } @@ -84,8 +136,12 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + } return tgt; } @@ -94,8 +150,12 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireItemToGroup(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireItemToGroup(t)); + } return tgt; } @@ -104,9 +164,15 @@ public class QuestionnaireResponse10_40 { return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/RiskAssessment10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/RiskAssessment10_40.java index 475324684..89c40e61d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/RiskAssessment10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/RiskAssessment10_40.java @@ -10,15 +10,33 @@ public class RiskAssessment10_40 { return null; org.hl7.fhir.dstu2.model.RiskAssessment tgt = new org.hl7.fhir.dstu2.model.RiskAssessment(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setCondition(VersionConvertor_10_40.convertReference(src.getCondition())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setPerformer(VersionConvertor_10_40.convertReference(src.getPerformer())); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - tgt.setMitigation(src.getMitigation()); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasCondition()) { + tgt.setCondition(VersionConvertor_10_40.convertReference(src.getCondition())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_40.convertReference(src.getPerformer())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } + if (src.hasBasis()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) { + tgt.setMitigation(src.getMitigation()); + } return tgt; } @@ -27,15 +45,33 @@ public class RiskAssessment10_40 { return null; org.hl7.fhir.r4.model.RiskAssessment tgt = new org.hl7.fhir.r4.model.RiskAssessment(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); - tgt.setCondition(VersionConvertor_10_40.convertReference(src.getCondition())); - tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); - tgt.setPerformer(VersionConvertor_10_40.convertReference(src.getPerformer())); - tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - tgt.setMitigation(src.getMitigation()); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_40.convertReference(src.getSubject())); + } + if (src.hasCondition()) { + tgt.setCondition(VersionConvertor_10_40.convertReference(src.getCondition())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_40.convertReference(src.getEncounter())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_40.convertReference(src.getPerformer())); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_40.convertCodeableConcept(src.getMethod())); + } + if (src.hasBasis()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) { + tgt.setMitigation(src.getMitigation()); + } return tgt; } @@ -44,11 +80,21 @@ public class RiskAssessment10_40 { return null; org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); - tgt.setProbability(VersionConvertor_10_40.convertType(src.getProbability())); - tgt.setRelativeRisk(src.getRelativeRisk()); - tgt.setWhen(VersionConvertor_10_40.convertType(src.getWhen())); - tgt.setRationale(src.getRationale()); + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); + } + if (src.hasProbability()) { + tgt.setProbability(VersionConvertor_10_40.convertType(src.getProbability())); + } + if (src.hasRelativeRisk()) { + tgt.setRelativeRisk(src.getRelativeRisk()); + } + if (src.hasWhen()) { + tgt.setWhen(VersionConvertor_10_40.convertType(src.getWhen())); + } + if (src.hasRationale()) { + tgt.setRationale(src.getRationale()); + } return tgt; } @@ -57,11 +103,21 @@ public class RiskAssessment10_40 { return null; org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); - tgt.setProbability(VersionConvertor_10_40.convertType(src.getProbability())); - tgt.setRelativeRisk(src.getRelativeRisk()); - tgt.setWhen(VersionConvertor_10_40.convertType(src.getWhen())); - tgt.setRationale(src.getRationale()); + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_40.convertCodeableConcept(src.getOutcome())); + } + if (src.hasProbability()) { + tgt.setProbability(VersionConvertor_10_40.convertType(src.getProbability())); + } + if (src.hasRelativeRisk()) { + tgt.setRelativeRisk(src.getRelativeRisk()); + } + if (src.hasWhen()) { + tgt.setWhen(VersionConvertor_10_40.convertType(src.getWhen())); + } + if (src.hasRationale()) { + tgt.setRationale(src.getRationale()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Schedule10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Schedule10_40.java index 300abde75..c9991bcf2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Schedule10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Schedule10_40.java @@ -10,11 +10,21 @@ public class Schedule10_40 { return null; org.hl7.fhir.r4.model.Schedule tgt = new org.hl7.fhir.r4.model.Schedule(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addServiceType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.addActor(VersionConvertor_10_40.convertReference(src.getActor())); - tgt.setPlanningHorizon(VersionConvertor_10_40.convertPeriod(src.getPlanningHorizon())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addServiceType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.addActor(VersionConvertor_10_40.convertReference(src.getActor())); + } + if (src.hasPlanningHorizon()) { + tgt.setPlanningHorizon(VersionConvertor_10_40.convertPeriod(src.getPlanningHorizon())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -23,11 +33,21 @@ public class Schedule10_40 { return null; org.hl7.fhir.dstu2.model.Schedule tgt = new org.hl7.fhir.dstu2.model.Schedule(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_40.convertReference(src.getActorFirstRep())); - tgt.setPlanningHorizon(VersionConvertor_10_40.convertPeriod(src.getPlanningHorizon())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_40.convertReference(src.getActorFirstRep())); + } + if (src.hasPlanningHorizon()) { + tgt.setPlanningHorizon(VersionConvertor_10_40.convertPeriod(src.getPlanningHorizon())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SearchParameter10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SearchParameter10_40.java index 9ce6e5261..11dfb5a37 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SearchParameter10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SearchParameter10_40.java @@ -11,24 +11,52 @@ public class SearchParameter10_40 { return null; org.hl7.fhir.dstu2.model.SearchParameter tgt = new org.hl7.fhir.dstu2.model.SearchParameter(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); - tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); - org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression()); - tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasExpression()) { + org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression()); + } + if (src.hasXpath()) { + tgt.setXpath(src.getXpath()); + } + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -37,24 +65,50 @@ public class SearchParameter10_40 { return null; org.hl7.fhir.r4.model.SearchParameter tgt = new org.hl7.fhir.r4.model.SearchParameter(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCode(src.getCode()); - tgt.addBase(src.getBase()); - tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + tgt.addBase(src.getBase()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } tgt.setExpression(ToolingExtensions.readStringExtension(src, ToolingExtensions.EXT_EXPRESSION)); - tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpath()) { + tgt.setXpath(src.getXpath()); + } + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -63,8 +117,12 @@ public class SearchParameter10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -73,8 +131,12 @@ public class SearchParameter10_40 { return null; org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent tgt = new org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Slot10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Slot10_40.java index 791ec40f5..947d61764 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Slot10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Slot10_40.java @@ -10,14 +10,26 @@ public class Slot10_40 { return null; org.hl7.fhir.r4.model.Slot tgt = new org.hl7.fhir.r4.model.Slot(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } if (src.hasType()) tgt.addServiceType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setSchedule(VersionConvertor_10_40.convertReference(src.getSchedule())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setOverbooked(src.getOverbooked()); - tgt.setComment(src.getComment()); + if (src.hasSchedule()) { + tgt.setSchedule(VersionConvertor_10_40.convertReference(src.getSchedule())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasOverbooked()) { + tgt.setOverbooked(src.getOverbooked()); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -26,13 +38,27 @@ public class Slot10_40 { return null; org.hl7.fhir.dstu2.model.Slot tgt = new org.hl7.fhir.dstu2.model.Slot(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setSchedule(VersionConvertor_10_40.convertReference(src.getSchedule())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setOverbooked(src.getOverbooked()); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasSchedule()) { + tgt.setSchedule(VersionConvertor_10_40.convertReference(src.getSchedule())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasOverbooked()) { + tgt.setOverbooked(src.getOverbooked()); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/StructureDefinition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/StructureDefinition10_40.java index d567e16fd..cf3a58a21 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/StructureDefinition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/StructureDefinition10_40.java @@ -6,7 +6,6 @@ import org.hl7.fhir.r4.model.ElementDefinition; import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.utilities.Utilities; - import java.util.ArrayList; import java.util.List; @@ -52,33 +51,67 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.r4.model.StructureDefinition tgt = new org.hl7.fhir.r4.model.StructureDefinition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setTitle(src.getDisplay()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDisplay()) { + tgt.setTitle(src.getDisplay()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_40.convertCodeableConceptToUsageContext(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_10_40.convertCoding(t)); - tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind(), tgt.getId())); - tgt.setAbstract(src.getAbstract()); + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasCode()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_10_40.convertCoding(t)); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind(), tgt.getId())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.dstu2.model.StringType t : src.getContext()) { org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent ec = tgt.addContext(); - ec.setType(convertExtensionContext(src.getContextType())); + if (src.hasContextType()) { + ec.setType(convertExtensionContext(src.getContextType())); + } ec.setExpression("*".equals(t.getValue()) ? "Element" : t.getValue()); } if (src.hasConstrainedType()) @@ -89,10 +122,16 @@ public class StructureDefinition10_40 { tgt.setType(src.getDifferential().getElement().get(0).getPath()); else tgt.setType(src.getDifferential().getElement().get(0).getPath().substring(0, src.getDifferential().getElement().get(0).getPath().indexOf("."))); - tgt.setBaseDefinition(src.getBase()); + if (src.hasBase()) { + tgt.setBaseDefinition(src.getBase()); + } tgt.setDerivation(src.hasConstrainedType() ? org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT : org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } if (tgt.hasSnapshot()) tgt.getSnapshot().getElementFirstRep().getType().clear(); if (tgt.hasDifferential()) @@ -117,39 +156,79 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.dstu2.model.StructureDefinition tgt = new org.hl7.fhir.dstu2.model.StructureDefinition(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setDisplay(src.getTitle()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTitle()) { + tgt.setDisplay(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_10_40.convertCoding(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKeyword()) { + for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_10_40.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); - for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - tgt.setAbstract(src.getAbstract()); + if (src.hasMapping()) { + for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) { if (!tgt.hasContextType()) tgt.setContextType(convertExtensionContext(t.getType(), t.getExpression())); tgt.addContext("Element".equals(t.getExpression()) ? "*" : t.getExpression()); } - tgt.setConstrainedType(src.getType()); - tgt.setBase(src.getBaseDefinition()); - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasType()) { + tgt.setConstrainedType(src.getType()); + } + if (src.hasBaseDefinition()) { + tgt.setBase(src.getBaseDefinition()); + } + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } if (tgt.hasBase()) { if (tgt.hasDifferential()) tgt.getDifferential().getElement().get(0).addType().setCode(tail(tgt.getBase())); @@ -164,8 +243,12 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -174,8 +257,12 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -188,7 +275,9 @@ public class StructureDefinition10_40 { for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); - tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + } } return tgt; } @@ -198,7 +287,9 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t)); + } return tgt; } @@ -242,10 +333,18 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComments(src.getComment()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } return tgt; } @@ -254,10 +353,18 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComment(src.getComments()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } return tgt; } @@ -270,7 +377,9 @@ public class StructureDefinition10_40 { for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); - tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + } } return tgt; } @@ -280,7 +389,9 @@ public class StructureDefinition10_40 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_40.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Subscription10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Subscription10_40.java index d68064679..27e4401a0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Subscription10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Subscription10_40.java @@ -10,13 +10,27 @@ public class Subscription10_40 { return null; org.hl7.fhir.r4.model.Subscription tgt = new org.hl7.fhir.r4.model.Subscription(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setCriteria(src.getCriteria()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setReason(src.getReason()); - tgt.setStatus(convertSubscriptionStatus(src.getStatus())); - tgt.setError(src.getError()); - tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); - tgt.setEnd(src.getEnd()); + if (src.hasCriteria()) { + tgt.setCriteria(src.getCriteria()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasReason()) { + tgt.setReason(src.getReason()); + } + if (src.hasStatus()) { + tgt.setStatus(convertSubscriptionStatus(src.getStatus())); + } + if (src.hasError()) { + tgt.setError(src.getError()); + } + if (src.hasChannel()) { + tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } return tgt; } @@ -25,13 +39,27 @@ public class Subscription10_40 { return null; org.hl7.fhir.dstu2.model.Subscription tgt = new org.hl7.fhir.dstu2.model.Subscription(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setCriteria(src.getCriteria()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_40.convertContactPoint(t)); - tgt.setReason(src.getReason()); - tgt.setStatus(convertSubscriptionStatus(src.getStatus())); - tgt.setError(src.getError()); - tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); - tgt.setEnd(src.getEnd()); + if (src.hasCriteria()) { + tgt.setCriteria(src.getCriteria()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_10_40.convertContactPoint(t)); + } + if (src.hasReason()) { + tgt.setReason(src.getReason()); + } + if (src.hasStatus()) { + tgt.setStatus(convertSubscriptionStatus(src.getStatus())); + } + if (src.hasError()) { + tgt.setError(src.getError()); + } + if (src.hasChannel()) { + tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } return tgt; } @@ -40,10 +68,18 @@ public class Subscription10_40 { return null; org.hl7.fhir.r4.model.Subscription.SubscriptionChannelComponent tgt = new org.hl7.fhir.r4.model.Subscription.SubscriptionChannelComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(convertSubscriptionChannelType(src.getType())); - tgt.setEndpoint(src.getEndpoint()); - tgt.setPayload(src.getPayload()); - tgt.addHeader(src.getHeader()); + if (src.hasType()) { + tgt.setType(convertSubscriptionChannelType(src.getType())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } + if (src.hasPayload()) { + tgt.setPayload(src.getPayload()); + } + if (src.hasHeader()) { + tgt.addHeader(src.getHeader()); + } return tgt; } @@ -52,9 +88,15 @@ public class Subscription10_40 { return null; org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent tgt = new org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(convertSubscriptionChannelType(src.getType())); - tgt.setEndpoint(src.getEndpoint()); - tgt.setPayload(src.getPayload()); + if (src.hasType()) { + tgt.setType(convertSubscriptionChannelType(src.getType())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } + if (src.hasPayload()) { + tgt.setPayload(src.getPayload()); + } if (src.hasHeader()) tgt.setHeaderElement(VersionConvertor_10_40.convertString(src.getHeader().get(0))); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Substance10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Substance10_40.java index ba9bb20b9..23c9b4e1d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Substance10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/Substance10_40.java @@ -10,12 +10,24 @@ public class Substance10_40 { return null; org.hl7.fhir.r4.model.Substance tgt = new org.hl7.fhir.r4.model.Substance(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -24,12 +36,24 @@ public class Substance10_40 { return null; org.hl7.fhir.dstu2.model.Substance tgt = new org.hl7.fhir.dstu2.model.Substance(); VersionConvertor_10_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_40.convertCodeableConcept(src.getCode())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -38,7 +62,9 @@ public class Substance10_40 { return null; org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setQuantity(VersionConvertor_10_40.convertRatio(src.getQuantity())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertRatio(src.getQuantity())); + } return tgt; } @@ -47,8 +73,12 @@ public class Substance10_40 { return null; org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setQuantity(VersionConvertor_10_40.convertRatio(src.getQuantity())); - tgt.setSubstance(VersionConvertor_10_40.convertReference(src.getSubstance())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertRatio(src.getQuantity())); + } + if (src.hasSubstance()) { + tgt.setSubstance(VersionConvertor_10_40.convertReference(src.getSubstance())); + } return tgt; } @@ -57,9 +87,15 @@ public class Substance10_40 { return null; org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setExpiry(src.getExpiry()); - tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasExpiry()) { + tgt.setExpiry(src.getExpiry()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + } return tgt; } @@ -68,9 +104,15 @@ public class Substance10_40 { return null; org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setExpiry(src.getExpiry()); - tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasExpiry()) { + tgt.setExpiry(src.getExpiry()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_40.convertSimpleQuantity(src.getQuantity())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SupplyDelivery10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SupplyDelivery10_40.java index b1e3889b0..5bc364e02 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SupplyDelivery10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/SupplyDelivery10_40.java @@ -10,13 +10,27 @@ public class SupplyDelivery10_40 { return null; org.hl7.fhir.dstu2.model.SupplyDelivery tgt = new org.hl7.fhir.dstu2.model.SupplyDelivery(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setSupplier(VersionConvertor_10_40.convertReference(src.getSupplier())); - tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); - for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasStatus()) { + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasSupplier()) { + tgt.setSupplier(VersionConvertor_10_40.convertReference(src.getSupplier())); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); + } return tgt; } @@ -25,13 +39,27 @@ public class SupplyDelivery10_40 { return null; org.hl7.fhir.r4.model.SupplyDelivery tgt = new org.hl7.fhir.r4.model.SupplyDelivery(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); - tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); - tgt.setSupplier(VersionConvertor_10_40.convertReference(src.getSupplier())); - tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasStatus()) { + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_40.convertReference(src.getPatient())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCodeableConcept(src.getType())); + } + if (src.hasSupplier()) { + tgt.setSupplier(VersionConvertor_10_40.convertReference(src.getSupplier())); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_40.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/TestScript10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/TestScript10_40.java index 322b29a02..016926092 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/TestScript10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/TestScript10_40.java @@ -183,24 +183,60 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - tgt.setCompareToSourceId(src.getCompareToSourceId()); - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setHeaderField(src.getHeaderField()); - tgt.setMinimumId(src.getMinimumId()); - tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - tgt.setPath(src.getPath()); - tgt.setResource(src.getResource()); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - tgt.setResponseCode(src.getResponseCode()); - tgt.setSourceId(src.getSourceId()); - tgt.setValidateProfileId(src.getValidateProfileId()); - tgt.setValue(src.getValue()); - tgt.setWarningOnly(src.getWarningOnly()); + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } + if (src.hasCompareToSourceId()) { + tgt.setCompareToSourceId(src.getCompareToSourceId()); + } + if (src.hasCompareToSourcePath()) { + tgt.setCompareToSourcePath(src.getCompareToSourcePath()); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasMinimumId()) { + tgt.setMinimumId(src.getMinimumId()); + } + if (src.hasNavigationLinks()) { + tgt.setNavigationLinks(src.getNavigationLinks()); + } + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } + if (src.hasResponseCode()) { + tgt.setResponseCode(src.getResponseCode()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasValidateProfileId()) { + tgt.setValidateProfileId(src.getValidateProfileId()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasWarningOnly()) { + tgt.setWarningOnly(src.getWarningOnly()); + } return tgt; } @@ -209,24 +245,60 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - tgt.setCompareToSourceId(src.getCompareToSourceId()); - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setHeaderField(src.getHeaderField()); - tgt.setMinimumId(src.getMinimumId()); - tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - tgt.setPath(src.getPath()); - tgt.setResource(src.getResource()); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - tgt.setResponseCode(src.getResponseCode()); - tgt.setSourceId(src.getSourceId()); - tgt.setValidateProfileId(src.getValidateProfileId()); - tgt.setValue(src.getValue()); - tgt.setWarningOnly(src.getWarningOnly()); + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } + if (src.hasCompareToSourceId()) { + tgt.setCompareToSourceId(src.getCompareToSourceId()); + } + if (src.hasCompareToSourcePath()) { + tgt.setCompareToSourcePath(src.getCompareToSourcePath()); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasMinimumId()) { + tgt.setMinimumId(src.getMinimumId()); + } + if (src.hasNavigationLinks()) { + tgt.setNavigationLinks(src.getNavigationLinks()); + } + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } + if (src.hasResponseCode()) { + tgt.setResponseCode(src.getResponseCode()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasValidateProfileId()) { + tgt.setValidateProfileId(src.getValidateProfileId()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasWarningOnly()) { + tgt.setWarningOnly(src.getWarningOnly()); + } return tgt; } @@ -235,8 +307,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -245,8 +321,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -255,20 +335,48 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); - tgt.setResource(src.getResource()); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setDestination(src.getDestination()); - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - tgt.setParams(src.getParams()); - for (org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - tgt.setResponseId(src.getResponseId()); - tgt.setSourceId(src.getSourceId()); - tgt.setTargetId(src.getTargetId()); - tgt.setUrl(src.getUrl()); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasEncodeRequestUrl()) { + tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); + } + if (src.hasParams()) { + tgt.setParams(src.getParams()); + } + if (src.hasRequestHeader()) { + for (org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasResponseId()) { + tgt.setResponseId(src.getResponseId()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasTargetId()) { + tgt.setTargetId(src.getTargetId()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -277,20 +385,48 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); - tgt.setResource(src.getResource()); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setDestination(src.getDestination()); - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - tgt.setParams(src.getParams()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - tgt.setResponseId(src.getResponseId()); - tgt.setSourceId(src.getSourceId()); - tgt.setTargetId(src.getTargetId()); - tgt.setUrl(src.getUrl()); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_40.convertCoding(src.getType())); + } + if (src.hasResource()) { + tgt.setResource(src.getResource()); + } + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasEncodeRequestUrl()) { + tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); + } + if (src.hasParams()) { + tgt.setParams(src.getParams()); + } + if (src.hasRequestHeader()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasResponseId()) { + tgt.setResponseId(src.getResponseId()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasTargetId()) { + tgt.setTargetId(src.getTargetId()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -299,8 +435,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -309,8 +449,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -319,7 +463,9 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -328,7 +474,9 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TeardownActionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -337,8 +485,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -347,8 +499,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestActionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -357,30 +513,66 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript tgt = new org.hl7.fhir.dstu2.model.TestScript(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_40.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -389,31 +581,65 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript tgt = new org.hl7.fhir.r4.model.TestScript(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_40.convertCodeableConceptToUsageContext(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_40.convertReference(t)); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_40.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -422,8 +648,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -432,8 +662,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -442,9 +676,15 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAutocreate(src.getAutocreate()); - tgt.setAutodelete(src.getAutodelete()); - tgt.setResource(VersionConvertor_10_40.convertReference(src.getResource())); + if (src.hasAutocreate()) { + tgt.setAutocreate(src.getAutocreate()); + } + if (src.hasAutodelete()) { + tgt.setAutodelete(src.getAutodelete()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_40.convertReference(src.getResource())); + } return tgt; } @@ -453,9 +693,15 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setAutocreate(src.getAutocreate()); - tgt.setAutodelete(src.getAutodelete()); - tgt.setResource(VersionConvertor_10_40.convertReference(src.getResource())); + if (src.hasAutocreate()) { + tgt.setAutocreate(src.getAutocreate()); + } + if (src.hasAutodelete()) { + tgt.setAutodelete(src.getAutodelete()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_40.convertReference(src.getResource())); + } return tgt; } @@ -464,12 +710,24 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setRequired(src.getRequired()); - tgt.setValidated(src.getValidated()); - tgt.setDescription(src.getDescription()); - tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.r4.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setConformance(VersionConvertor_10_40.convertCanonicalToReference(src.getCapabilitiesElement())); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasValidated()) { + tgt.setValidated(src.getValidated()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasCapabilitiesElement()) { + tgt.setConformance(VersionConvertor_10_40.convertCanonicalToReference(src.getCapabilitiesElement())); + } return tgt; } @@ -478,12 +736,24 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setRequired(src.getRequired()); - tgt.setValidated(src.getValidated()); - tgt.setDescription(src.getDescription()); - tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setCapabilitiesElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getConformance())); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasValidated()) { + tgt.setValidated(src.getValidated()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasConformance()) { + tgt.setCapabilitiesElement(VersionConvertor_10_40.convertReferenceToCanonical(src.getConformance())); + } return tgt; } @@ -492,8 +762,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -502,8 +776,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -512,8 +790,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setDescription(src.getDescription()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -522,8 +804,12 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setDescription(src.getDescription()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -532,7 +818,9 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -541,7 +829,9 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -550,7 +840,9 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -559,7 +851,9 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -568,9 +862,15 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -579,9 +879,15 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -590,10 +896,18 @@ public class TestScript10_40 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setHeaderField(src.getHeaderField()); - tgt.setPath(src.getPath()); - tgt.setSourceId(src.getSourceId()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } return tgt; } @@ -602,10 +916,18 @@ public class TestScript10_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setHeaderField(src.getHeaderField()); - tgt.setPath(src.getPath()); - tgt.setSourceId(src.getSourceId()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ValueSet10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ValueSet10_40.java index be9b2de66..dd7a231cf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ValueSet10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/ValueSet10_40.java @@ -8,7 +8,6 @@ import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode; import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.r4.terminologies.CodeSystemUtilities; - import java.util.List; public class ValueSet10_40 { @@ -18,9 +17,15 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -29,9 +34,15 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -40,9 +51,15 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_10_40.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasLanguage()) { + tgt.setLanguage(src.getLanguage()); + } + if (src.hasUse()) { + tgt.setUse(VersionConvertor_10_40.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -51,9 +68,15 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_10_40.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasLanguage()) { + tgt.setLanguage(src.getLanguage()); + } + if (src.hasUse()) { + tgt.setUse(VersionConvertor_10_40.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -62,10 +85,18 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -74,10 +105,18 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -86,9 +125,15 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -97,9 +142,15 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -154,60 +205,112 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet tgt = new org.hl7.fhir.r4.model.ValueSet(); VersionConvertor_10_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_40.convertCodeableConceptToUsageContext(t)); - tgt.setImmutable(src.getImmutable()); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); + if (src.hasImmutable()) { + tgt.setImmutable(src.getImmutable()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } if (src.hasExtensible()) tgt.addExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible", new BooleanType(src.getExtensible())); if (src.hasCompose()) { - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); - tgt.getCompose().setLockedDate(src.getLockedDate()); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } + if (src.hasLockedDate()) { + tgt.getCompose().setLockedDate(src.getLockedDate()); + } } if (src.hasCodeSystem() && advisor != null) { org.hl7.fhir.r4.model.CodeSystem tgtcs = new org.hl7.fhir.r4.model.CodeSystem(); VersionConvertor_10_40.copyDomainResource(src, tgtcs); - tgtcs.setUrl(src.getCodeSystem().getSystem()); - tgtcs.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); - tgtcs.setVersion(src.getCodeSystem().getVersion()); - tgtcs.setName(src.getName() + " Code System"); - tgtcs.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasCodeSystem()) { + tgtcs.setUrl(src.getCodeSystem().getSystem()); + } + if (src.hasIdentifier()) { + tgtcs.addIdentifier(VersionConvertor_10_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasCodeSystem()) { + tgtcs.setVersion(src.getCodeSystem().getVersion()); + } + if (src.hasName()) { + tgtcs.setName(src.getName() + " Code System"); + } + if (src.hasStatus()) { + tgtcs.setStatus(VersionConvertor_10_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgtcs.setExperimental(src.getExperimental()); - tgtcs.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgtcs.addContact(convertValueSetContactComponent(t)); + if (src.hasPublisher()) { + tgtcs.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgtcs.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgtcs.setDate(src.getDate()); - tgtcs.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgtcs.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_40.isJurisdiction(t)) tgtcs.addJurisdiction(VersionConvertor_10_40.convertCodeableConcept(t)); else tgtcs.addUseContext(VersionConvertor_10_40.convertCodeableConceptToUsageContext(t)); - tgtcs.setPurpose(src.getRequirements()); - tgtcs.setCopyright(src.getCopyright()); + if (src.hasRequirements()) { + tgtcs.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgtcs.setCopyright(src.getCopyright()); + } tgtcs.setContent(CodeSystemContentMode.COMPLETE); - tgtcs.setCaseSensitive(src.getCodeSystem().getCaseSensitive()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs : src.getCodeSystem().getConcept()) processConcept(tgtcs.getConcept(), cs, tgtcs); + if (src.hasCodeSystem()) { + tgtcs.setCaseSensitive(src.getCodeSystem().getCaseSensitive()); + } + if (src.hasCodeSystem()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs : src.getCodeSystem().getConcept()) processConcept(tgtcs.getConcept(), cs, tgtcs); + } advisor.handleCodeSystem(tgtcs, tgt); tgt.setUserData("r2-cs", tgtcs); tgt.getCompose().addInclude().setSystem(tgtcs.getUrl()); } - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + if (src.hasExpansion()) { + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + } return tgt; } @@ -265,7 +368,9 @@ public class ValueSet10_40 { if (noSystem == null || !t.getSystem().equals(noSystem)) tgt.addInclude(convertConceptSetComponent(t)); } - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasExclude()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -274,9 +379,15 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent(); VersionConvertor_10_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasImport()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); + } + if (src.hasInclude()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -285,8 +396,12 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ContactDetail tgt = new org.hl7.fhir.r4.model.ContactDetail(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -295,8 +410,12 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_40.convertContactPoint(t)); + } return tgt; } @@ -305,12 +424,24 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); - tgt.setTotal(src.getTotal()); - tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasTotal()) { + tgt.setTotal(src.getTotal()); + } + if (src.hasOffset()) { + tgt.setOffset(src.getOffset()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -319,12 +450,24 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); - tgt.setTotal(src.getTotal()); - tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasTotal()) { + tgt.setTotal(src.getTotal()); + } + if (src.hasOffset()) { + tgt.setOffset(src.getOffset()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -333,12 +476,24 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setAbstract(src.getAbstract()); - tgt.setVersion(src.getVersion()); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -347,12 +502,24 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setAbstract(src.getAbstract()); - tgt.setVersion(src.getVersion()); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -361,8 +528,12 @@ public class ValueSet10_40 { return null; org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } return tgt; } @@ -371,8 +542,12 @@ public class ValueSet10_40 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_10_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_40.convertType(src.getValue())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Appointment10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Appointment10_50.java index d9fa59ce6..ea3eede32 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Appointment10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Appointment10_50.java @@ -10,17 +10,39 @@ public class Appointment10_50 { return null; org.hl7.fhir.dstu2.model.Appointment tgt = new org.hl7.fhir.dstu2.model.Appointment(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertAppointmentStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPriority(src.getPriority()); - tgt.setDescription(src.getDescription()); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_50.convertReference(t)); - tgt.setComment(src.getComment()); - for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(src.getPriority()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasMinutesDuration()) { + tgt.setMinutesDuration(src.getMinutesDuration()); + } + if (src.hasSlot()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } return tgt; } @@ -29,18 +51,38 @@ public class Appointment10_50 { return null; org.hl7.fhir.r5.model.Appointment tgt = new org.hl7.fhir.r5.model.Appointment(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertAppointmentStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + } if (src.hasType()) tgt.addServiceType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setPriority(src.getPriority()); - tgt.setDescription(src.getDescription()); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_50.convertReference(t)); - tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + if (src.hasPriority()) { + tgt.setPriority(src.getPriority()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasMinutesDuration()) { + tgt.setMinutesDuration(src.getMinutesDuration()); + } + if (src.hasSlot()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } return tgt; } @@ -49,10 +91,18 @@ public class Appointment10_50 { return null; org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); - tgt.setRequired(convertParticipantRequired(src.getRequired())); - tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); + } + if (src.hasRequired()) { + tgt.setRequired(convertParticipantRequired(src.getRequired())); + } + if (src.hasStatus()) { + tgt.setStatus(convertParticipationStatus(src.getStatus())); + } return tgt; } @@ -61,10 +111,18 @@ public class Appointment10_50 { return null; org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); - tgt.setRequired(convertParticipantRequired(src.getRequired())); - tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); + } + if (src.hasRequired()) { + tgt.setRequired(convertParticipantRequired(src.getRequired())); + } + if (src.hasStatus()) { + tgt.setStatus(convertParticipationStatus(src.getStatus())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AppointmentResponse10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AppointmentResponse10_50.java index 0e10c8a31..0171dd0f7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AppointmentResponse10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AppointmentResponse10_50.java @@ -10,14 +10,30 @@ public class AppointmentResponse10_50 { return null; org.hl7.fhir.dstu2.model.AppointmentResponse tgt = new org.hl7.fhir.dstu2.model.AppointmentResponse(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setAppointment(VersionConvertor_10_50.convertReference(src.getAppointment())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_50.convertReference(src.getAppointment())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasParticipantType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); + } + if (src.hasParticipantStatus()) { + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -26,14 +42,30 @@ public class AppointmentResponse10_50 { return null; org.hl7.fhir.r5.model.AppointmentResponse tgt = new org.hl7.fhir.r5.model.AppointmentResponse(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setAppointment(VersionConvertor_10_50.convertReference(src.getAppointment())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_50.convertReference(src.getAppointment())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasParticipantType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_50.convertReference(src.getActor())); + } + if (src.hasParticipantStatus()) { + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AuditEvent10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AuditEvent10_50.java index 55f02e206..1dfebb9b7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AuditEvent10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/AuditEvent10_50.java @@ -10,16 +10,36 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.dstu2.model.AuditEvent tgt = new org.hl7.fhir.dstu2.model.AuditEvent(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.getEvent().setType(VersionConvertor_10_50.convertCoding(src.getType())); - for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(VersionConvertor_10_50.convertCoding(t)); - tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); - tgt.getEvent().setDateTime(src.getRecorded()); - tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); - tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.r5.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(VersionConvertor_10_50.convertCoding(cc)); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t)); - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t)); + if (src.hasType()) { + tgt.getEvent().setType(VersionConvertor_10_50.convertCoding(src.getType())); + } + if (src.hasSubtype()) { + for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasAction()) { + tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); + } + if (src.hasRecorded()) { + tgt.getEvent().setDateTime(src.getRecorded()); + } + if (src.hasOutcome()) { + tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); + } + if (src.hasOutcomeDesc()) { + tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); + } + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.r5.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(VersionConvertor_10_50.convertCoding(cc)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) { + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + } + if (src.hasEntity()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t)); + } return tgt; } @@ -29,17 +49,37 @@ public class AuditEvent10_50 { org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent(); VersionConvertor_10_50.copyDomainResource(src, tgt); if (src.hasEvent()) { - tgt.setType(VersionConvertor_10_50.convertCoding(src.getEvent().getType())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(VersionConvertor_10_50.convertCoding(t)); - tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); - tgt.setRecorded(src.getEvent().getDateTime()); - tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); - tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(VersionConvertor_10_50.convertCoding(t)); + if (src.hasEvent()) { + tgt.setType(VersionConvertor_10_50.convertCoding(src.getEvent().getType())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasEvent()) { + tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); + } + if (src.hasEvent()) { + tgt.setRecorded(src.getEvent().getDateTime()); + } + if (src.hasEvent()) { + tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); + } + if (src.hasEvent()) { + tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(VersionConvertor_10_50.convertCoding(t)); + } + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) { + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + } + if (src.hasObject()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t)); } - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t)); - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t)); return tgt; } @@ -86,21 +126,39 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasRole()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_50.convertCodeableConcept(t)); + } if (src.hasWho()) { if (src.getWho().hasIdentifier()) tgt.setUserId(VersionConvertor_10_50.convertIdentifier(src.getWho().getIdentifier())); if (src.getWho().hasReference() || src.getWho().hasDisplay() || src.getWho().hasExtension() || src.getWho().hasId()) tgt.setReference(VersionConvertor_10_50.convertReference(src.getWho())); } - tgt.setAltId(src.getAltId()); - tgt.setName(src.getName()); - tgt.setRequestor(src.getRequestor()); - tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - tgt.setMedia(VersionConvertor_10_50.convertCoding(src.getMedia())); - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.r5.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(VersionConvertor_10_50.convertCoding(cc)); + if (src.hasAltId()) { + tgt.setAltId(src.getAltId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRequestor()) { + tgt.setRequestor(src.getRequestor()); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasMedia()) { + tgt.setMedia(VersionConvertor_10_50.convertCoding(src.getMedia())); + } + if (src.hasNetwork()) { + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + } + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.r5.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(VersionConvertor_10_50.convertCoding(cc)); + } return tgt; } @@ -109,18 +167,38 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setWho(VersionConvertor_10_50.convertReference(src.getReference())); + if (src.hasRole()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasReference()) { + tgt.setWho(VersionConvertor_10_50.convertReference(src.getReference())); + } if (src.hasUserId()) tgt.getWho().setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getUserId())); - tgt.setAltId(src.getAltId()); - tgt.setName(src.getName()); - tgt.setRequestor(src.getRequestor()); - tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); - tgt.setMedia(VersionConvertor_10_50.convertCoding(src.getMedia())); - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(VersionConvertor_10_50.convertCoding(t)); + if (src.hasAltId()) { + tgt.setAltId(src.getAltId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRequestor()) { + tgt.setRequestor(src.getRequestor()); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); + } + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } + if (src.hasMedia()) { + tgt.setMedia(VersionConvertor_10_50.convertCoding(src.getMedia())); + } + if (src.hasNetwork()) { + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + } + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(VersionConvertor_10_50.convertCoding(t)); + } return tgt; } @@ -129,8 +207,12 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAddress(src.getAddress()); - tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } + if (src.hasType()) { + tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + } return tgt; } @@ -139,8 +221,12 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAddress(src.getAddress()); - tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } + if (src.hasType()) { + tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); + } return tgt; } @@ -153,13 +239,27 @@ public class AuditEvent10_50 { tgt.getWhat().setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); if (src.hasReference()) tgt.setWhat(VersionConvertor_10_50.convertReference(src.getReference())); - tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); - tgt.setRole(VersionConvertor_10_50.convertCoding(src.getRole())); - tgt.setLifecycle(VersionConvertor_10_50.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCoding(t)); - tgt.setName(src.getName()); - tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_50.convertCoding(src.getRole())); + } + if (src.hasLifecycle()) { + tgt.setLifecycle(VersionConvertor_10_50.convertCoding(src.getLifecycle())); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuery()) { + tgt.setQuery(src.getQuery()); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -174,13 +274,27 @@ public class AuditEvent10_50 { if (src.getWhat().hasReference() || src.getWhat().hasDisplay() || src.getWhat().hasExtension() || src.getWhat().hasId()) tgt.setReference(VersionConvertor_10_50.convertReference(src.getWhat())); } - tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); - tgt.setRole(VersionConvertor_10_50.convertCoding(src.getRole())); - tgt.setLifecycle(VersionConvertor_10_50.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCoding(t)); - tgt.setName(src.getName()); - tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); + } + if (src.hasRole()) { + tgt.setRole(VersionConvertor_10_50.convertCoding(src.getRole())); + } + if (src.hasLifecycle()) { + tgt.setLifecycle(VersionConvertor_10_50.convertCoding(src.getLifecycle())); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuery()) { + tgt.setQuery(src.getQuery()); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -189,7 +303,9 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } if (src.hasValue()) tgt.setValue(new org.hl7.fhir.r5.model.Base64BinaryType(src.getValue())); return tgt; @@ -200,7 +316,9 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } if (src.hasValueStringType()) tgt.setValue(src.getValueStringType().getValue().getBytes()); else if (src.hasValueBase64BinaryType()) @@ -285,10 +403,14 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSite(src.getSite()); + if (src.hasSite()) { + tgt.setSite(src.getSite()); + } if (src.hasObserver()) tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getObserver().getIdentifier())); - for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCoding(t)); + } return tgt; } @@ -297,10 +419,14 @@ public class AuditEvent10_50 { return null; org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSite(src.getSite()); + if (src.hasSite()) { + tgt.setSite(src.getSite()); + } if (src.hasIdentifier()) tgt.getObserver().setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCoding(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Basic10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Basic10_50.java index cb3e19fe9..afc3f186e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Basic10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Basic10_50.java @@ -10,11 +10,21 @@ public class Basic10_50 { return null; org.hl7.fhir.r5.model.Basic tgt = new org.hl7.fhir.r5.model.Basic(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setCreated(src.getCreated()); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } return tgt; } @@ -23,11 +33,21 @@ public class Basic10_50 { return null; org.hl7.fhir.dstu2.model.Basic tgt = new org.hl7.fhir.dstu2.model.Basic(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setCreated(src.getCreated()); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Binary10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Binary10_50.java index d951416c7..bd2235066 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Binary10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Binary10_50.java @@ -10,8 +10,12 @@ public class Binary10_50 { return null; org.hl7.fhir.r5.model.Binary tgt = new org.hl7.fhir.r5.model.Binary(); VersionConvertor_10_50.copyResource(src, tgt); - tgt.setContentType(src.getContentType()); - tgt.setContent(src.getContent()); + if (src.hasContentType()) { + tgt.setContentType(src.getContentType()); + } + if (src.hasContent()) { + tgt.setContent(src.getContent()); + } return tgt; } @@ -20,7 +24,9 @@ public class Binary10_50 { return null; org.hl7.fhir.dstu2.model.Binary tgt = new org.hl7.fhir.dstu2.model.Binary(); VersionConvertor_10_50.copyResource(src, tgt); - tgt.setContentType(src.getContentType()); + if (src.hasContentType()) { + tgt.setContentType(src.getContentType()); + } tgt.setContent(src.getContent()); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50.java index 682047ce8..4e10f1f59 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50.java @@ -11,12 +11,20 @@ public class Bundle10_50 { return null; org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle(); VersionConvertor_10_50.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_10_50.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_10_50.convertSignature(src.getSignature())); + } return tgt; } @@ -29,11 +37,17 @@ public class Bundle10_50 { return null; org.hl7.fhir.dstu2.model.Bundle tgt = new org.hl7.fhir.dstu2.model.Bundle(); VersionConvertor_10_50.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t, advisor)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t, advisor)); + } if (src.hasSignature()) tgt.setSignature(VersionConvertor_10_50.convertSignature(src.getSignature())); return tgt; @@ -44,12 +58,24 @@ public class Bundle10_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_10_50.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasFullUrl()) { + tgt.setFullUrl(src.getFullUrl()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_50.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -84,12 +110,24 @@ public class Bundle10_50 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); - tgt.setIfNoneMatch(src.getIfNoneMatch()); - tgt.setIfModifiedSince(src.getIfModifiedSince()); - tgt.setIfMatch(src.getIfMatch()); - tgt.setIfNoneExist(src.getIfNoneExist()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIfNoneMatch()) { + tgt.setIfNoneMatch(src.getIfNoneMatch()); + } + if (src.hasIfModifiedSince()) { + tgt.setIfModifiedSince(src.getIfModifiedSince()); + } + if (src.hasIfMatch()) { + tgt.setIfMatch(src.getIfMatch()); + } + if (src.hasIfNoneExist()) { + tgt.setIfNoneExist(src.getIfNoneExist()); + } return tgt; } @@ -98,12 +136,24 @@ public class Bundle10_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); - tgt.setIfNoneMatch(src.getIfNoneMatch()); - tgt.setIfModifiedSince(src.getIfModifiedSince()); - tgt.setIfMatch(src.getIfMatch()); - tgt.setIfNoneExist(src.getIfNoneExist()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIfNoneMatch()) { + tgt.setIfNoneMatch(src.getIfNoneMatch()); + } + if (src.hasIfModifiedSince()) { + tgt.setIfModifiedSince(src.getIfModifiedSince()); + } + if (src.hasIfMatch()) { + tgt.setIfMatch(src.getIfMatch()); + } + if (src.hasIfNoneExist()) { + tgt.setIfNoneExist(src.getIfNoneExist()); + } return tgt; } @@ -112,10 +162,18 @@ public class Bundle10_50 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); - tgt.setLocation(src.getLocation()); - tgt.setEtag(src.getEtag()); - tgt.setLastModified(src.getLastModified()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } + if (src.hasLocation()) { + tgt.setLocation(src.getLocation()); + } + if (src.hasEtag()) { + tgt.setEtag(src.getEtag()); + } + if (src.hasLastModified()) { + tgt.setLastModified(src.getLastModified()); + } return tgt; } @@ -124,10 +182,18 @@ public class Bundle10_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); - tgt.setLocation(src.getLocation()); - tgt.setEtag(src.getEtag()); - tgt.setLastModified(src.getLastModified()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } + if (src.hasLocation()) { + tgt.setLocation(src.getLocation()); + } + if (src.hasEtag()) { + tgt.setEtag(src.getEtag()); + } + if (src.hasLastModified()) { + tgt.setLastModified(src.getLastModified()); + } return tgt; } @@ -136,8 +202,12 @@ public class Bundle10_50 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); - tgt.setScore(src.getScore()); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } + if (src.hasScore()) { + tgt.setScore(src.getScore()); + } return tgt; } @@ -146,8 +216,12 @@ public class Bundle10_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); - tgt.setScore(src.getScore()); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } + if (src.hasScore()) { + tgt.setScore(src.getScore()); + } return tgt; } @@ -156,8 +230,12 @@ public class Bundle10_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -166,8 +244,12 @@ public class Bundle10_50 { return null; org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CarePlan10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CarePlan10_50.java index 1c5d26602..ca99d68ff 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CarePlan10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CarePlan10_50.java @@ -12,20 +12,40 @@ public class CarePlan10_50 { return null; org.hl7.fhir.r5.model.CarePlan tgt = new org.hl7.fhir.r5.model.CarePlan(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getContext())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getContext())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) if (!tgt.hasAuthor()) tgt.setAuthor(VersionConvertor_10_50.convertReference(t)); else tgt.addContributor(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(convertReferenceToCodableReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(convertReferenceToCodableReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } return tgt; } @@ -34,23 +54,43 @@ public class CarePlan10_50 { return null; org.hl7.fhir.dstu2.model.CarePlan tgt = new org.hl7.fhir.dstu2.model.CarePlan(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - tgt.setContext(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } if (src.hasAuthor()) tgt.addAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - for (org.hl7.fhir.r5.model.Reference t : src.getContributor()) tgt.addAuthor(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); + if (src.hasContributor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getContributor()) tgt.addAuthor(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (CodeableReference t : src.getAddresses()) { if (t.hasReference()) { tgt.addAddresses(VersionConvertor_10_50.convertReference(t.getReference())); } } - for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + if (src.hasGoal()) { + for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } return tgt; } @@ -59,9 +99,15 @@ public class CarePlan10_50 { return null; org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_50.convertAnnotation(t)); - tgt.setReference(VersionConvertor_10_50.convertReference(src.getReference())); - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasProgress()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_50.convertAnnotation(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_50.convertReference(src.getReference())); + } + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } return tgt; } @@ -70,9 +116,15 @@ public class CarePlan10_50 { return null; org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_50.convertAnnotation(t)); - tgt.setReference(VersionConvertor_10_50.convertReference(src.getReference())); - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasProgress()) { + for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress()) tgt.addProgress(VersionConvertor_10_50.convertAnnotation(t)); + } + if (src.hasReference()) { + tgt.setReference(VersionConvertor_10_50.convertReference(src.getReference())); + } + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } return tgt; } @@ -81,19 +133,45 @@ public class CarePlan10_50 { return null; org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodableReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - tgt.setDoNotPerform(src.getProhibited()); - tgt.setScheduled(VersionConvertor_10_50.convertType(src.getScheduled())); - tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); - tgt.setProduct(VersionConvertor_10_50.convertType(src.getProduct())); - tgt.setDailyAmount(VersionConvertor_10_50.convertSimpleQuantity(src.getDailyAmount())); - tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodableReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } + if (src.hasProhibited()) { + tgt.setDoNotPerform(src.getProhibited()); + } + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_10_50.convertType(src.getScheduled())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_10_50.convertType(src.getProduct())); + } + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_10_50.convertSimpleQuantity(src.getDailyAmount())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -102,21 +180,43 @@ public class CarePlan10_50 { return null; org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReasonCode(VersionConvertor_10_50.convertCodeableConcept(t.getConcept())); for (CodeableReference t : src.getReason()) if (t.hasReference()) tgt.addReasonReference(VersionConvertor_10_50.convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - tgt.setProhibited(src.getDoNotPerform()); - tgt.setScheduled(VersionConvertor_10_50.convertType(src.getScheduled())); - tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); - tgt.setProduct(VersionConvertor_10_50.convertType(src.getProduct())); - tgt.setDailyAmount(VersionConvertor_10_50.convertSimpleQuantity(src.getDailyAmount())); - tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); - tgt.setDescription(src.getDescription()); + if (src.hasGoal()) { + for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } + if (src.hasDoNotPerform()) { + tgt.setProhibited(src.getDoNotPerform()); + } + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_10_50.convertType(src.getScheduled())); + } + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_10_50.convertType(src.getProduct())); + } + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_10_50.convertSimpleQuantity(src.getDailyAmount())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Communication10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Communication10_50.java index 0313ab75d..4d135d130 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Communication10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Communication10_50.java @@ -11,18 +11,42 @@ public class Communication10_50 { return null; org.hl7.fhir.r5.model.Communication tgt = new org.hl7.fhir.r5.model.Communication(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); - tgt.setSender(VersionConvertor_10_50.convertReference(src.getSender())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setSent(src.getSent()); - tgt.setReceived(src.getReceived()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_50.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasSent()) { + tgt.setSent(src.getSent()); + } + if (src.hasReceived()) { + tgt.setReceived(src.getReceived()); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } return tgt; } @@ -31,19 +55,41 @@ public class Communication10_50 { return null; org.hl7.fhir.dstu2.model.Communication tgt = new org.hl7.fhir.dstu2.model.Communication(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setSender(VersionConvertor_10_50.convertReference(src.getSender())); - for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setSent(src.getSent()); - tgt.setReceived(src.getReceived()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasSender()) { + tgt.setSender(VersionConvertor_10_50.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasSent()) { + tgt.setSent(src.getSent()); + } + if (src.hasReceived()) { + tgt.setReceived(src.getReceived()); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReason(VersionConvertor_10_50.convertCodeableConcept(t.getConcept())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } return tgt; } @@ -52,7 +98,9 @@ public class Communication10_50 { return null; org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + } return tgt; } @@ -61,7 +109,9 @@ public class Communication10_50 { return null; org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CommunicationRequest10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CommunicationRequest10_50.java index 0b178b26c..11777fec1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CommunicationRequest10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/CommunicationRequest10_50.java @@ -11,21 +11,47 @@ public class CommunicationRequest10_50 { return null; org.hl7.fhir.dstu2.model.CommunicationRequest tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setSender(VersionConvertor_10_50.convertReference(src.getInformationProviderFirstRep())); - for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setRequester(VersionConvertor_10_50.convertReference(src.getRequester())); - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setScheduled(VersionConvertor_10_50.convertType(src.getOccurrence())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasInformationProvider()) { + tgt.setSender(VersionConvertor_10_50.convertReference(src.getInformationProviderFirstRep())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasRequester()) { + tgt.setRequester(VersionConvertor_10_50.convertReference(src.getRequester())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasOccurrence()) { + tgt.setScheduled(VersionConvertor_10_50.convertType(src.getOccurrence())); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReason(VersionConvertor_10_50.convertCodeableConcept(t.getConcept())); - tgt.setRequestedOn(src.getAuthoredOn()); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setPriority(convertPriorityCode(src.getPriority())); + if (src.hasAuthoredOn()) { + tgt.setRequestedOn(src.getAuthoredOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasPriority()) { + tgt.setPriority(convertPriorityCode(src.getPriority())); + } return tgt; } @@ -34,20 +60,48 @@ public class CommunicationRequest10_50 { return null; org.hl7.fhir.r5.model.CommunicationRequest tgt = new org.hl7.fhir.r5.model.CommunicationRequest(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); - tgt.addInformationProvider(VersionConvertor_10_50.convertReference(src.getSender())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setRequester(VersionConvertor_10_50.convertReference(src.getRequester())); - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setOccurrence(VersionConvertor_10_50.convertType(src.getScheduled())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); - tgt.setAuthoredOn(src.getRequestedOn()); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setPriority(convertPriorityCode(src.getPriority())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + } + if (src.hasSender()) { + tgt.addInformationProvider(VersionConvertor_10_50.convertReference(src.getSender())); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasRequester()) { + tgt.setRequester(VersionConvertor_10_50.convertReference(src.getRequester())); + } + if (src.hasStatus()) { + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasScheduled()) { + tgt.setOccurrence(VersionConvertor_10_50.convertType(src.getScheduled())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasRequestedOn()) { + tgt.setAuthoredOn(src.getRequestedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasPriority()) { + tgt.setPriority(convertPriorityCode(src.getPriority())); + } return tgt; } @@ -56,7 +110,9 @@ public class CommunicationRequest10_50 { return null; org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + } return tgt; } @@ -65,7 +121,9 @@ public class CommunicationRequest10_50 { return null; org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_10_50.convertType(src.getContent())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Composition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Composition10_50.java index 4bcdad11b..bc8c79e50 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Composition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Composition10_50.java @@ -10,25 +10,51 @@ public class Composition10_50 { return null; org.hl7.fhir.r5.model.Composition tgt = new org.hl7.fhir.r5.model.Composition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getClass_())); - tgt.setTitle(src.getTitle()); - tgt.setStatus(convertCompositionStatus(src.getStatus())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getClass_())); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(convertCompositionStatus(src.getStatus())); + } try { - tgt.setConfidentiality(org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.fromCode(src.getConfidentiality())); + if (src.hasConfidentiality()) { + tgt.setConfidentiality(org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.fromCode(src.getConfidentiality())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); - tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasAttester()) { + for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -37,22 +63,46 @@ public class Composition10_50 { return null; org.hl7.fhir.dstu2.model.Composition tgt = new org.hl7.fhir.dstu2.model.Composition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } if (src.hasCategory()) tgt.setClass_(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setTitle(src.getTitle()); - tgt.setStatus(convertCompositionStatus(src.getStatus())); - tgt.setConfidentiality(src.getConfidentiality().toCode()); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); - tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); - for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(convertCompositionStatus(src.getStatus())); + } + if (src.hasConfidentiality()) { + tgt.setConfidentiality(src.getConfidentiality().toCode()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasAttester()) { + for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasSection()) { + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -97,8 +147,12 @@ public class Composition10_50 { VersionConvertor_10_50.copyElement(src, tgt); if (src.hasMode()) tgt.addMode(convertCompositionAttestationMode(src.getMode())); - tgt.setTime(src.getTime()); - tgt.setParty(VersionConvertor_10_50.convertReference(src.getParty())); + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_50.convertReference(src.getParty())); + } return tgt; } @@ -109,8 +163,12 @@ public class Composition10_50 { VersionConvertor_10_50.copyElement(src, tgt); if (src.hasMode()) tgt.setMode(convertCompositionAttestationMode(src.getMode().get(0).getValue())); - tgt.setTime(src.getTime()); - tgt.setParty(VersionConvertor_10_50.convertReference(src.getParty())); + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } + if (src.hasParty()) { + tgt.setParty(VersionConvertor_10_50.convertReference(src.getParty())); + } return tgt; } @@ -119,9 +177,15 @@ public class Composition10_50 { return null; org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -130,9 +194,15 @@ public class Composition10_50 { return null; org.hl7.fhir.r5.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionEventComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -175,14 +245,30 @@ public class Composition10_50 { return null; org.hl7.fhir.dstu2.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu2.model.Composition.SectionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setText(VersionConvertor_10_50.convertNarrative(src.getText())); - tgt.setMode(src.getMode().toCode()); - tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_50.convertReference(t)); - tgt.setEmptyReason(VersionConvertor_10_50.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasText()) { + tgt.setText(VersionConvertor_10_50.convertNarrative(src.getText())); + } + if (src.hasMode()) { + tgt.setMode(src.getMode().toCode()); + } + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasEmptyReason()) { + tgt.setEmptyReason(VersionConvertor_10_50.convertCodeableConcept(src.getEmptyReason())); + } + if (src.hasSection()) { + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -191,18 +277,34 @@ public class Composition10_50 { return null; org.hl7.fhir.r5.model.Composition.SectionComponent tgt = new org.hl7.fhir.r5.model.Composition.SectionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setText(VersionConvertor_10_50.convertNarrative(src.getText())); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasText()) { + tgt.setText(VersionConvertor_10_50.convertNarrative(src.getText())); + } try { - tgt.setMode(org.hl7.fhir.r5.model.Enumerations.ListMode.fromCode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(org.hl7.fhir.r5.model.Enumerations.ListMode.fromCode(src.getMode())); + } } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_50.convertReference(t)); - tgt.setEmptyReason(VersionConvertor_10_50.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasEmptyReason()) { + tgt.setEmptyReason(VersionConvertor_10_50.convertCodeableConcept(src.getEmptyReason())); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java index d058e371a..b84ed0c53 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ConceptMap10_50.java @@ -5,7 +5,6 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.ConceptMap; import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent; - import java.util.ArrayList; import java.util.List; @@ -50,28 +49,56 @@ public class ConceptMap10_50 { return null; org.hl7.fhir.dstu2.model.ConceptMap tgt = new org.hl7.fhir.dstu2.model.ConceptMap(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - if (src.hasIdentifier()) { - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + } + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); } - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setSource(VersionConvertor_10_50.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_10_50.convertType(src.getTarget())); - for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_50.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_50.convertType(src.getTarget())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } return tgt; } @@ -80,8 +107,12 @@ public class ConceptMap10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -90,8 +121,12 @@ public class ConceptMap10_50 { return null; org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -144,9 +179,15 @@ public class ConceptMap10_50 { return null; org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setElement(src.getProperty()); - tgt.setCodeSystem(src.getSystem()); - tgt.setCode(src.getValue()); + if (src.hasProperty()) { + tgt.setElement(src.getProperty()); + } + if (src.hasSystem()) { + tgt.setCodeSystem(src.getSystem()); + } + if (src.hasValue()) { + tgt.setCode(src.getValue()); + } return tgt; } @@ -155,9 +196,15 @@ public class ConceptMap10_50 { return null; org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setProperty(src.getElement()); - tgt.setSystem(src.getCodeSystem()); - tgt.setValue(src.getCode()); + if (src.hasElement()) { + tgt.setProperty(src.getElement()); + } + if (src.hasCodeSystem()) { + tgt.setSystem(src.getCodeSystem()); + } + if (src.hasCode()) { + tgt.setValue(src.getCode()); + } return tgt; } @@ -167,11 +214,15 @@ public class ConceptMap10_50 { org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent(); VersionConvertor_10_50.copyElement(src, tgt); tgt.setCodeSystem(g.getSource()); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasNoMap() && src.getNoMap() == true) { tgt.addTarget(new org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent().setEquivalence(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.UNMATCHED)); } else { - for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + } } return tgt; } @@ -183,13 +234,17 @@ public class ConceptMap10_50 { for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) { org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (t.getEquivalence() == org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.UNMATCHED) { tgt.setNoMap(true); } else { tgt.addTarget(convertTargetElementComponent(t)); } - res.add(new VersionConvertor_10_50.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem())); + if (src.hasCodeSystem()) { + res.add(new VersionConvertor_10_50.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem())); + } } return res; } @@ -200,11 +255,21 @@ public class ConceptMap10_50 { org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent(); VersionConvertor_10_50.copyElement(src, tgt); tgt.setCodeSystem(g.getTarget()); - tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getRelationship())); - tgt.setComments(src.getComment()); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasRelationship()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getRelationship())); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -213,11 +278,21 @@ public class ConceptMap10_50 { return null; org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setRelationship(convertConceptMapRelationship(src.getEquivalence())); - tgt.setComment(src.getComments()); - for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasEquivalence()) { + tgt.setRelationship(convertConceptMapRelationship(src.getEquivalence())); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Condition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Condition10_50.java index 988f4021f..202da162b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Condition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Condition10_50.java @@ -10,23 +10,49 @@ public class Condition10_50 { return null; org.hl7.fhir.dstu2.model.Condition tgt = new org.hl7.fhir.dstu2.model.Condition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setAsserter(VersionConvertor_10_50.convertReference(src.getAsserter())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasAsserter()) { + tgt.setAsserter(VersionConvertor_10_50.convertReference(src.getAsserter())); + } if (src.hasRecordedDate()) tgt.setDateRecorded(src.getRecordedDate()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); - tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - tgt.setSeverity(VersionConvertor_10_50.convertCodeableConcept(src.getSeverity())); - tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); - tgt.setAbatement(VersionConvertor_10_50.convertType(src.getAbatement())); - tgt.setStage(convertConditionStageComponent(src.getStageFirstRep())); - for (org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasVerificationStatus()) { + tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); + } + if (src.hasSeverity()) { + tgt.setSeverity(VersionConvertor_10_50.convertCodeableConcept(src.getSeverity())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); + } + if (src.hasAbatement()) { + tgt.setAbatement(VersionConvertor_10_50.convertType(src.getAbatement())); + } + if (src.hasStage()) { + tgt.setStage(convertConditionStageComponent(src.getStageFirstRep())); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_50.convertCodeableConcept(t)); + } return tgt; } @@ -35,23 +61,49 @@ public class Condition10_50 { return null; org.hl7.fhir.r5.model.Condition tgt = new org.hl7.fhir.r5.model.Condition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setAsserter(VersionConvertor_10_50.convertReference(src.getAsserter())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasAsserter()) { + tgt.setAsserter(VersionConvertor_10_50.convertReference(src.getAsserter())); + } if (src.hasDateRecorded()) tgt.setRecordedDate(src.getDateRecorded()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); - tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - tgt.setSeverity(VersionConvertor_10_50.convertCodeableConcept(src.getSeverity())); - tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); - tgt.setAbatement(VersionConvertor_10_50.convertType(src.getAbatement())); - tgt.addStage(convertConditionStageComponent(src.getStage())); - for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasVerificationStatus()) { + tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); + } + if (src.hasSeverity()) { + tgt.setSeverity(VersionConvertor_10_50.convertCodeableConcept(src.getSeverity())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); + } + if (src.hasAbatement()) { + tgt.setAbatement(VersionConvertor_10_50.convertType(src.getAbatement())); + } + if (src.hasStage()) { + tgt.addStage(convertConditionStageComponent(src.getStage())); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_10_50.convertCodeableConcept(t)); + } return tgt; } @@ -78,8 +130,12 @@ public class Condition10_50 { return null; org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept cc : src.getCode()) tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(cc)); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept cc : src.getCode()) tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(cc)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -88,8 +144,12 @@ public class Condition10_50 { return null; org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.addCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + if (src.hasCode()) { + tgt.addCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -98,8 +158,12 @@ public class Condition10_50 { return null; org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSummary(VersionConvertor_10_50.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_50.convertReference(t)); + if (src.hasSummary()) { + tgt.setSummary(VersionConvertor_10_50.convertCodeableConcept(src.getSummary())); + } + if (src.hasAssessment()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -108,8 +172,12 @@ public class Condition10_50 { return null; org.hl7.fhir.r5.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionStageComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSummary(VersionConvertor_10_50.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_50.convertReference(t)); + if (src.hasSummary()) { + tgt.setSummary(VersionConvertor_10_50.convertCodeableConcept(src.getSummary())); + } + if (src.hasAssessment()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_10_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Conformance10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Conformance10_50.java index cd354c558..30d60f861 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Conformance10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Conformance10_50.java @@ -44,32 +44,64 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance tgt = new org.hl7.fhir.dstu2.model.Conformance(); VersionConvertor_10_50.copyDomainResource(src, tgt, "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } if (src.hasImplementation()) tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown")) tgt.setAcceptUnknown(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue())); - for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r5.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_10_50.convertCanonicalToReference(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r5.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_10_50.convertCanonicalToReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -78,29 +110,63 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement tgt = new org.hl7.fhir.r5.model.CapabilityStatement(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } if (src.hasAcceptUnknown()) tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue())); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -109,8 +175,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -119,8 +189,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -129,9 +203,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setProfileElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getProfile())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -140,9 +220,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceDocumentComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_10_50.convertCanonicalToReference(src.getProfileElement())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_10_50.convertCanonicalToReference(src.getProfileElement())); + } return tgt; } @@ -151,8 +237,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setUrl(src.getUrl()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -161,8 +251,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setUrl(src.getUrl()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -171,9 +265,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); - tgt.setReliableCache(src.getReliableCache()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) { + tgt.setReliableCache(src.getReliableCache()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } for (org.hl7.fhir.r5.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) { org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent event = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent(); tgt.addEvent(event); @@ -202,9 +302,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); - tgt.setReliableCache(src.getReliableCache()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) { + tgt.setReliableCache(src.getReliableCache()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) { org.hl7.fhir.r5.model.Extension e = new org.hl7.fhir.r5.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT); e.addExtension(new org.hl7.fhir.r5.model.Extension("code", VersionConvertor_10_50.convertCoding(t.getCode()))); @@ -233,8 +339,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_10_50.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_10_50.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -243,8 +353,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEndpointComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_10_50.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_10_50.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -253,16 +367,32 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } if (src.getTransactionMode() == org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH || src.getTransactionMode() == org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH) tgt.addInteraction().setCode(SystemRestfulInteraction.BATCH); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu2.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -271,10 +401,18 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); - tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } boolean batch = false; boolean transaction = false; for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) { @@ -289,9 +427,15 @@ public class Conformance10_50 { tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BOTH : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.BATCH); else tgt.setTransactionMode(transaction ? org.hl7.fhir.dstu2.model.Conformance.TransactionMode.TRANSACTION : org.hl7.fhir.dstu2.model.Conformance.TransactionMode.NOTSUPPORTED); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r5.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -300,8 +444,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_10_50.convertCanonicalToReference(src.getDefinitionElement())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinitionElement()) { + tgt.setDefinition(VersionConvertor_10_50.convertCanonicalToReference(src.getDefinitionElement())); + } return tgt; } @@ -310,8 +458,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinitionElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinitionElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getDefinition())); + } return tgt; } @@ -320,18 +472,42 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getProfile())); - for (org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - tgt.setReadHistory(src.getReadHistory()); - tgt.setUpdateCreate(src.getUpdateCreate()); - tgt.setConditionalCreate(src.getConditionalCreate()); - tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getProfile())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } + if (src.hasReadHistory()) { + tgt.setReadHistory(src.getReadHistory()); + } + if (src.hasUpdateCreate()) { + tgt.setUpdateCreate(src.getUpdateCreate()); + } + if (src.hasConditionalCreate()) { + tgt.setConditionalCreate(src.getConditionalCreate()); + } + if (src.hasConditionalUpdate()) { + tgt.setConditionalUpdate(src.getConditionalUpdate()); + } + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -341,20 +517,42 @@ public class Conformance10_50 { org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceComponent(); VersionConvertor_10_50.copyElement(src, tgt); if (src.hasType()) { - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } } if (src.hasProfile()) tgt.setProfile(VersionConvertor_10_50.convertCanonicalToReference(src.getProfileElement())); - for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - tgt.setReadHistory(src.getReadHistory()); - tgt.setUpdateCreate(src.getUpdateCreate()); - tgt.setConditionalCreate(src.getConditionalCreate()); - tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasInteraction()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } + if (src.hasReadHistory()) { + tgt.setReadHistory(src.getReadHistory()); + } + if (src.hasUpdateCreate()) { + tgt.setUpdateCreate(src.getUpdateCreate()); + } + if (src.hasConditionalCreate()) { + tgt.setConditionalCreate(src.getConditionalCreate()); + } + if (src.hasConditionalUpdate()) { + tgt.setConditionalUpdate(src.getConditionalUpdate()); + } + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -363,10 +561,18 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(src.getDefinition()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -375,10 +581,18 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(src.getDefinition()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -387,9 +601,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); + if (src.hasCors()) { + tgt.setCors(src.getCors()); + } + if (src.hasService()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -398,9 +618,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCors(src.getCors()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setDescription(src.getDescription()); + if (src.hasCors()) { + tgt.setCors(src.getCors()); + } + if (src.hasService()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -409,9 +635,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setVersion(src.getVersion()); - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasReleaseDate()) { + tgt.setReleaseDate(src.getReleaseDate()); + } return tgt; } @@ -420,9 +652,15 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setVersion(src.getVersion()); - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasReleaseDate()) { + tgt.setReleaseDate(src.getReleaseDate()); + } return tgt; } @@ -487,8 +725,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -497,8 +739,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -563,8 +809,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent tgt = new org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } @@ -573,8 +823,12 @@ public class Conformance10_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DataElement10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DataElement10_50.java index 574cb6319..efc10ee98 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DataElement10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DataElement10_50.java @@ -4,7 +4,6 @@ import org.hl7.fhir.convertors.VersionConvertor_10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule; - import java.util.ArrayList; import java.util.List; @@ -17,27 +16,45 @@ public class DataElement10_50 { VersionConvertor_10_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl().replace("/DataElement/", "/StructureDefinition/de-")); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_50.convertCodeableConceptToUsageContext(t)); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } List slicePaths = new ArrayList(); for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); - tgt.getSnapshot().addElement(VersionConvertor_10_50.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + tgt.getSnapshot().addElement(VersionConvertor_10_50.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + } } tgt.setKind(StructureDefinitionKind.COMPLEXTYPE); tgt.setAbstract(false); @@ -52,8 +69,12 @@ public class DataElement10_50 { return null; org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -62,8 +83,12 @@ public class DataElement10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -72,10 +97,18 @@ public class DataElement10_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComment(src.getComments()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DetectedIssue10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DetectedIssue10_50.java index 0e51ca176..6fa10d49c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DetectedIssue10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DetectedIssue10_50.java @@ -10,17 +10,35 @@ public class DetectedIssue10_50 { return null; org.hl7.fhir.dstu2.model.DetectedIssue tgt = new org.hl7.fhir.dstu2.model.DetectedIssue(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_50.convertReference(t)); - tgt.setDetail(src.getDetail()); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasCode()) { + tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSeverity()) { + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + } + if (src.hasImplicated()) { + for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasDetail()) { + tgt.setDetail(src.getDetail()); + } if (src.hasIdentifiedDateTimeType()) tgt.setDateElement(VersionConvertor_10_50.convertDateTime(src.getIdentifiedDateTimeType())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setReference(src.getReference()); - for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasReference()) { + tgt.setReference(src.getReference()); + } + if (src.hasMitigation()) { + for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -29,17 +47,35 @@ public class DetectedIssue10_50 { return null; org.hl7.fhir.r5.model.DetectedIssue tgt = new org.hl7.fhir.r5.model.DetectedIssue(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_50.convertReference(t)); - tgt.setDetail(src.getDetail()); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasCategory()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + } + if (src.hasSeverity()) { + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + } + if (src.hasImplicated()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasDetail()) { + tgt.setDetail(src.getDetail()); + } if (src.hasDate()) tgt.setIdentified(VersionConvertor_10_50.convertDateTime(src.getDateElement())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setReference(src.getReference()); - for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasReference()) { + tgt.setReference(src.getReference()); + } + if (src.hasMitigation()) { + for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -48,10 +84,14 @@ public class DetectedIssue10_50 { return null; org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_50.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_50.convertCodeableConcept(src.getAction())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } return tgt; } @@ -60,10 +100,14 @@ public class DetectedIssue10_50 { return null; org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAction(VersionConvertor_10_50.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_10_50.convertCodeableConcept(src.getAction())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceMetric10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceMetric10_50.java index 54393e0b5..9a41fcb23 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceMetric10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceMetric10_50.java @@ -10,16 +10,36 @@ public class DeviceMetric10_50 { return null; org.hl7.fhir.dstu2.model.DeviceMetric tgt = new org.hl7.fhir.dstu2.model.DeviceMetric(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setUnit(VersionConvertor_10_50.convertCodeableConcept(src.getUnit())); - tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_50.convertReference(src.getParent())); - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - tgt.setColor(convertDeviceMetricColor(src.getColor())); - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - tgt.setMeasurementPeriod(VersionConvertor_10_50.convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasUnit()) { + tgt.setUnit(VersionConvertor_10_50.convertCodeableConcept(src.getUnit())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_50.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + } + if (src.hasColor()) { + tgt.setColor(convertDeviceMetricColor(src.getColor())); + } + if (src.hasCategory()) { + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + } + if (src.hasMeasurementPeriod()) { + tgt.setMeasurementPeriod(VersionConvertor_10_50.convertTiming(src.getMeasurementPeriod())); + } + if (src.hasCalibration()) { + for (org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } return tgt; } @@ -28,16 +48,36 @@ public class DeviceMetric10_50 { return null; org.hl7.fhir.r5.model.DeviceMetric tgt = new org.hl7.fhir.r5.model.DeviceMetric(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setUnit(VersionConvertor_10_50.convertCodeableConcept(src.getUnit())); - tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); - tgt.setParent(VersionConvertor_10_50.convertReference(src.getParent())); - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - tgt.setColor(convertDeviceMetricColor(src.getColor())); - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - tgt.setMeasurementPeriod(VersionConvertor_10_50.convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasUnit()) { + tgt.setUnit(VersionConvertor_10_50.convertCodeableConcept(src.getUnit())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); + } + if (src.hasParent()) { + tgt.setParent(VersionConvertor_10_50.convertReference(src.getParent())); + } + if (src.hasOperationalStatus()) { + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + } + if (src.hasColor()) { + tgt.setColor(convertDeviceMetricColor(src.getColor())); + } + if (src.hasCategory()) { + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + } + if (src.hasMeasurementPeriod()) { + tgt.setMeasurementPeriod(VersionConvertor_10_50.convertTiming(src.getMeasurementPeriod())); + } + if (src.hasCalibration()) { + for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } return tgt; } @@ -46,9 +86,15 @@ public class DeviceMetric10_50 { return null; org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - tgt.setTime(src.getTime()); + if (src.hasType()) { + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + } + if (src.hasState()) { + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } return tgt; } @@ -57,9 +103,15 @@ public class DeviceMetric10_50 { return null; org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - tgt.setTime(src.getTime()); + if (src.hasType()) { + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + } + if (src.hasState()) { + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + } + if (src.hasTime()) { + tgt.setTime(src.getTime()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceUseStatement10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceUseStatement10_50.java index 1dfce2dd2..7bc8c6e30 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceUseStatement10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DeviceUseStatement10_50.java @@ -14,13 +14,27 @@ public class DeviceUseStatement10_50 { VersionConvertor_10_50.copyDomainResource(src, tgt); if (src.hasBodySiteCodeableConcept()) tgt.setBodySite(VersionConvertor_10_50.convertCodeableConcept(src.getBodySiteCodeableConcept())); - tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue()); - tgt.setRecordedOn(src.getRecordedOn()); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setTiming(VersionConvertor_10_50.convertType(src.getTiming())); + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasIndication()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasNotes()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue()); + } + if (src.hasRecordedOn()) { + tgt.setRecordedOn(src.getRecordedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_50.convertType(src.getTiming())); + } return tgt; } @@ -29,15 +43,29 @@ public class DeviceUseStatement10_50 { return null; org.hl7.fhir.dstu2.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu2.model.DeviceUseStatement(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setBodySite(VersionConvertor_10_50.convertType(src.getBodySite())); - tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_50.convertType(src.getBodySite())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addIndication(VersionConvertor_10_50.convertCodeableConcept(t.getConcept())); - for (Annotation t : src.getNote()) tgt.addNotes(t.getText()); - tgt.setRecordedOn(src.getRecordedOn()); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setTiming(VersionConvertor_10_50.convertType(src.getTiming())); + if (src.hasNote()) { + for (Annotation t : src.getNote()) tgt.addNotes(t.getText()); + } + if (src.hasRecordedOn()) { + tgt.setRecordedOn(src.getRecordedOn()); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_50.convertType(src.getTiming())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DiagnosticReport10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DiagnosticReport10_50.java index 5e7c30c84..ca46f5c76 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DiagnosticReport10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DiagnosticReport10_50.java @@ -10,21 +10,51 @@ public class DiagnosticReport10_50 { return null; org.hl7.fhir.r5.model.DiagnosticReport tgt = new org.hl7.fhir.r5.model.DiagnosticReport(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); - tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_50.convertAttachment(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); + } + if (src.hasConclusion()) { + tgt.setConclusion(src.getConclusion()); + } + if (src.hasCodedDiagnosis()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_50.convertAttachment(t)); + } return tgt; } @@ -33,21 +63,51 @@ public class DiagnosticReport10_50 { return null; org.hl7.fhir.dstu2.model.DiagnosticReport tgt = new org.hl7.fhir.dstu2.model.DiagnosticReport(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); - tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_50.convertAttachment(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.r5.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasMedia()) { + for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + } + if (src.hasConclusion()) { + tgt.setConclusion(src.getConclusion()); + } + if (src.hasConclusionCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_10_50.convertAttachment(t)); + } return tgt; } @@ -56,8 +116,12 @@ public class DiagnosticReport10_50 { return null; org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setComment(src.getComment()); - tgt.setLink(VersionConvertor_10_50.convertReference(src.getLink())); + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasLink()) { + tgt.setLink(VersionConvertor_10_50.convertReference(src.getLink())); + } return tgt; } @@ -66,8 +130,12 @@ public class DiagnosticReport10_50 { return null; org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent tgt = new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setComment(src.getComment()); - tgt.setLink(VersionConvertor_10_50.convertReference(src.getLink())); + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasLink()) { + tgt.setLink(VersionConvertor_10_50.convertReference(src.getLink())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DocumentReference10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DocumentReference10_50.java index 1a5b91fa4..ff7f464c0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DocumentReference10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/DocumentReference10_50.java @@ -44,21 +44,51 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.dstu2.model.DocumentReference tgt = new org.hl7.fhir.dstu2.model.DocumentReference(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_50.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setClass_(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); - tgt.setAuthenticator(VersionConvertor_10_50.convertReference(src.getAuthenticator())); - tgt.setCreated(src.getDate()); - tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); - tgt.setDocStatus(convertDocStatus(src.getDocStatus())); - for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_50.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasCategory()) { + tgt.setClass_(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); + } + if (src.hasAuthenticator()) { + tgt.setAuthenticator(VersionConvertor_10_50.convertReference(src.getAuthenticator())); + } + if (src.hasDate()) { + tgt.setCreated(src.getDate()); + } + if (src.hasStatus()) { + tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDocStatus()) { + tgt.setDocStatus(convertDocStatus(src.getDocStatus())); + } + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) { + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + } return tgt; } @@ -67,21 +97,51 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setMasterIdentifier(VersionConvertor_10_50.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getClass_())); - tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); - tgt.setAuthenticator(VersionConvertor_10_50.convertReference(src.getAuthenticator())); - tgt.setDate(src.getCreated()); - tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); - tgt.setDocStatus(convertDocStatus(src.getDocStatus())); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + if (src.hasMasterIdentifier()) { + tgt.setMasterIdentifier(VersionConvertor_10_50.convertIdentifier(src.getMasterIdentifier())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasClass_()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getClass_())); + } + if (src.hasCustodian()) { + tgt.setCustodian(VersionConvertor_10_50.convertReference(src.getCustodian())); + } + if (src.hasAuthenticator()) { + tgt.setAuthenticator(VersionConvertor_10_50.convertReference(src.getAuthenticator())); + } + if (src.hasCreated()) { + tgt.setDate(src.getCreated()); + } + if (src.hasStatus()) { + tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); + } + if (src.hasDocStatus()) { + tgt.setDocStatus(convertDocStatus(src.getDocStatus())); + } + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) { + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + } return tgt; } @@ -90,8 +150,12 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAttachment(VersionConvertor_10_50.convertAttachment(src.getAttachment())); - tgt.addFormat(VersionConvertor_10_50.convertCoding(src.getFormat())); + if (src.hasAttachment()) { + tgt.setAttachment(VersionConvertor_10_50.convertAttachment(src.getAttachment())); + } + if (src.hasFormat()) { + tgt.addFormat(VersionConvertor_10_50.convertCoding(src.getFormat())); + } return tgt; } @@ -100,8 +164,12 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAttachment(VersionConvertor_10_50.convertAttachment(src.getAttachment())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getFormat()) tgt.setFormat(VersionConvertor_10_50.convertCoding(t)); + if (src.hasAttachment()) { + tgt.setAttachment(VersionConvertor_10_50.convertAttachment(src.getAttachment())); + } + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getFormat()) tgt.setFormat(VersionConvertor_10_50.convertCoding(t)); + } return tgt; } @@ -112,12 +180,24 @@ public class DocumentReference10_50 { VersionConvertor_10_50.copyElement(src, tgt); if (src.hasEncounter()) tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounterFirstRep())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setFacilityType(VersionConvertor_10_50.convertCodeableConcept(src.getFacilityType())); - tgt.setPracticeSetting(VersionConvertor_10_50.convertCodeableConcept(src.getPracticeSetting())); - tgt.setSourcePatientInfo(VersionConvertor_10_50.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.r5.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasFacilityType()) { + tgt.setFacilityType(VersionConvertor_10_50.convertCodeableConcept(src.getFacilityType())); + } + if (src.hasPracticeSetting()) { + tgt.setPracticeSetting(VersionConvertor_10_50.convertCodeableConcept(src.getPracticeSetting())); + } + if (src.hasSourcePatientInfo()) { + tgt.setSourcePatientInfo(VersionConvertor_10_50.convertReference(src.getSourcePatientInfo())); + } + if (src.hasRelated()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -126,13 +206,27 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.addEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setFacilityType(VersionConvertor_10_50.convertCodeableConcept(src.getFacilityType())); - tgt.setPracticeSetting(VersionConvertor_10_50.convertCodeableConcept(src.getPracticeSetting())); - tgt.setSourcePatientInfo(VersionConvertor_10_50.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasEncounter()) { + tgt.addEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasFacilityType()) { + tgt.setFacilityType(VersionConvertor_10_50.convertCodeableConcept(src.getFacilityType())); + } + if (src.hasPracticeSetting()) { + tgt.setPracticeSetting(VersionConvertor_10_50.convertCodeableConcept(src.getPracticeSetting())); + } + if (src.hasSourcePatientInfo()) { + tgt.setSourcePatientInfo(VersionConvertor_10_50.convertReference(src.getSourcePatientInfo())); + } + if (src.hasRelated()) { + for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -150,7 +244,9 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } tgt.setRef(VersionConvertor_10_50.convertReference(src)); return tgt; } @@ -160,8 +256,12 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + if (src.hasCode()) { + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + } return tgt; } @@ -170,8 +270,12 @@ public class DocumentReference10_50 { return null; org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + if (src.hasCode()) { + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Encounter10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Encounter10_50.java index 5d05d24a6..dc2dea5e8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Encounter10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Encounter10_50.java @@ -11,24 +11,56 @@ public class Encounter10_50 { return null; org.hl7.fhir.dstu2.model.Encounter tgt = new org.hl7.fhir.dstu2.model.Encounter(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertEncounterState(src.getStatus())); - tgt.setClass_(convertEncounterClass(src.getClass_())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPriority(VersionConvertor_10_50.convertCodeableConcept(src.getPriority())); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); - tgt.setAppointment(VersionConvertor_10_50.convertReference(src.getAppointmentFirstRep())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setLength(VersionConvertor_10_50.convertDuration(src.getLength())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterState(src.getStatus())); + } + if (src.hasClass_()) { + tgt.setClass_(convertEncounterClass(src.getClass_())); + } + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(VersionConvertor_10_50.convertCodeableConcept(src.getPriority())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + tgt.setAppointment(VersionConvertor_10_50.convertReference(src.getAppointmentFirstRep())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasLength()) { + tgt.setLength(VersionConvertor_10_50.convertDuration(src.getLength())); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReason(VersionConvertor_10_50.convertCodeableConcept(t.getConcept())); - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); - tgt.setServiceProvider(VersionConvertor_10_50.convertReference(src.getServiceProvider())); - tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + if (src.hasHospitalization()) { + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) { + tgt.setServiceProvider(VersionConvertor_10_50.convertReference(src.getServiceProvider())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + } return tgt; } @@ -37,23 +69,57 @@ public class Encounter10_50 { return null; org.hl7.fhir.r5.model.Encounter tgt = new org.hl7.fhir.r5.model.Encounter(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertEncounterState(src.getStatus())); - tgt.setClass_(convertEncounterClass(src.getClass_())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPriority(VersionConvertor_10_50.convertCodeableConcept(src.getPriority())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); - tgt.addAppointment(VersionConvertor_10_50.convertReference(src.getAppointment())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setLength(VersionConvertor_10_50.convertDuration(src.getLength())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); - tgt.setServiceProvider(VersionConvertor_10_50.convertReference(src.getServiceProvider())); - tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterState(src.getStatus())); + } + if (src.hasClass_()) { + tgt.setClass_(convertEncounterClass(src.getClass_())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPriority()) { + tgt.setPriority(VersionConvertor_10_50.convertCodeableConcept(src.getPriority())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + tgt.addAppointment(VersionConvertor_10_50.convertReference(src.getAppointment())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasLength()) { + tgt.setLength(VersionConvertor_10_50.convertDuration(src.getLength())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasHospitalization()) { + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) { + tgt.setServiceProvider(VersionConvertor_10_50.convertReference(src.getServiceProvider())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + } return tgt; } @@ -109,15 +175,33 @@ public class Encounter10_50 { return null; org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setPreAdmissionIdentifier(VersionConvertor_10_50.convertIdentifier(src.getPreAdmissionIdentifier())); - tgt.setOrigin(VersionConvertor_10_50.convertReference(src.getOrigin())); - tgt.setAdmitSource(VersionConvertor_10_50.convertCodeableConcept(src.getAdmitSource())); - tgt.setReAdmission(VersionConvertor_10_50.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); - tgt.setDischargeDisposition(VersionConvertor_10_50.convertCodeableConcept(src.getDischargeDisposition())); + if (src.hasPreAdmissionIdentifier()) { + tgt.setPreAdmissionIdentifier(VersionConvertor_10_50.convertIdentifier(src.getPreAdmissionIdentifier())); + } + if (src.hasOrigin()) { + tgt.setOrigin(VersionConvertor_10_50.convertReference(src.getOrigin())); + } + if (src.hasAdmitSource()) { + tgt.setAdmitSource(VersionConvertor_10_50.convertCodeableConcept(src.getAdmitSource())); + } + if (src.hasReAdmission()) { + tgt.setReAdmission(VersionConvertor_10_50.convertCodeableConcept(src.getReAdmission())); + } + if (src.hasDietPreference()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); + } + if (src.hasDischargeDisposition()) { + tgt.setDischargeDisposition(VersionConvertor_10_50.convertCodeableConcept(src.getDischargeDisposition())); + } return tgt; } @@ -126,15 +210,33 @@ public class Encounter10_50 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setPreAdmissionIdentifier(VersionConvertor_10_50.convertIdentifier(src.getPreAdmissionIdentifier())); - tgt.setOrigin(VersionConvertor_10_50.convertReference(src.getOrigin())); - tgt.setAdmitSource(VersionConvertor_10_50.convertCodeableConcept(src.getAdmitSource())); - tgt.setReAdmission(VersionConvertor_10_50.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); - tgt.setDischargeDisposition(VersionConvertor_10_50.convertCodeableConcept(src.getDischargeDisposition())); + if (src.hasPreAdmissionIdentifier()) { + tgt.setPreAdmissionIdentifier(VersionConvertor_10_50.convertIdentifier(src.getPreAdmissionIdentifier())); + } + if (src.hasOrigin()) { + tgt.setOrigin(VersionConvertor_10_50.convertReference(src.getOrigin())); + } + if (src.hasAdmitSource()) { + tgt.setAdmitSource(VersionConvertor_10_50.convertCodeableConcept(src.getAdmitSource())); + } + if (src.hasReAdmission()) { + tgt.setReAdmission(VersionConvertor_10_50.convertCodeableConcept(src.getReAdmission())); + } + if (src.hasDietPreference()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); + } + if (src.hasDischargeDisposition()) { + tgt.setDischargeDisposition(VersionConvertor_10_50.convertCodeableConcept(src.getDischargeDisposition())); + } return tgt; } @@ -143,9 +245,15 @@ public class Encounter10_50 { return null; org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -154,9 +262,15 @@ public class Encounter10_50 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_10_50.convertReference(src.getLocation())); + } + if (src.hasStatus()) { + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -199,9 +313,15 @@ public class Encounter10_50 { return null; org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setIndividual(VersionConvertor_10_50.convertReference(src.getIndividual())); + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasIndividual()) { + tgt.setIndividual(VersionConvertor_10_50.convertReference(src.getIndividual())); + } return tgt; } @@ -210,9 +330,15 @@ public class Encounter10_50 { return null; org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setIndividual(VersionConvertor_10_50.convertReference(src.getIndividual())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasIndividual()) { + tgt.setIndividual(VersionConvertor_10_50.convertReference(src.getIndividual())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentRequest10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentRequest10_50.java index b01d24193..c19e92b78 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentRequest10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentRequest10_50.java @@ -10,11 +10,21 @@ public class EnrollmentRequest10_50 { return null; org.hl7.fhir.r5.model.EnrollmentRequest tgt = new org.hl7.fhir.r5.model.EnrollmentRequest(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCreated(src.getCreated()); - tgt.setProvider(VersionConvertor_10_50.convertReference(src.getProvider())); - tgt.setCandidate(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setCoverage(VersionConvertor_10_50.convertReference(src.getCoverage())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasProvider()) { + tgt.setProvider(VersionConvertor_10_50.convertReference(src.getProvider())); + } + if (src.hasSubject()) { + tgt.setCandidate(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasCoverage()) { + tgt.setCoverage(VersionConvertor_10_50.convertReference(src.getCoverage())); + } return tgt; } @@ -23,9 +33,15 @@ public class EnrollmentRequest10_50 { return null; org.hl7.fhir.dstu2.model.EnrollmentRequest tgt = new org.hl7.fhir.dstu2.model.EnrollmentRequest(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCreated(src.getCreated()); - tgt.setCoverage(VersionConvertor_10_50.convertReference(src.getCoverage())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasCoverage()) { + tgt.setCoverage(VersionConvertor_10_50.convertReference(src.getCoverage())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentResponse10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentResponse10_50.java index 39f19c4c7..696ccc8ab 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentResponse10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EnrollmentResponse10_50.java @@ -10,9 +10,15 @@ public class EnrollmentResponse10_50 { return null; org.hl7.fhir.dstu2.model.EnrollmentResponse tgt = new org.hl7.fhir.dstu2.model.EnrollmentResponse(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setDisposition(src.getDisposition()); - tgt.setCreated(src.getCreated()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasDisposition()) { + tgt.setDisposition(src.getDisposition()); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } return tgt; } @@ -21,12 +27,24 @@ public class EnrollmentResponse10_50 { return null; org.hl7.fhir.r5.model.EnrollmentResponse tgt = new org.hl7.fhir.r5.model.EnrollmentResponse(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setRequest(VersionConvertor_10_50.convertReference(src.getRequest())); - tgt.setDisposition(src.getDisposition()); - tgt.setCreated(src.getCreated()); - tgt.setOrganization(VersionConvertor_10_50.convertReference(src.getOrganization())); - tgt.setRequestProvider(VersionConvertor_10_50.convertReference(src.getRequestProvider())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasRequest()) { + tgt.setRequest(VersionConvertor_10_50.convertReference(src.getRequest())); + } + if (src.hasDisposition()) { + tgt.setDisposition(src.getDisposition()); + } + if (src.hasCreated()) { + tgt.setCreated(src.getCreated()); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_50.convertReference(src.getOrganization())); + } + if (src.hasRequestProvider()) { + tgt.setRequestProvider(VersionConvertor_10_50.convertReference(src.getRequestProvider())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EpisodeOfCare10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EpisodeOfCare10_50.java index e1b3d149f..ea25c5457 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EpisodeOfCare10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/EpisodeOfCare10_50.java @@ -10,15 +10,33 @@ public class EpisodeOfCare10_50 { return null; org.hl7.fhir.dstu2.model.EpisodeOfCare tgt = new org.hl7.fhir.dstu2.model.EpisodeOfCare(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_50.convertReference(t)); - tgt.setCareManager(VersionConvertor_10_50.convertReference(src.getCareManager())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasReferralRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasCareManager()) { + tgt.setCareManager(VersionConvertor_10_50.convertReference(src.getCareManager())); + } return tgt; } @@ -27,15 +45,33 @@ public class EpisodeOfCare10_50 { return null; org.hl7.fhir.r5.model.EpisodeOfCare tgt = new org.hl7.fhir.r5.model.EpisodeOfCare(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_50.convertReference(t)); - tgt.setCareManager(VersionConvertor_10_50.convertReference(src.getCareManager())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasReferralRequest()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasCareManager()) { + tgt.setCareManager(VersionConvertor_10_50.convertReference(src.getCareManager())); + } return tgt; } @@ -86,8 +122,12 @@ public class EpisodeOfCare10_50 { return null; org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -96,8 +136,12 @@ public class EpisodeOfCare10_50 { return null; org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasStatus()) { + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/FamilyMemberHistory10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/FamilyMemberHistory10_50.java index 13f91a06e..84c72cbc1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/FamilyMemberHistory10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/FamilyMemberHistory10_50.java @@ -44,17 +44,35 @@ public class FamilyMemberHistory10_50 { return null; org.hl7.fhir.r5.model.FamilyMemberHistory tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setRelationship(VersionConvertor_10_50.convertCodeableConcept(src.getRelationship())); - tgt.setBorn(VersionConvertor_10_50.convertType(src.getBorn())); - tgt.setAge(VersionConvertor_10_50.convertType(src.getAge())); - tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasStatus()) { + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_50.convertCodeableConcept(src.getRelationship())); + } + if (src.hasBorn()) { + tgt.setBorn(VersionConvertor_10_50.convertType(src.getBorn())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_50.convertType(src.getAge())); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -63,17 +81,35 @@ public class FamilyMemberHistory10_50 { return null; org.hl7.fhir.dstu2.model.FamilyMemberHistory tgt = new org.hl7.fhir.dstu2.model.FamilyMemberHistory(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setRelationship(VersionConvertor_10_50.convertCodeableConcept(src.getRelationship())); - tgt.setBorn(VersionConvertor_10_50.convertType(src.getBorn())); - tgt.setAge(VersionConvertor_10_50.convertType(src.getAge())); - tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); - for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasStatus()) { + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasRelationship()) { + tgt.setRelationship(VersionConvertor_10_50.convertCodeableConcept(src.getRelationship())); + } + if (src.hasBorn()) { + tgt.setBorn(VersionConvertor_10_50.convertType(src.getBorn())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_50.convertType(src.getAge())); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -82,9 +118,15 @@ public class FamilyMemberHistory10_50 { return null; org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); - tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); + } return tgt; } @@ -93,9 +135,15 @@ public class FamilyMemberHistory10_50 { return null; org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); - tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); + } + if (src.hasOnset()) { + tgt.setOnset(VersionConvertor_10_50.convertType(src.getOnset())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Flag10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Flag10_50.java index 2c5050367..a731c823d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Flag10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Flag10_50.java @@ -10,14 +10,30 @@ public class Flag10_50 { return null; org.hl7.fhir.r5.model.Flag tgt = new org.hl7.fhir.r5.model.Flag(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); - tgt.setStatus(convertFlagStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + } + if (src.hasStatus()) { + tgt.setStatus(convertFlagStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } return tgt; } @@ -26,14 +42,30 @@ public class Flag10_50 { return null; org.hl7.fhir.dstu2.model.Flag tgt = new org.hl7.fhir.dstu2.model.Flag(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); - tgt.setStatus(convertFlagStatus(src.getStatus())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategoryFirstRep())); + } + if (src.hasStatus()) { + tgt.setStatus(convertFlagStatus(src.getStatus())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Group10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Group10_50.java index 95a0b4f7f..4efec57dd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Group10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Group10_50.java @@ -10,14 +10,30 @@ public class Group10_50 { return null; org.hl7.fhir.dstu2.model.Group tgt = new org.hl7.fhir.dstu2.model.Group(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setType(convertGroupType(src.getType())); - tgt.setActual(src.getActual()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setName(src.getName()); - tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertGroupType(src.getType())); + } + if (src.hasActual()) { + tgt.setActual(src.getActual()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuantity()) { + tgt.setQuantity(src.getQuantity()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -26,14 +42,30 @@ public class Group10_50 { return null; org.hl7.fhir.r5.model.Group tgt = new org.hl7.fhir.r5.model.Group(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setType(convertGroupType(src.getType())); - tgt.setActual(src.getActual()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setName(src.getName()); - tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.dstu2.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasType()) { + tgt.setType(convertGroupType(src.getType())); + } + if (src.hasActual()) { + tgt.setActual(src.getActual()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasQuantity()) { + tgt.setQuantity(src.getQuantity()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.dstu2.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -42,10 +74,18 @@ public class Group10_50 { return null; org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setExclude(src.getExclude()); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasExclude()) { + tgt.setExclude(src.getExclude()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -54,10 +94,18 @@ public class Group10_50 { return null; org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setExclude(src.getExclude()); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasExclude()) { + tgt.setExclude(src.getExclude()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -66,9 +114,15 @@ public class Group10_50 { return null; org.hl7.fhir.r5.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r5.model.Group.GroupMemberComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_50.convertReference(src.getEntity())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setInactive(src.getInactive()); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_50.convertReference(src.getEntity())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasInactive()) { + tgt.setInactive(src.getInactive()); + } return tgt; } @@ -77,9 +131,15 @@ public class Group10_50 { return null; org.hl7.fhir.dstu2.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.dstu2.model.Group.GroupMemberComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setEntity(VersionConvertor_10_50.convertReference(src.getEntity())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setInactive(src.getInactive()); + if (src.hasEntity()) { + tgt.setEntity(VersionConvertor_10_50.convertReference(src.getEntity())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasInactive()) { + tgt.setInactive(src.getInactive()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/HealthcareService10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/HealthcareService10_50.java index 4f061d080..287b1398d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/HealthcareService10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/HealthcareService10_50.java @@ -56,30 +56,64 @@ public class HealthcareService10_50 { return null; org.hl7.fhir.dstu2.model.HealthcareService tgt = new org.hl7.fhir.dstu2.model.HealthcareService(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setProvidedBy(VersionConvertor_10_50.convertReference(src.getProvidedBy())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasProvidedBy()) { + tgt.setProvidedBy(VersionConvertor_10_50.convertReference(src.getProvidedBy())); + } for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) { if (!tgt.hasServiceType()) tgt.addServiceType(); tgt.getServiceType().get(0).addSpecialty(VersionConvertor_10_50.convertCodeableConcept(t)); } - for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.setLocation(VersionConvertor_10_50.convertReference(t)); - tgt.setComment(src.getComment()); - tgt.setExtraDetails(src.getExtraDetails()); - tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setEligibility(VersionConvertor_10_50.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); - tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.setLocation(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasExtraDetails()) { + tgt.setExtraDetails(src.getExtraDetails()); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasEligibility()) { + tgt.setEligibility(VersionConvertor_10_50.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); + } + if (src.hasEligibility()) { + tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); + } for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgram()) if (t.hasText()) tgt.addProgramName(t.getText()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) { + tgt.setAppointmentRequired(src.getAppointmentRequired()); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) { + tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + } return tgt; } @@ -88,29 +122,61 @@ public class HealthcareService10_50 { return null; org.hl7.fhir.r5.model.HealthcareService tgt = new org.hl7.fhir.r5.model.HealthcareService(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setProvidedBy(VersionConvertor_10_50.convertReference(src.getProvidedBy())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasProvidedBy()) { + tgt.setProvidedBy(VersionConvertor_10_50.convertReference(src.getProvidedBy())); + } for (org.hl7.fhir.dstu2.model.HealthcareService.ServiceTypeComponent t : src.getServiceType()) { for (org.hl7.fhir.dstu2.model.CodeableConcept tj : t.getSpecialty()) tgt.addSpecialty(VersionConvertor_10_50.convertCodeableConcept(tj)); } - tgt.addLocation(VersionConvertor_10_50.convertReference(src.getLocation())); - tgt.setComment(src.getComment()); - tgt.setExtraDetails(src.getExtraDetails()); - tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasLocation()) { + tgt.addLocation(VersionConvertor_10_50.convertReference(src.getLocation())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } + if (src.hasExtraDetails()) { + tgt.setExtraDetails(src.getExtraDetails()); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_10_50.convertCodeableConcept(t)); + } if (src.hasEligibility()) tgt.getEligibilityFirstRep().setCode(VersionConvertor_10_50.convertCodeableConcept(src.getEligibility())); if (src.hasEligibilityNote()) tgt.getEligibilityFirstRep().setComment(src.getEligibilityNote()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + if (src.hasProgramName()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) { + tgt.setAppointmentRequired(src.getAppointmentRequired()); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) { + tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); + } return tgt; } @@ -119,10 +185,18 @@ public class HealthcareService10_50 { return null; org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - tgt.setAllDay(src.getAllDay()); - tgt.setAvailableStartTime(src.getAvailableStartTime()); - tgt.setAvailableEndTime(src.getAvailableEndTime()); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) { + tgt.setAllDay(src.getAllDay()); + } + if (src.hasAvailableStartTime()) { + tgt.setAvailableStartTime(src.getAvailableStartTime()); + } + if (src.hasAvailableEndTime()) { + tgt.setAvailableEndTime(src.getAvailableEndTime()); + } return tgt; } @@ -131,10 +205,18 @@ public class HealthcareService10_50 { return null; org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - tgt.setAllDay(src.getAllDay()); - tgt.setAvailableStartTime(src.getAvailableStartTime()); - tgt.setAvailableEndTime(src.getAvailableEndTime()); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_10_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) { + tgt.setAllDay(src.getAllDay()); + } + if (src.hasAvailableStartTime()) { + tgt.setAvailableStartTime(src.getAvailableStartTime()); + } + if (src.hasAvailableEndTime()) { + tgt.setAvailableEndTime(src.getAvailableEndTime()); + } return tgt; } @@ -143,8 +225,12 @@ public class HealthcareService10_50 { return null; org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setDuring(VersionConvertor_10_50.convertPeriod(src.getDuring())); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDuring()) { + tgt.setDuring(VersionConvertor_10_50.convertPeriod(src.getDuring())); + } return tgt; } @@ -153,8 +239,12 @@ public class HealthcareService10_50 { return null; org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); - tgt.setDuring(VersionConvertor_10_50.convertPeriod(src.getDuring())); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDuring()) { + tgt.setDuring(VersionConvertor_10_50.convertPeriod(src.getDuring())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ImplementationGuide10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ImplementationGuide10_50.java index a4b8237fa..7ce83626e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ImplementationGuide10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ImplementationGuide10_50.java @@ -5,7 +5,6 @@ import org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration; - import java.util.List; public class ImplementationGuide10_50 { @@ -15,29 +14,55 @@ public class ImplementationGuide10_50 { return null; org.hl7.fhir.r5.model.ImplementationGuide tgt = new org.hl7.fhir.r5.model.ImplementationGuide(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_50.convertCodeableConceptToUsageContext(t)); - tgt.setCopyright(src.getCopyright()); - if (src.hasFhirVersion()) { - tgt.addFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasFhirVersion()) { + if (src.hasFhirVersion()) { + tgt.addFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } + } + if (src.hasDependency()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasPage()) { + tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); } - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); return tgt; } @@ -46,29 +71,57 @@ public class ImplementationGuide10_50 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setCopyright(src.getCopyright()); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } for (Enumeration v : src.getFhirVersion()) { tgt.setFhirVersion(v.asStringValue()); } - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasDefinition()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + } return tgt; } @@ -77,8 +130,12 @@ public class ImplementationGuide10_50 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -87,8 +144,12 @@ public class ImplementationGuide10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -98,7 +159,9 @@ public class ImplementationGuide10_50 { org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_10_50.copyElement(src, tgt); tgt.setType(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.REFERENCE); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -107,7 +170,9 @@ public class ImplementationGuide10_50 { return null; org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -116,8 +181,12 @@ public class ImplementationGuide10_50 { return null; org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -127,9 +196,13 @@ public class ImplementationGuide10_50 { org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_10_50.copyElement(src, tgt); if (src.hasType()) { - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_10_50.convertCanonicalToReference(src.getProfileElement())); } - tgt.setProfile(VersionConvertor_10_50.convertCanonicalToReference(src.getProfileElement())); return tgt; } @@ -138,9 +211,15 @@ public class ImplementationGuide10_50 { return null; org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setId(src.getId()); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); + if (src.hasId()) { + tgt.setId(src.getId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -202,12 +281,18 @@ public class ImplementationGuide10_50 { org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); VersionConvertor_10_50.copyElement(src, tgt); if (src.hasSource()) { - tgt.setName(convertUriToUrl(src.getSourceElement())); + if (src.hasSourceElement()) { + tgt.setName(convertUriToUrl(src.getSourceElement())); + } + } + if (src.hasName()) { + tgt.setTitle(src.getName()); } - tgt.setTitle(src.getName()); if (src.hasKind()) tgt.setGeneration(convertPageGeneration(src.getKind())); - for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -218,10 +303,14 @@ public class ImplementationGuide10_50 { VersionConvertor_10_50.copyElement(src, tgt); if (src.hasNameUrlType()) tgt.setSource(src.getNameUrlType().getValue()); - tgt.setName(src.getTitle()); + if (src.hasTitle()) { + tgt.setName(src.getTitle()); + } if (src.hasGeneration()) tgt.setKind(convertPageGeneration(src.getGeneration())); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/List10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/List10_50.java index 031c6fe2b..9c43d90c2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/List10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/List10_50.java @@ -10,19 +10,41 @@ public class List10_50 { return null; org.hl7.fhir.dstu2.model.List_ tgt = new org.hl7.fhir.dstu2.model.List_(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasStatus()) { + tgt.setStatus(convertListStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); - tgt.setMode(convertListMode(src.getMode())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasMode()) { + tgt.setMode(convertListMode(src.getMode())); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + } return tgt; } @@ -31,20 +53,40 @@ public class List10_50 { return null; org.hl7.fhir.r5.model.ListResource tgt = new org.hl7.fhir.r5.model.ListResource(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setTitle(src.getTitle()); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasStatus()) { + tgt.setStatus(convertListStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); - tgt.setMode(convertListMode(src.getMode())); + if (src.hasOrderedBy()) { + tgt.setOrderedBy(VersionConvertor_10_50.convertCodeableConcept(src.getOrderedBy())); + } + if (src.hasMode()) { + tgt.setMode(convertListMode(src.getMode())); + } if (src.hasNote()) tgt.addNote(new org.hl7.fhir.r5.model.Annotation().setText(src.getNote())); - for (org.hl7.fhir.dstu2.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); + } return tgt; } @@ -53,11 +95,17 @@ public class List10_50 { return null; org.hl7.fhir.dstu2.model.List_.ListEntryComponent tgt = new org.hl7.fhir.dstu2.model.List_.ListEntryComponent(); copyBackboneElement(src, tgt); - tgt.setFlag(VersionConvertor_10_50.convertCodeableConcept(src.getFlag())); - tgt.setDeleted(src.getDeleted()); + if (src.hasFlag()) { + tgt.setFlag(VersionConvertor_10_50.convertCodeableConcept(src.getFlag())); + } + if (src.hasDeleted()) { + tgt.setDeleted(src.getDeleted()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setItem(VersionConvertor_10_50.convertReference(src.getItem())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_50.convertReference(src.getItem())); + } return tgt; } @@ -66,11 +114,17 @@ public class List10_50 { return null; org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent tgt = new org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent(); copyBackboneElement(src, tgt); - tgt.setFlag(VersionConvertor_10_50.convertCodeableConcept(src.getFlag())); - tgt.setDeleted(src.getDeleted()); + if (src.hasFlag()) { + tgt.setFlag(VersionConvertor_10_50.convertCodeableConcept(src.getFlag())); + } + if (src.hasDeleted()) { + tgt.setDeleted(src.getDeleted()); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setItem(VersionConvertor_10_50.convertReference(src.getItem())); + if (src.hasItem()) { + tgt.setItem(VersionConvertor_10_50.convertReference(src.getItem())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Location10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Location10_50.java index 75e7ef65b..260f06f17 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Location10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Location10_50.java @@ -10,18 +10,42 @@ public class Location10_50 { return null; org.hl7.fhir.dstu2.model.Location tgt = new org.hl7.fhir.dstu2.model.Location(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertLocationStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setMode(convertLocationMode(src.getMode())); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getTypeFirstRep())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); - tgt.setPhysicalType(VersionConvertor_10_50.convertCodeableConcept(src.getPhysicalType())); - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertLocationStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasMode()) { + tgt.setMode(convertLocationMode(src.getMode())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getTypeFirstRep())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + } + if (src.hasPhysicalType()) { + tgt.setPhysicalType(VersionConvertor_10_50.convertCodeableConcept(src.getPhysicalType())); + } + if (src.hasPosition()) { + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + } return tgt; } @@ -30,18 +54,42 @@ public class Location10_50 { return null; org.hl7.fhir.r5.model.Location tgt = new org.hl7.fhir.r5.model.Location(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertLocationStatus(src.getStatus())); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - tgt.setMode(convertLocationMode(src.getMode())); - tgt.addType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); - tgt.setPhysicalType(VersionConvertor_10_50.convertCodeableConcept(src.getPhysicalType())); - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertLocationStatus(src.getStatus())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasMode()) { + tgt.setMode(convertLocationMode(src.getMode())); + } + if (src.hasType()) { + tgt.addType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + } + if (src.hasPhysicalType()) { + tgt.setPhysicalType(VersionConvertor_10_50.convertCodeableConcept(src.getPhysicalType())); + } + if (src.hasPosition()) { + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + } return tgt; } @@ -76,9 +124,15 @@ public class Location10_50 { return null; org.hl7.fhir.r5.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r5.model.Location.LocationPositionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLongitude(src.getLongitude()); - tgt.setLatitude(src.getLatitude()); - tgt.setAltitude(src.getAltitude()); + if (src.hasLongitude()) { + tgt.setLongitude(src.getLongitude()); + } + if (src.hasLatitude()) { + tgt.setLatitude(src.getLatitude()); + } + if (src.hasAltitude()) { + tgt.setAltitude(src.getAltitude()); + } return tgt; } @@ -87,9 +141,15 @@ public class Location10_50 { return null; org.hl7.fhir.dstu2.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.dstu2.model.Location.LocationPositionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLongitude(src.getLongitude()); - tgt.setLatitude(src.getLatitude()); - tgt.setAltitude(src.getAltitude()); + if (src.hasLongitude()) { + tgt.setLongitude(src.getLongitude()); + } + if (src.hasLatitude()) { + tgt.setLatitude(src.getLatitude()); + } + if (src.hasAltitude()) { + tgt.setAltitude(src.getAltitude()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationDispense10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationDispense10_50.java index a2640c244..a9eeadfbf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationDispense10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationDispense10_50.java @@ -12,22 +12,50 @@ public class MedicationDispense10_50 { return null; org.hl7.fhir.r5.model.MedicationDispense tgt = new org.hl7.fhir.r5.model.MedicationDispense(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setStatusElement(convertMedicationDispenseStatus(src.getStatusElement())); - tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_50.convertReference(t)); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); - tgt.setDaysSupply(VersionConvertor_10_50.convertSimpleQuantity(src.getDaysSupply())); - tgt.setWhenPrepared(src.getWhenPrepared()); - tgt.setWhenHandedOver(src.getWhenHandedOver()); - tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasStatusElement()) { + tgt.setStatusElement(convertMedicationDispenseStatus(src.getStatusElement())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDaysSupply()) { + tgt.setDaysSupply(VersionConvertor_10_50.convertSimpleQuantity(src.getDaysSupply())); + } + if (src.hasWhenPrepared()) { + tgt.setWhenPrepared(src.getWhenPrepared()); + } + if (src.hasWhenHandedOver()) { + tgt.setWhenHandedOver(src.getWhenHandedOver()); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); + } if (src.hasNote()) tgt.addNote().setText(src.getNote()); - for (org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); + } + if (src.hasSubstitution()) { + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + } return tgt; } @@ -36,21 +64,51 @@ public class MedicationDispense10_50 { return null; org.hl7.fhir.dstu2.model.MedicationDispense tgt = new org.hl7.fhir.dstu2.model.MedicationDispense(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setStatusElement(convertMedicationDispenseStatus(src.getStatusElement())); - tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_50.convertReference(t)); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); - tgt.setDaysSupply(VersionConvertor_10_50.convertSimpleQuantity(src.getDaysSupply())); - tgt.setWhenPrepared(src.getWhenPrepared()); - tgt.setWhenHandedOver(src.getWhenHandedOver()); - tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); - for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasStatusElement()) { + tgt.setStatusElement(convertMedicationDispenseStatus(src.getStatusElement())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + } + if (src.hasDaysSupply()) { + tgt.setDaysSupply(VersionConvertor_10_50.convertSimpleQuantity(src.getDaysSupply())); + } + if (src.hasWhenPrepared()) { + tgt.setWhenPrepared(src.getWhenPrepared()); + } + if (src.hasWhenHandedOver()) { + tgt.setWhenHandedOver(src.getWhenHandedOver()); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); + } + if (src.hasSubstitution()) { + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + } return tgt; } @@ -59,13 +117,23 @@ public class MedicationDispense10_50 { return null; org.hl7.fhir.r5.model.Dosage tgt = new org.hl7.fhir.r5.model.Dosage(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); + } if (src.hasSiteCodeableConcept()) tgt.setSite(VersionConvertor_10_50.convertCodeableConcept(src.getSiteCodeableConcept())); - tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } if (src.hasDose() || src.hasRate()) { DosageDoseAndRateComponent dr = tgt.addDoseAndRate(); if (src.hasDose()) @@ -73,7 +141,9 @@ public class MedicationDispense10_50 { if (src.hasRate()) dr.setRate(VersionConvertor_10_50.convertType(src.getRate())); } - tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } @@ -82,15 +152,29 @@ public class MedicationDispense10_50 { return null; org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent tgt = new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); - tgt.setSite(VersionConvertor_10_50.convertType(src.getSite())); - tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_50.convertType(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } if (src.hasDoseAndRate() && src.getDoseAndRate().get(0).hasDose()) tgt.setDose(VersionConvertor_10_50.convertType(src.getDoseAndRate().get(0).getDose())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + } if (src.hasDoseAndRate() && src.getDoseAndRate().get(0).hasRate()) tgt.setRate(VersionConvertor_10_50.convertType(src.getDoseAndRate().get(0).getRate())); return tgt; @@ -157,8 +241,12 @@ public class MedicationDispense10_50 { return null; org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConcept(t)); + } if (src.hasResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_10_50.convertReference(src.getResponsibleParty())); return tgt; @@ -169,9 +257,15 @@ public class MedicationDispense10_50 { return null; org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getResponsibleParty()) tgt.setResponsibleParty(VersionConvertor_10_50.convertReference(t)); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getResponsibleParty()) tgt.setResponsibleParty(VersionConvertor_10_50.convertReference(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationStatement10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationStatement10_50.java index 1adf4dd1b..05d58a5e5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationStatement10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MedicationStatement10_50.java @@ -11,17 +11,35 @@ public class MedicationStatement10_50 { return null; org.hl7.fhir.dstu2.model.MedicationStatement tgt = new org.hl7.fhir.dstu2.model.MedicationStatement(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); - tgt.setInformationSource(VersionConvertor_10_50.convertReference(src.getInformationSource())); - for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addSupportingInformation(VersionConvertor_10_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); + } + if (src.hasSubject()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); + } + if (src.hasInformationSource()) { + tgt.setInformationSource(VersionConvertor_10_50.convertReference(src.getInformationSource())); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addSupportingInformation(VersionConvertor_10_50.convertReference(t)); + } if (src.hasDateAsserted()) tgt.setDateAsserted(src.getDateAsserted()); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); + } + if (src.hasDosage()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + } return tgt; } @@ -30,18 +48,34 @@ public class MedicationStatement10_50 { return null; org.hl7.fhir.r5.model.MedicationUsage tgt = new org.hl7.fhir.r5.model.MedicationUsage(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); - tgt.setInformationSource(VersionConvertor_10_50.convertReference(src.getInformationSource())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addDerivedFrom(VersionConvertor_10_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + } + if (src.hasMedication()) { + tgt.setMedication(VersionConvertor_10_50.convertType(src.getMedication())); + } + if (src.hasPatient()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); + } + if (src.hasInformationSource()) { + tgt.setInformationSource(VersionConvertor_10_50.convertReference(src.getInformationSource())); + } + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getSupportingInformation()) tgt.addDerivedFrom(VersionConvertor_10_50.convertReference(t)); + } if (src.hasDateAsserted()) tgt.setDateAsserted(src.getDateAsserted()); if (src.hasNote()) tgt.addNote().setText(src.getNote()); - for (org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + if (src.hasDosage()) { + for (org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); + } return tgt; } @@ -50,19 +84,31 @@ public class MedicationStatement10_50 { return null; org.hl7.fhir.r5.model.Dosage tgt = new org.hl7.fhir.r5.model.Dosage(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); + } if (src.hasSiteCodeableConcept()) tgt.setSite(VersionConvertor_10_50.convertCodeableConcept(src.getSiteCodeableConcept())); - tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } if (src.hasRate()) { DosageDoseAndRateComponent dr = tgt.addDoseAndRate(); if (src.hasRate()) dr.setRate(VersionConvertor_10_50.convertType(src.getRate())); } - tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } @@ -71,15 +117,29 @@ public class MedicationStatement10_50 { return null; org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent tgt = new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setText(src.getText()); - tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); - tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); - tgt.setSite(VersionConvertor_10_50.convertType(src.getSite())); - tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasTiming()) { + tgt.setTiming(VersionConvertor_10_50.convertTiming(src.getTiming())); + } + if (src.hasAsNeeded()) { + tgt.setAsNeeded(VersionConvertor_10_50.convertType(src.getAsNeeded())); + } + if (src.hasSite()) { + tgt.setSite(VersionConvertor_10_50.convertType(src.getSite())); + } + if (src.hasRoute()) { + tgt.setRoute(VersionConvertor_10_50.convertCodeableConcept(src.getRoute())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } if (src.hasDoseAndRate() && src.getDoseAndRate().get(0).hasRate()) tgt.setRate(VersionConvertor_10_50.convertType(src.getDoseAndRate().get(0).getRate())); - tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerPeriod()) { + tgt.setMaxDosePerPeriod(VersionConvertor_10_50.convertRatio(src.getMaxDosePerPeriod())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MessageHeader10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MessageHeader10_50.java index db5b3d554..ebac509df 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MessageHeader10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/MessageHeader10_50.java @@ -10,9 +10,15 @@ public class MessageHeader10_50 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -21,9 +27,15 @@ public class MessageHeader10_50 { return null; org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -34,14 +46,30 @@ public class MessageHeader10_50 { VersionConvertor_10_50.copyDomainResource(src, tgt); if (src.hasEventCoding()) tgt.setEvent(VersionConvertor_10_50.convertCoding(src.getEventCoding())); - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - tgt.setSource(convertMessageSourceComponent(src.getSource())); - for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); - tgt.setEnterer(VersionConvertor_10_50.convertReference(src.getEnterer())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.setResponsible(VersionConvertor_10_50.convertReference(src.getResponsible())); - tgt.setReason(VersionConvertor_10_50.convertCodeableConcept(src.getReason())); - for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addData(VersionConvertor_10_50.convertReference(t)); + if (src.hasResponse()) { + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + } + if (src.hasSource()) { + tgt.setSource(convertMessageSourceComponent(src.getSource())); + } + if (src.hasDestination()) { + for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasEnterer()) { + tgt.setEnterer(VersionConvertor_10_50.convertReference(src.getEnterer())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasResponsible()) { + tgt.setResponsible(VersionConvertor_10_50.convertReference(src.getResponsible())); + } + if (src.hasReason()) { + tgt.setReason(VersionConvertor_10_50.convertCodeableConcept(src.getReason())); + } + if (src.hasFocus()) { + for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addData(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -50,15 +78,33 @@ public class MessageHeader10_50 { return null; org.hl7.fhir.r5.model.MessageHeader tgt = new org.hl7.fhir.r5.model.MessageHeader(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setEvent(VersionConvertor_10_50.convertCoding(src.getEvent())); - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - tgt.setSource(convertMessageSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); - tgt.setEnterer(VersionConvertor_10_50.convertReference(src.getEnterer())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.setResponsible(VersionConvertor_10_50.convertReference(src.getResponsible())); - tgt.setReason(VersionConvertor_10_50.convertCodeableConcept(src.getReason())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getData()) tgt.addFocus(VersionConvertor_10_50.convertReference(t)); + if (src.hasEvent()) { + tgt.setEvent(VersionConvertor_10_50.convertCoding(src.getEvent())); + } + if (src.hasResponse()) { + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + } + if (src.hasSource()) { + tgt.setSource(convertMessageSourceComponent(src.getSource())); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu2.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasEnterer()) { + tgt.setEnterer(VersionConvertor_10_50.convertReference(src.getEnterer())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasResponsible()) { + tgt.setResponsible(VersionConvertor_10_50.convertReference(src.getResponsible())); + } + if (src.hasReason()) { + tgt.setReason(VersionConvertor_10_50.convertCodeableConcept(src.getReason())); + } + if (src.hasData()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getData()) tgt.addFocus(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -67,9 +113,15 @@ public class MessageHeader10_50 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setCode(convertResponseType(src.getCode())); - tgt.setDetails(VersionConvertor_10_50.convertReference(src.getDetails())); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasCode()) { + tgt.setCode(convertResponseType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_50.convertReference(src.getDetails())); + } return tgt; } @@ -78,9 +130,15 @@ public class MessageHeader10_50 { return null; org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setCode(convertResponseType(src.getCode())); - tgt.setDetails(VersionConvertor_10_50.convertReference(src.getDetails())); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasCode()) { + tgt.setCode(convertResponseType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_50.convertReference(src.getDetails())); + } return tgt; } @@ -89,11 +147,21 @@ public class MessageHeader10_50 { return null; org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setSoftware(src.getSoftware()); - tgt.setVersion(src.getVersion()); - tgt.setContact(VersionConvertor_10_50.convertContactPoint(src.getContact())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSoftware()) { + tgt.setSoftware(src.getSoftware()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasContact()) { + tgt.setContact(VersionConvertor_10_50.convertContactPoint(src.getContact())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } @@ -102,11 +170,21 @@ public class MessageHeader10_50 { return null; org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setSoftware(src.getSoftware()); - tgt.setVersion(src.getVersion()); - tgt.setContact(VersionConvertor_10_50.convertContactPoint(src.getContact())); - tgt.setEndpoint(src.getEndpoint()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSoftware()) { + tgt.setSoftware(src.getSoftware()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasContact()) { + tgt.setContact(VersionConvertor_10_50.convertContactPoint(src.getContact())); + } + if (src.hasEndpoint()) { + tgt.setEndpoint(src.getEndpoint()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/NamingSystem10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/NamingSystem10_50.java index 61fb7cf8d..e2053f961 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/NamingSystem10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/NamingSystem10_50.java @@ -10,21 +10,43 @@ public class NamingSystem10_50 { return null; org.hl7.fhir.dstu2.model.NamingSystem tgt = new org.hl7.fhir.dstu2.model.NamingSystem(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); - tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } + if (src.hasResponsible()) { + tgt.setResponsible(src.getResponsible()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasUsage()) { + tgt.setUsage(src.getUsage()); + } + if (src.hasUniqueId()) { + for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -33,22 +55,42 @@ public class NamingSystem10_50 { return null; org.hl7.fhir.r5.model.NamingSystem tgt = new org.hl7.fhir.r5.model.NamingSystem(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); - tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } + if (src.hasResponsible()) { + tgt.setResponsible(src.getResponsible()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_50.convertCodeableConceptToUsageContext(t)); - tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUsage()) { + tgt.setUsage(src.getUsage()); + } + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -57,8 +99,12 @@ public class NamingSystem10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -67,8 +113,12 @@ public class NamingSystem10_50 { return null; org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent tgt = new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -141,10 +191,18 @@ public class NamingSystem10_50 { return null; org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); - tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -153,10 +211,18 @@ public class NamingSystem10_50 { return null; org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); - tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Observation10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Observation10_50.java index 3627d65b4..81383ce00 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Observation10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Observation10_50.java @@ -10,28 +10,68 @@ public class Observation10_50 { return null; org.hl7.fhir.dstu2.model.Observation tgt = new org.hl7.fhir.dstu2.model.Observation(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept c : src.getCategory()) tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(c)); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); - tgt.setInterpretation(VersionConvertor_10_50.convertCodeableConcept(src.getInterpretationFirstRep())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertObservationStatus(src.getStatus())); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept c : src.getCategory()) tgt.setCategory(VersionConvertor_10_50.convertCodeableConcept(c)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasInterpretation()) { + tgt.setInterpretation(VersionConvertor_10_50.convertCodeableConcept(src.getInterpretationFirstRep())); + } if (src.hasNote()) tgt.setComments(src.getNoteFirstRep().getText()); - tgt.setBodySite(VersionConvertor_10_50.convertCodeableConcept(src.getBodySite())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); - tgt.setSpecimen(VersionConvertor_10_50.convertReference(src.getSpecimen())); - tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); - for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER)); - for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM)); - for (org.hl7.fhir.r5.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_50.convertCodeableConcept(src.getBodySite())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } + if (src.hasSpecimen()) { + tgt.setSpecimen(VersionConvertor_10_50.convertReference(src.getSpecimen())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasHasMember()) { + for (org.hl7.fhir.r5.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER)); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r5.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -40,29 +80,67 @@ public class Observation10_50 { return null; org.hl7.fhir.r5.model.Observation tgt = new org.hl7.fhir.r5.model.Observation(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setStatus(convertObservationStatus(src.getStatus())); - tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); - tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); - tgt.addInterpretation(VersionConvertor_10_50.convertCodeableConcept(src.getInterpretation())); - tgt.addNote().setText(src.getComments()); - tgt.setBodySite(VersionConvertor_10_50.convertCodeableConcept(src.getBodySite())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); - tgt.setSpecimen(VersionConvertor_10_50.convertReference(src.getSpecimen())); - tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasStatus()) { + tgt.setStatus(convertObservationStatus(src.getStatus())); + } + if (src.hasCategory()) { + tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(src.getCategory())); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasEffective()) { + tgt.setEffective(VersionConvertor_10_50.convertType(src.getEffective())); + } + if (src.hasIssued()) { + tgt.setIssued(src.getIssued()); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasInterpretation()) { + tgt.addInterpretation(VersionConvertor_10_50.convertCodeableConcept(src.getInterpretation())); + } + if (src.hasComments()) { + tgt.addNote().setText(src.getComments()); + } + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_10_50.convertCodeableConcept(src.getBodySite())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } + if (src.hasSpecimen()) { + tgt.setSpecimen(VersionConvertor_10_50.convertReference(src.getSpecimen())); + } + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_10_50.convertReference(src.getDevice())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } for (org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent t : src.getRelated()) if (t.getType() == org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER) tgt.addHasMember(VersionConvertor_10_50.convertReference(t.getTarget())); else if (t.getType() == org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM) tgt.addDerivedFrom(VersionConvertor_10_50.convertReference(t.getTarget())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasComponent()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -71,10 +149,18 @@ public class Observation10_50 { return null; org.hl7.fhir.r5.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationComponentComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -83,10 +169,18 @@ public class Observation10_50 { return null; org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.dstu2.model.Observation.ObservationComponentComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasDataAbsentReason()) { + tgt.setDataAbsentReason(VersionConvertor_10_50.convertCodeableConcept(src.getDataAbsentReason())); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -95,11 +189,21 @@ public class Observation10_50 { return null; org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLow(VersionConvertor_10_50.convertSimpleQuantity(src.getLow())); - tgt.setHigh(VersionConvertor_10_50.convertSimpleQuantity(src.getHigh())); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getMeaning())); - tgt.setAge(VersionConvertor_10_50.convertRange(src.getAge())); - tgt.setText(src.getText()); + if (src.hasLow()) { + tgt.setLow(VersionConvertor_10_50.convertSimpleQuantity(src.getLow())); + } + if (src.hasHigh()) { + tgt.setHigh(VersionConvertor_10_50.convertSimpleQuantity(src.getHigh())); + } + if (src.hasMeaning()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getMeaning())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_50.convertRange(src.getAge())); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } return tgt; } @@ -108,11 +212,21 @@ public class Observation10_50 { return null; org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLow(VersionConvertor_10_50.convertSimpleQuantity(src.getLow())); - tgt.setHigh(VersionConvertor_10_50.convertSimpleQuantity(src.getHigh())); - tgt.setMeaning(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setAge(VersionConvertor_10_50.convertRange(src.getAge())); - tgt.setText(src.getText()); + if (src.hasLow()) { + tgt.setLow(VersionConvertor_10_50.convertSimpleQuantity(src.getLow())); + } + if (src.hasHigh()) { + tgt.setHigh(VersionConvertor_10_50.convertSimpleQuantity(src.getHigh())); + } + if (src.hasType()) { + tgt.setMeaning(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasAge()) { + tgt.setAge(VersionConvertor_10_50.convertRange(src.getAge())); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationDefinition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationDefinition10_50.java index 4c0074326..3e97d5276 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationDefinition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationDefinition10_50.java @@ -18,29 +18,61 @@ public class OperationDefinition10_50 { return null; org.hl7.fhir.dstu2.model.OperationDefinition tgt = new org.hl7.fhir.dstu2.model.OperationDefinition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setRequirements(src.getPurpose()); - tgt.setIdempotent(!src.getAffectsState()); - tgt.setCode(src.getCode()); - tgt.setNotes(src.getComment()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasAffectsState()) { + tgt.setIdempotent(!src.getAffectsState()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasComment()) { + tgt.setNotes(src.getComment()); + } if (src.hasBase()) tgt.setBase(VersionConvertor_10_50.convertCanonicalToReference(src.getBaseElement())); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.getType()) - for (CodeType t : src.getResource()) tgt.addType(t.getValue()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasResource()) { + for (CodeType t : src.getResource()) tgt.addType(t.getValue()); + } + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -49,29 +81,61 @@ public class OperationDefinition10_50 { return null; org.hl7.fhir.r5.model.OperationDefinition tgt = new org.hl7.fhir.r5.model.OperationDefinition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); - tgt.setDescription(src.getDescription()); - tgt.setPurpose(src.getRequirements()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } if (src.hasIdempotent()) tgt.setAffectsState(!src.getIdempotent()); - tgt.setCode(src.getCode()); - tgt.setComment(src.getNotes()); - tgt.setBaseElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getBase())); - tgt.setSystem(src.getSystem()); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasNotes()) { + tgt.setComment(src.getNotes()); + } + if (src.hasBase()) { + tgt.setBaseElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getBase())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + } tgt.setType(tgt.hasResource()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -80,8 +144,12 @@ public class OperationDefinition10_50 { return null; org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent tgt = new org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -90,8 +158,12 @@ public class OperationDefinition10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -133,20 +205,40 @@ public class OperationDefinition10_50 { return null; org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } if (Utilities.existsInList(src.getType(), "token", "reference", "composite", "number", "date", "quantity", "uri")) { tgt.setType(FHIRAllTypes.STRING); - tgt.setSearchType(SearchParamType.fromCode(src.getType())); + if (src.hasType()) { + tgt.setSearchType(SearchParamType.fromCode(src.getType())); + } } else { - tgt.setType(Enumerations.FHIRAllTypes.fromCode(src.getType())); + if (src.hasType()) { + tgt.setType(Enumerations.FHIRAllTypes.fromCode(src.getType())); + } + } + if (src.hasProfile()) { + tgt.addTargetProfile(src.getProfile().getReference()); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); } - tgt.addTargetProfile(src.getProfile().getReference()); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); return tgt; } @@ -155,19 +247,35 @@ public class OperationDefinition10_50 { return null; org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); - tgt.setDocumentation(src.getDocumentation()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } + if (src.hasDocumentation()) { + tgt.setDocumentation(src.getDocumentation()); + } if (src.hasSearchType()) { - tgt.setType(src.getSearchType().toCode()); + if (src.hasSearchType()) { + tgt.setType(src.getSearchType().toCode()); + } } else tgt.setType(src.getType().toCode()); - for (org.hl7.fhir.r5.model.UriType t : src.getTargetProfile()) tgt.setProfile(new Reference(t.getValue())); + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r5.model.UriType t : src.getTargetProfile()) tgt.setProfile(new Reference(t.getValue())); + } if (src.hasBinding()) tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationOutcome10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationOutcome10_50.java index 8dd5c7a71..af5821335 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationOutcome10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/OperationOutcome10_50.java @@ -178,7 +178,9 @@ public class OperationOutcome10_50 { return null; org.hl7.fhir.r5.model.OperationOutcome tgt = new org.hl7.fhir.r5.model.OperationOutcome(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome10_50 { return null; org.hl7.fhir.dstu2.model.OperationOutcome tgt = new org.hl7.fhir.dstu2.model.OperationOutcome(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -196,11 +200,21 @@ public class OperationOutcome10_50 { return null; org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_10_50.convertCodeableConcept(src.getDetails())); - tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu2.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_50.convertCodeableConcept(src.getDetails())); + } + if (src.hasDiagnostics()) { + tgt.setDiagnostics(src.getDiagnostics()); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } return tgt; } @@ -209,11 +223,21 @@ public class OperationOutcome10_50 { return null; org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_10_50.convertCodeableConcept(src.getDetails())); - tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_10_50.convertCodeableConcept(src.getDetails())); + } + if (src.hasDiagnostics()) { + tgt.setDiagnostics(src.getDiagnostics()); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Organization10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Organization10_50.java index dcc4d5706..595f8aaed 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Organization10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Organization10_50.java @@ -10,14 +10,30 @@ public class Organization10_50 { return null; org.hl7.fhir.r5.model.Organization tgt = new org.hl7.fhir.r5.model.Organization(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setActive(src.getActive()); - tgt.addType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasType()) { + tgt.addType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } return tgt; } @@ -26,14 +42,30 @@ public class Organization10_50 { return null; org.hl7.fhir.dstu2.model.Organization tgt = new org.hl7.fhir.dstu2.model.Organization(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setActive(src.getActive()); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getTypeFirstRep())); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); - for (org.hl7.fhir.r5.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getTypeFirstRep())); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasPartOf()) { + tgt.setPartOf(VersionConvertor_10_50.convertReference(src.getPartOf())); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } return tgt; } @@ -42,10 +74,18 @@ public class Organization10_50 { return null; org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.dstu2.model.Organization.OrganizationContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setPurpose(VersionConvertor_10_50.convertCodeableConcept(src.getPurpose())); - tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + if (src.hasPurpose()) { + tgt.setPurpose(VersionConvertor_10_50.convertCodeableConcept(src.getPurpose())); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + } return tgt; } @@ -54,10 +94,18 @@ public class Organization10_50 { return null; org.hl7.fhir.r5.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.r5.model.Organization.OrganizationContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setPurpose(VersionConvertor_10_50.convertCodeableConcept(src.getPurpose())); - tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + if (src.hasPurpose()) { + tgt.setPurpose(VersionConvertor_10_50.convertCodeableConcept(src.getPurpose())); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Parameters10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Parameters10_50.java index 70b09893e..80dd775bc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Parameters10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Parameters10_50.java @@ -10,7 +10,9 @@ public class Parameters10_50 { return null; org.hl7.fhir.r5.model.Parameters tgt = new org.hl7.fhir.r5.model.Parameters(); VersionConvertor_10_50.copyResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters10_50 { return null; org.hl7.fhir.dstu2.model.Parameters tgt = new org.hl7.fhir.dstu2.model.Parameters(); VersionConvertor_10_50.copyResource(src, tgt); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -28,10 +32,18 @@ public class Parameters10_50 { return null; org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setResource(VersionConvertor_10_50.convertResource(src.getResource())); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_50.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -40,10 +52,18 @@ public class Parameters10_50 { return null; org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - tgt.setResource(VersionConvertor_10_50.convertResource(src.getResource())); - for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_50.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Patient10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Patient10_50.java index 30fbe0d31..14c6984bf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Patient10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Patient10_50.java @@ -39,13 +39,27 @@ public class Patient10_50 { return null; org.hl7.fhir.r5.model.Patient.ContactComponent tgt = new org.hl7.fhir.r5.model.Patient.ContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setOrganization(VersionConvertor_10_50.convertReference(src.getOrganization())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasRelationship()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_50.convertReference(src.getOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -54,13 +68,27 @@ public class Patient10_50 { return null; org.hl7.fhir.dstu2.model.Patient.ContactComponent tgt = new org.hl7.fhir.dstu2.model.Patient.ContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setOrganization(VersionConvertor_10_50.convertReference(src.getOrganization())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + if (src.hasRelationship()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasName()) { + tgt.setName(VersionConvertor_10_50.convertHumanName(src.getName())); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + tgt.setAddress(VersionConvertor_10_50.convertAddress(src.getAddress())); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasOrganization()) { + tgt.setOrganization(VersionConvertor_10_50.convertReference(src.getOrganization())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -101,24 +129,56 @@ public class Patient10_50 { return null; org.hl7.fhir.r5.model.Patient tgt = new org.hl7.fhir.r5.model.Patient(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setMaritalStatus(VersionConvertor_10_50.convertCodeableConcept(src.getMaritalStatus())); - tgt.setMultipleBirth(VersionConvertor_10_50.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); - for (org.hl7.fhir.dstu2.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasMaritalStatus()) { + tgt.setMaritalStatus(VersionConvertor_10_50.convertCodeableConcept(src.getMaritalStatus())); + } + if (src.hasMultipleBirth()) { + tgt.setMultipleBirth(VersionConvertor_10_50.convertType(src.getMultipleBirth())); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasAnimal()) tgt.addExtension(convertAnimalComponent(src.getAnimal())); - for (org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getCareProvider()) tgt.addGeneralPractitioner(VersionConvertor_10_50.convertReference(t)); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasCareProvider()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getCareProvider()) tgt.addGeneralPractitioner(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -127,24 +187,56 @@ public class Patient10_50 { return null; org.hl7.fhir.dstu2.model.Patient tgt = new org.hl7.fhir.dstu2.model.Patient(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setMaritalStatus(VersionConvertor_10_50.convertCodeableConcept(src.getMaritalStatus())); - tgt.setMultipleBirth(VersionConvertor_10_50.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); - for (org.hl7.fhir.r5.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasDeceased()) { + tgt.setDeceased(VersionConvertor_10_50.convertType(src.getDeceased())); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasMaritalStatus()) { + tgt.setMaritalStatus(VersionConvertor_10_50.convertCodeableConcept(src.getMaritalStatus())); + } + if (src.hasMultipleBirth()) { + tgt.setMultipleBirth(VersionConvertor_10_50.convertType(src.getMultipleBirth())); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/patient-animal")) tgt.setAnimal(convertAnimalComponent(src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-animal"))); - for (org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getGeneralPractitioner()) tgt.addCareProvider(VersionConvertor_10_50.convertReference(t)); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r5.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.r5.model.Reference t : src.getGeneralPractitioner()) tgt.addCareProvider(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -153,8 +245,12 @@ public class Patient10_50 { return null; org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLanguage(VersionConvertor_10_50.convertCodeableConcept(src.getLanguage())); - tgt.setPreferred(src.getPreferred()); + if (src.hasLanguage()) { + tgt.setLanguage(VersionConvertor_10_50.convertCodeableConcept(src.getLanguage())); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } return tgt; } @@ -163,8 +259,12 @@ public class Patient10_50 { return null; org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLanguage(VersionConvertor_10_50.convertCodeableConcept(src.getLanguage())); - tgt.setPreferred(src.getPreferred()); + if (src.hasLanguage()) { + tgt.setLanguage(VersionConvertor_10_50.convertCodeableConcept(src.getLanguage())); + } + if (src.hasPreferred()) { + tgt.setPreferred(src.getPreferred()); + } return tgt; } @@ -173,8 +273,12 @@ public class Patient10_50 { return null; org.hl7.fhir.r5.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOther(VersionConvertor_10_50.convertReference(src.getOther())); - tgt.setType(convertLinkType(src.getType())); + if (src.hasOther()) { + tgt.setOther(VersionConvertor_10_50.convertReference(src.getOther())); + } + if (src.hasType()) { + tgt.setType(convertLinkType(src.getType())); + } return tgt; } @@ -183,8 +287,12 @@ public class Patient10_50 { return null; org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.dstu2.model.Patient.PatientLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOther(VersionConvertor_10_50.convertReference(src.getOther())); - tgt.setType(convertLinkType(src.getType())); + if (src.hasOther()) { + tgt.setOther(VersionConvertor_10_50.convertReference(src.getOther())); + } + if (src.hasType()) { + tgt.setType(convertLinkType(src.getType())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Person10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Person10_50.java index b64a70c46..5ebd6c97b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Person10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Person10_50.java @@ -44,16 +44,36 @@ public class Person10_50 { return null; org.hl7.fhir.r5.model.Person tgt = new org.hl7.fhir.r5.model.Person(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu2.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu2.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -62,16 +82,36 @@ public class Person10_50 { return null; org.hl7.fhir.dstu2.model.Person tgt = new org.hl7.fhir.dstu2.model.Person(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); - tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.r5.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_10_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasPhoto()) { + tgt.setPhoto(VersionConvertor_10_50.convertAttachment(src.getPhoto())); + } + if (src.hasManagingOrganization()) { + tgt.setManagingOrganization(VersionConvertor_10_50.convertReference(src.getManagingOrganization())); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -80,8 +120,12 @@ public class Person10_50 { return null; org.hl7.fhir.dstu2.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.dstu2.model.Person.PersonLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + } + if (src.hasAssurance()) { + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + } return tgt; } @@ -90,8 +134,12 @@ public class Person10_50 { return null; org.hl7.fhir.r5.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r5.model.Person.PersonLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_10_50.convertReference(src.getTarget())); + } + if (src.hasAssurance()) { + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Practitioner10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Practitioner10_50.java index cdd09417c..2d126c474 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Practitioner10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Practitioner10_50.java @@ -10,17 +10,35 @@ public class Practitioner10_50 { return null; org.hl7.fhir.r5.model.Practitioner tgt = new org.hl7.fhir.r5.model.Practitioner(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setActive(src.getActive()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } if (src.hasName()) tgt.addName(VersionConvertor_10_50.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); - for (org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_50.convertCodeableConcept(t)); + } return tgt; } @@ -29,16 +47,36 @@ public class Practitioner10_50 { return null; org.hl7.fhir.dstu2.model.Practitioner tgt = new org.hl7.fhir.dstu2.model.Practitioner(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setActive(src.getActive()); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.setName(VersionConvertor_10_50.convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); - tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); - tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); - for (org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_50.convertCodeableConcept(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.setName(VersionConvertor_10_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_50.convertAddress(t)); + } + if (src.hasGender()) { + tgt.setGender(VersionConvertor_10_50.convertAdministrativeGender(src.getGender())); + } + if (src.hasBirthDate()) { + tgt.setBirthDate(src.getBirthDate()); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_50.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_10_50.convertCodeableConcept(t)); + } return tgt; } @@ -47,10 +85,18 @@ public class Practitioner10_50 { return null; org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setIssuer(VersionConvertor_10_50.convertReference(src.getIssuer())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasIssuer()) { + tgt.setIssuer(VersionConvertor_10_50.convertReference(src.getIssuer())); + } return tgt; } @@ -59,10 +105,18 @@ public class Practitioner10_50 { return null; org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.dstu2.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); - tgt.setIssuer(VersionConvertor_10_50.convertReference(src.getIssuer())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_10_50.convertPeriod(src.getPeriod())); + } + if (src.hasIssuer()) { + tgt.setIssuer(VersionConvertor_10_50.convertReference(src.getIssuer())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Questionnaire10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Questionnaire10_50.java index e64dba5ab..a6f6f810f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Questionnaire10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Questionnaire10_50.java @@ -33,19 +33,33 @@ public class Questionnaire10_50 { return null; org.hl7.fhir.dstu2.model.Questionnaire tgt = new org.hl7.fhir.dstu2.model.Questionnaire(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r5.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t1)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r5.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t1)); + } org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent root = tgt.getGroup(); - root.setTitle(src.getTitle()); + if (src.hasTitle()) { + root.setTitle(src.getTitle()); + } for (org.hl7.fhir.r5.model.Coding t : src.getCode()) { root.addConcept(VersionConvertor_10_50.convertCoding(t)); } - for (CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + if (src.hasSubjectType()) { + for (CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) if (t.getType() == org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP) root.addGroup(convertQuestionnaireGroupComponent(t)); else @@ -67,11 +81,21 @@ public class Questionnaire10_50 { return null; org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent tgt = new org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_50.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) if (t.getType() == org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP) tgt.addGroup(convertQuestionnaireGroupComponent(t)); else @@ -84,14 +108,28 @@ public class Questionnaire10_50 { return null; org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_50.convertCoding(t)); - tgt.setText(src.getText()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } tgt.setType(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); - for (org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireQuestionComponent(t)); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + } + if (src.hasQuestion()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireQuestionComponent(t)); + } return tgt; } @@ -137,20 +175,36 @@ public class Questionnaire10_50 { return null; org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent tgt = new org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_50.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - tgt.setOptions(VersionConvertor_10_50.convertCanonicalToReference(src.getAnswerValueSetElement())); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasAnswerValueSetElement()) { + tgt.setOptions(VersionConvertor_10_50.convertCanonicalToReference(src.getAnswerValueSetElement())); + } for (QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) if (t.hasValueCoding()) try { tgt.addOption(VersionConvertor_10_50.convertCoding(t.getValueCoding())); } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireGroupComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireGroupComponent(t)); + } return tgt; } @@ -159,15 +213,33 @@ public class Questionnaire10_50 { return null; org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_50.convertCoding(t)); - tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireQuestionType(src.getType())); - tgt.setRequired(src.getRequired()); - tgt.setRepeats(src.getRepeats()); - tgt.setAnswerValueSetElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getOptions())); - for (org.hl7.fhir.dstu2.model.Coding t : src.getOption()) tgt.addAnswerOption().setValue(VersionConvertor_10_50.convertCoding(t)); - for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasType()) { + tgt.setType(convertQuestionnaireQuestionType(src.getType())); + } + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasRepeats()) { + tgt.setRepeats(src.getRepeats()); + } + if (src.hasOptions()) { + tgt.setAnswerValueSetElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getOptions())); + } + if (src.hasOption()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getOption()) tgt.addAnswerOption().setValue(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/QuestionnaireResponse10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/QuestionnaireResponse10_50.java index 67d292177..92e2bc3fd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/QuestionnaireResponse10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/QuestionnaireResponse10_50.java @@ -10,8 +10,12 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) if (t.hasAnswer()) tgt.addQuestion(convertQuestionnaireItemToQuestion(t)); else @@ -24,9 +28,15 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } return tgt; } @@ -35,17 +45,35 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_10_50.convertCanonicalToReference(src.getQuestionnaireElement())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaireElement()) { + tgt.setQuestionnaire(VersionConvertor_10_50.convertCanonicalToReference(src.getQuestionnaireElement())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasAuthored()) { + tgt.setAuthored(src.getAuthored()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } if (src.getItem().size() != 1) throw new FHIRException("multiple root items not supported"); - tgt.setGroup(convertQuestionnaireItemToGroup(src.getItem().get(0))); + if (src.hasItem()) { + tgt.setGroup(convertQuestionnaireItemToGroup(src.getItem().get(0))); + } return tgt; } @@ -54,14 +82,30 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaireElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); - tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaireElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_10_50.convertReference(src.getAuthor())); + } + if (src.hasAuthored()) { + tgt.setAuthored(src.getAuthored()); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_10_50.convertReference(src.getSource())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } if (src.hasGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(src.getGroup())); return tgt; @@ -72,10 +116,18 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + } + if (src.hasQuestion()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion()) tgt.addItem(convertQuestionnaireResponseQuestionComponent(t)); + } return tgt; } @@ -84,8 +136,12 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireItemToGroup(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addGroup(convertQuestionnaireItemToGroup(t)); + } return tgt; } @@ -94,8 +150,12 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireResponseGroupComponent(t)); + } return tgt; } @@ -104,9 +164,15 @@ public class QuestionnaireResponse10_50 { return null; org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLinkId(src.getLinkId()); - tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + if (src.hasLinkId()) { + tgt.setLinkId(src.getLinkId()); + } + if (src.hasText()) { + tgt.setText(src.getText()); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/RiskAssessment10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/RiskAssessment10_50.java index 2096facbe..eca73d875 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/RiskAssessment10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/RiskAssessment10_50.java @@ -10,15 +10,33 @@ public class RiskAssessment10_50 { return null; org.hl7.fhir.r5.model.RiskAssessment tgt = new org.hl7.fhir.r5.model.RiskAssessment(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setCondition(VersionConvertor_10_50.convertReference(src.getCondition())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setPerformer(VersionConvertor_10_50.convertReference(src.getPerformer())); - tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - tgt.setMitigation(src.getMitigation()); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasCondition()) { + tgt.setCondition(VersionConvertor_10_50.convertReference(src.getCondition())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_50.convertReference(src.getPerformer())); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } + if (src.hasBasis()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) { + tgt.setMitigation(src.getMitigation()); + } return tgt; } @@ -27,15 +45,33 @@ public class RiskAssessment10_50 { return null; org.hl7.fhir.dstu2.model.RiskAssessment tgt = new org.hl7.fhir.dstu2.model.RiskAssessment(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); - tgt.setCondition(VersionConvertor_10_50.convertReference(src.getCondition())); - tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); - tgt.setPerformer(VersionConvertor_10_50.convertReference(src.getPerformer())); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - tgt.setMitigation(src.getMitigation()); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_10_50.convertReference(src.getSubject())); + } + if (src.hasCondition()) { + tgt.setCondition(VersionConvertor_10_50.convertReference(src.getCondition())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_10_50.convertReference(src.getEncounter())); + } + if (src.hasPerformer()) { + tgt.setPerformer(VersionConvertor_10_50.convertReference(src.getPerformer())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasMethod()) { + tgt.setMethod(VersionConvertor_10_50.convertCodeableConcept(src.getMethod())); + } + if (src.hasBasis()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) { + tgt.setMitigation(src.getMitigation()); + } return tgt; } @@ -44,11 +80,21 @@ public class RiskAssessment10_50 { return null; org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); - tgt.setProbability(VersionConvertor_10_50.convertType(src.getProbability())); - tgt.setRelativeRisk(src.getRelativeRisk()); - tgt.setWhen(VersionConvertor_10_50.convertType(src.getWhen())); - tgt.setRationale(src.getRationale()); + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); + } + if (src.hasProbability()) { + tgt.setProbability(VersionConvertor_10_50.convertType(src.getProbability())); + } + if (src.hasRelativeRisk()) { + tgt.setRelativeRisk(src.getRelativeRisk()); + } + if (src.hasWhen()) { + tgt.setWhen(VersionConvertor_10_50.convertType(src.getWhen())); + } + if (src.hasRationale()) { + tgt.setRationale(src.getRationale()); + } return tgt; } @@ -57,11 +103,21 @@ public class RiskAssessment10_50 { return null; org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.dstu2.model.RiskAssessment.RiskAssessmentPredictionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); - tgt.setProbability(VersionConvertor_10_50.convertType(src.getProbability())); - tgt.setRelativeRisk(src.getRelativeRisk()); - tgt.setWhen(VersionConvertor_10_50.convertType(src.getWhen())); - tgt.setRationale(src.getRationale()); + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_10_50.convertCodeableConcept(src.getOutcome())); + } + if (src.hasProbability()) { + tgt.setProbability(VersionConvertor_10_50.convertType(src.getProbability())); + } + if (src.hasRelativeRisk()) { + tgt.setRelativeRisk(src.getRelativeRisk()); + } + if (src.hasWhen()) { + tgt.setWhen(VersionConvertor_10_50.convertType(src.getWhen())); + } + if (src.hasRationale()) { + tgt.setRationale(src.getRationale()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Schedule10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Schedule10_50.java index dc5b3f74b..b4804664d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Schedule10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Schedule10_50.java @@ -10,11 +10,21 @@ public class Schedule10_50 { return null; org.hl7.fhir.dstu2.model.Schedule tgt = new org.hl7.fhir.dstu2.model.Schedule(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setActor(VersionConvertor_10_50.convertReference(src.getActorFirstRep())); - tgt.setPlanningHorizon(VersionConvertor_10_50.convertPeriod(src.getPlanningHorizon())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.setActor(VersionConvertor_10_50.convertReference(src.getActorFirstRep())); + } + if (src.hasPlanningHorizon()) { + tgt.setPlanningHorizon(VersionConvertor_10_50.convertPeriod(src.getPlanningHorizon())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -23,11 +33,21 @@ public class Schedule10_50 { return null; org.hl7.fhir.r5.model.Schedule tgt = new org.hl7.fhir.r5.model.Schedule(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addServiceType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.addActor(VersionConvertor_10_50.convertReference(src.getActor())); - tgt.setPlanningHorizon(VersionConvertor_10_50.convertPeriod(src.getPlanningHorizon())); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addServiceType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + tgt.addActor(VersionConvertor_10_50.convertReference(src.getActor())); + } + if (src.hasPlanningHorizon()) { + tgt.setPlanningHorizon(VersionConvertor_10_50.convertPeriod(src.getPlanningHorizon())); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SearchParameter10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SearchParameter10_50.java index e5278ef32..31c18b719 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SearchParameter10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SearchParameter10_50.java @@ -12,24 +12,52 @@ public class SearchParameter10_50 { return null; org.hl7.fhir.dstu2.model.SearchParameter tgt = new org.hl7.fhir.dstu2.model.SearchParameter(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCode(src.getCode()); - for (CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); - tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); - org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression()); - tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + for (CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasExpression()) { + org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression()); + } + if (src.hasXpath()) { + tgt.setXpath(src.getXpath()); + } + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -38,24 +66,50 @@ public class SearchParameter10_50 { return null; org.hl7.fhir.r5.model.SearchParameter tgt = new org.hl7.fhir.r5.model.SearchParameter(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCode(src.getCode()); - tgt.addBase(src.getBase()); - tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + tgt.addBase(src.getBase()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } tgt.setExpression(ToolingExtensions.readStringExtension(src, ToolingExtensions.EXT_EXPRESSION)); - tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu2.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpath()) { + tgt.setXpath(src.getXpath()); + } + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -64,8 +118,12 @@ public class SearchParameter10_50 { return null; org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent tgt = new org.hl7.fhir.dstu2.model.SearchParameter.SearchParameterContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -74,8 +132,12 @@ public class SearchParameter10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Slot10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Slot10_50.java index b00d7f45a..eab37bf5d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Slot10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Slot10_50.java @@ -10,14 +10,26 @@ public class Slot10_50 { return null; org.hl7.fhir.r5.model.Slot tgt = new org.hl7.fhir.r5.model.Slot(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } if (src.hasType()) tgt.addServiceType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setSchedule(VersionConvertor_10_50.convertReference(src.getSchedule())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setOverbooked(src.getOverbooked()); - tgt.setComment(src.getComment()); + if (src.hasSchedule()) { + tgt.setSchedule(VersionConvertor_10_50.convertReference(src.getSchedule())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasOverbooked()) { + tgt.setOverbooked(src.getOverbooked()); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } @@ -26,13 +38,27 @@ public class Slot10_50 { return null; org.hl7.fhir.dstu2.model.Slot tgt = new org.hl7.fhir.dstu2.model.Slot(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setSchedule(VersionConvertor_10_50.convertReference(src.getSchedule())); - tgt.setStart(src.getStart()); - tgt.setEnd(src.getEnd()); - tgt.setOverbooked(src.getOverbooked()); - tgt.setComment(src.getComment()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.setType(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasSchedule()) { + tgt.setSchedule(VersionConvertor_10_50.convertReference(src.getSchedule())); + } + if (src.hasStart()) { + tgt.setStart(src.getStart()); + } + if (src.hasEnd()) { + tgt.setEnd(src.getEnd()); + } + if (src.hasOverbooked()) { + tgt.setOverbooked(src.getOverbooked()); + } + if (src.hasComment()) { + tgt.setComment(src.getComment()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/StructureDefinition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/StructureDefinition10_50.java index dd8a37169..3bd716513 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/StructureDefinition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/StructureDefinition10_50.java @@ -6,7 +6,6 @@ import org.hl7.fhir.r5.model.ElementDefinition; import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.utilities.Utilities; - import java.util.ArrayList; import java.util.List; @@ -52,39 +51,79 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.dstu2.model.StructureDefinition tgt = new org.hl7.fhir.dstu2.model.StructureDefinition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setDisplay(src.getTitle()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTitle()) { + tgt.setDisplay(src.getTitle()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_10_50.convertCoding(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasKeyword()) { + for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_10_50.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); - for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - tgt.setAbstract(src.getAbstract()); + if (src.hasMapping()) { + for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) { if (!tgt.hasContextType()) tgt.setContextType(convertExtensionContext(t.getType(), t.getExpression())); tgt.addContext("Element".equals(t.getExpression()) ? "*" : t.getExpression()); } - tgt.setConstrainedType(src.getType()); - tgt.setBase(src.getBaseDefinition()); - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasType()) { + tgt.setConstrainedType(src.getType()); + } + if (src.hasBaseDefinition()) { + tgt.setBase(src.getBaseDefinition()); + } + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } if (tgt.hasBase()) { if (tgt.hasDifferential()) tgt.getDifferential().getElement().get(0).addType().setCode(tail(tgt.getBase())); @@ -99,33 +138,67 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.r5.model.StructureDefinition tgt = new org.hl7.fhir.r5.model.StructureDefinition(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setTitle(src.getDisplay()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDisplay()) { + tgt.setTitle(src.getDisplay()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_50.convertCodeableConceptToUsageContext(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_10_50.convertCoding(t)); - tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind(), tgt.getIdElement().getIdPart())); - tgt.setAbstract(src.getAbstract()); + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasCode()) { + for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_10_50.convertCoding(t)); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind(), tgt.getIdElement().getIdPart())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.dstu2.model.StringType t : src.getContext()) { org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent ec = tgt.addContext(); - ec.setType(convertExtensionContext(src.getContextType())); + if (src.hasContextType()) { + ec.setType(convertExtensionContext(src.getContextType())); + } ec.setExpression("*".equals(t.getValue()) ? "Element" : t.getValue()); } if (src.hasConstrainedType()) @@ -136,10 +209,16 @@ public class StructureDefinition10_50 { tgt.setType(src.getDifferential().getElement().get(0).getPath()); else tgt.setType(src.getDifferential().getElement().get(0).getPath().substring(0, src.getDifferential().getElement().get(0).getPath().indexOf("."))); - tgt.setBaseDefinition(src.getBase()); + if (src.hasBase()) { + tgt.setBaseDefinition(src.getBase()); + } tgt.setDerivation(src.hasConstrainedType() ? org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT : org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } if (tgt.hasSnapshot()) tgt.getSnapshot().getElementFirstRep().getType().clear(); if (tgt.hasDifferential()) @@ -164,8 +243,12 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -174,8 +257,12 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -184,7 +271,9 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t)); + } return tgt; } @@ -197,7 +286,9 @@ public class StructureDefinition10_50 { for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); - tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + } } return tgt; } @@ -242,10 +333,18 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComments(src.getComment()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComment()) { + tgt.setComments(src.getComment()); + } return tgt; } @@ -254,10 +353,18 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); - tgt.setUri(src.getUri()); - tgt.setName(src.getName()); - tgt.setComment(src.getComments()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasComments()) { + tgt.setComment(src.getComments()); + } return tgt; } @@ -270,7 +377,9 @@ public class StructureDefinition10_50 { for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); - tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t, slicePaths, src.getElement(), src.getElement().indexOf(t))); + } } return tgt; } @@ -280,7 +389,9 @@ public class StructureDefinition10_50 { return null; org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_10_50.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Substance10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Substance10_50.java index 3063a101b..d35724837 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Substance10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/Substance10_50.java @@ -10,12 +10,24 @@ public class Substance10_50 { return null; org.hl7.fhir.r5.model.Substance tgt = new org.hl7.fhir.r5.model.Substance(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -24,12 +36,24 @@ public class Substance10_50 { return null; org.hl7.fhir.dstu2.model.Substance tgt = new org.hl7.fhir.dstu2.model.Substance(); VersionConvertor_10_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(t)); + } + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasCode()) { + tgt.setCode(VersionConvertor_10_50.convertCodeableConcept(src.getCode())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasInstance()) { + for (org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -38,7 +62,9 @@ public class Substance10_50 { return null; org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setQuantity(VersionConvertor_10_50.convertRatio(src.getQuantity())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertRatio(src.getQuantity())); + } return tgt; } @@ -47,8 +73,12 @@ public class Substance10_50 { return null; org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setQuantity(VersionConvertor_10_50.convertRatio(src.getQuantity())); - tgt.setSubstance(VersionConvertor_10_50.convertReference(src.getSubstance())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertRatio(src.getQuantity())); + } + if (src.hasSubstance()) { + tgt.setSubstance(VersionConvertor_10_50.convertReference(src.getSubstance())); + } return tgt; } @@ -57,9 +87,15 @@ public class Substance10_50 { return null; org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setExpiry(src.getExpiry()); - tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasExpiry()) { + tgt.setExpiry(src.getExpiry()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + } return tgt; } @@ -68,9 +104,15 @@ public class Substance10_50 { return null; org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setExpiry(src.getExpiry()); - tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasExpiry()) { + tgt.setExpiry(src.getExpiry()); + } + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_10_50.convertSimpleQuantity(src.getQuantity())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SupplyDelivery10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SupplyDelivery10_50.java index 60d2e9be1..3f520e370 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SupplyDelivery10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/SupplyDelivery10_50.java @@ -10,13 +10,27 @@ public class SupplyDelivery10_50 { return null; org.hl7.fhir.dstu2.model.SupplyDelivery tgt = new org.hl7.fhir.dstu2.model.SupplyDelivery(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setSupplier(VersionConvertor_10_50.convertReference(src.getSupplier())); - tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); - for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + } + if (src.hasStatus()) { + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasSupplier()) { + tgt.setSupplier(VersionConvertor_10_50.convertReference(src.getSupplier())); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); + } return tgt; } @@ -25,13 +39,27 @@ public class SupplyDelivery10_50 { return null; org.hl7.fhir.r5.model.SupplyDelivery tgt = new org.hl7.fhir.r5.model.SupplyDelivery(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); - tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); - tgt.setSupplier(VersionConvertor_10_50.convertReference(src.getSupplier())); - tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasStatus()) { + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + } + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_10_50.convertReference(src.getPatient())); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCodeableConcept(src.getType())); + } + if (src.hasSupplier()) { + tgt.setSupplier(VersionConvertor_10_50.convertReference(src.getSupplier())); + } + if (src.hasDestination()) { + tgt.setDestination(VersionConvertor_10_50.convertReference(src.getDestination())); + } + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_10_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/TestScript10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/TestScript10_50.java index 91d4bf63a..2716ddc96 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/TestScript10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/TestScript10_50.java @@ -184,24 +184,60 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - tgt.setCompareToSourceId(src.getCompareToSourceId()); - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setHeaderField(src.getHeaderField()); - tgt.setMinimumId(src.getMinimumId()); - tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - tgt.setPath(src.getPath()); - tgt.setResource(TestScript.FHIRDefinedType.fromCode(src.getResource())); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - tgt.setResponseCode(src.getResponseCode()); - tgt.setSourceId(src.getSourceId()); - tgt.setValidateProfileId(src.getValidateProfileId()); - tgt.setValue(src.getValue()); - tgt.setWarningOnly(src.getWarningOnly()); + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } + if (src.hasCompareToSourceId()) { + tgt.setCompareToSourceId(src.getCompareToSourceId()); + } + if (src.hasCompareToSourcePath()) { + tgt.setCompareToSourcePath(src.getCompareToSourcePath()); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasMinimumId()) { + tgt.setMinimumId(src.getMinimumId()); + } + if (src.hasNavigationLinks()) { + tgt.setNavigationLinks(src.getNavigationLinks()); + } + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasResource()) { + tgt.setResource(TestScript.FHIRDefinedType.fromCode(src.getResource())); + } + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } + if (src.hasResponseCode()) { + tgt.setResponseCode(src.getResponseCode()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasValidateProfileId()) { + tgt.setValidateProfileId(src.getValidateProfileId()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasWarningOnly()) { + tgt.setWarningOnly(src.getWarningOnly()); + } return tgt; } @@ -210,24 +246,60 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - tgt.setCompareToSourceId(src.getCompareToSourceId()); - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setHeaderField(src.getHeaderField()); - tgt.setMinimumId(src.getMinimumId()); - tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - tgt.setPath(src.getPath()); - tgt.setResource(src.getResource().toCode()); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - tgt.setResponseCode(src.getResponseCode()); - tgt.setSourceId(src.getSourceId()); - tgt.setValidateProfileId(src.getValidateProfileId()); - tgt.setValue(src.getValue()); - tgt.setWarningOnly(src.getWarningOnly()); + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } + if (src.hasCompareToSourceId()) { + tgt.setCompareToSourceId(src.getCompareToSourceId()); + } + if (src.hasCompareToSourcePath()) { + tgt.setCompareToSourcePath(src.getCompareToSourcePath()); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasMinimumId()) { + tgt.setMinimumId(src.getMinimumId()); + } + if (src.hasNavigationLinks()) { + tgt.setNavigationLinks(src.getNavigationLinks()); + } + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasResource()) { + tgt.setResource(src.getResource().toCode()); + } + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } + if (src.hasResponseCode()) { + tgt.setResponseCode(src.getResponseCode()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasValidateProfileId()) { + tgt.setValidateProfileId(src.getValidateProfileId()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } + if (src.hasWarningOnly()) { + tgt.setWarningOnly(src.getWarningOnly()); + } return tgt; } @@ -236,8 +308,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -246,8 +322,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -256,20 +336,48 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); - tgt.setResource(src.getResource().toCode()); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setDestination(src.getDestination()); - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - tgt.setParams(src.getParams()); - for (org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - tgt.setResponseId(src.getResponseId()); - tgt.setSourceId(src.getSourceId()); - tgt.setTargetId(src.getTargetId()); - tgt.setUrl(src.getUrl()); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); + } + if (src.hasResource()) { + tgt.setResource(src.getResource().toCode()); + } + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasEncodeRequestUrl()) { + tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); + } + if (src.hasParams()) { + tgt.setParams(src.getParams()); + } + if (src.hasRequestHeader()) { + for (org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasResponseId()) { + tgt.setResponseId(src.getResponseId()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasTargetId()) { + tgt.setTargetId(src.getTargetId()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -278,20 +386,48 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); - tgt.setResource(TestScript.FHIRDefinedType.fromCode(src.getResource())); - tgt.setLabel(src.getLabel()); - tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); - tgt.setDestination(src.getDestination()); - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - tgt.setParams(src.getParams()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - tgt.setResponseId(src.getResponseId()); - tgt.setSourceId(src.getSourceId()); - tgt.setTargetId(src.getTargetId()); - tgt.setUrl(src.getUrl()); + if (src.hasType()) { + tgt.setType(VersionConvertor_10_50.convertCoding(src.getType())); + } + if (src.hasResource()) { + tgt.setResource(TestScript.FHIRDefinedType.fromCode(src.getResource())); + } + if (src.hasLabel()) { + tgt.setLabel(src.getLabel()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasEncodeRequestUrl()) { + tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); + } + if (src.hasParams()) { + tgt.setParams(src.getParams()); + } + if (src.hasRequestHeader()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasResponseId()) { + tgt.setResponseId(src.getResponseId()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } + if (src.hasTargetId()) { + tgt.setTargetId(src.getTargetId()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -300,8 +436,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -310,8 +450,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -320,7 +464,9 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TeardownActionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -329,7 +475,9 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -338,8 +486,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestActionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -348,8 +500,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -358,31 +514,65 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript tgt = new org.hl7.fhir.r5.model.TestScript(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); - tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_50.convertCodeableConceptToUsageContext(t)); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -391,32 +581,68 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript tgt = new org.hl7.fhir.dstu2.model.TestScript(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasIdentifier()) { - tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifierFirstRep())); + } } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_50.convertReference(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_10_50.convertCodeableConcept(t)); + } + if (src.hasPurpose()) { + tgt.setRequirements(src.getPurpose()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_10_50.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -425,8 +651,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -435,8 +665,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -445,9 +679,15 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAutocreate(src.getAutocreate()); - tgt.setAutodelete(src.getAutodelete()); - tgt.setResource(VersionConvertor_10_50.convertReference(src.getResource())); + if (src.hasAutocreate()) { + tgt.setAutocreate(src.getAutocreate()); + } + if (src.hasAutodelete()) { + tgt.setAutodelete(src.getAutodelete()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_50.convertReference(src.getResource())); + } return tgt; } @@ -456,9 +696,15 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setAutocreate(src.getAutocreate()); - tgt.setAutodelete(src.getAutodelete()); - tgt.setResource(VersionConvertor_10_50.convertReference(src.getResource())); + if (src.hasAutocreate()) { + tgt.setAutocreate(src.getAutocreate()); + } + if (src.hasAutodelete()) { + tgt.setAutodelete(src.getAutodelete()); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_10_50.convertReference(src.getResource())); + } return tgt; } @@ -467,12 +713,24 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setRequired(src.getRequired()); - tgt.setValidated(src.getValidated()); - tgt.setDescription(src.getDescription()); - tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.r5.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setConformance(VersionConvertor_10_50.convertCanonicalToReference(src.getCapabilitiesElement())); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasValidated()) { + tgt.setValidated(src.getValidated()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasCapabilitiesElement()) { + tgt.setConformance(VersionConvertor_10_50.convertCanonicalToReference(src.getCapabilitiesElement())); + } return tgt; } @@ -481,12 +739,24 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setRequired(src.getRequired()); - tgt.setValidated(src.getValidated()); - tgt.setDescription(src.getDescription()); - tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setCapabilitiesElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getConformance())); + if (src.hasRequired()) { + tgt.setRequired(src.getRequired()); + } + if (src.hasValidated()) { + tgt.setValidated(src.getValidated()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasDestination()) { + tgt.setDestination(src.getDestination()); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasConformance()) { + tgt.setCapabilitiesElement(VersionConvertor_10_50.convertReferenceToCanonical(src.getConformance())); + } return tgt; } @@ -495,8 +765,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -505,8 +779,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -515,8 +793,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setDescription(src.getDescription()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -525,8 +807,12 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setDescription(src.getDescription()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } return tgt; } @@ -535,7 +821,9 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -544,7 +832,9 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -553,7 +843,9 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -562,7 +854,9 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -571,9 +865,15 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -582,9 +882,15 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -593,10 +899,18 @@ public class TestScript10_50 { return null; org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setHeaderField(src.getHeaderField()); - tgt.setPath(src.getPath()); - tgt.setSourceId(src.getSourceId()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } return tgt; } @@ -605,10 +919,18 @@ public class TestScript10_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setHeaderField(src.getHeaderField()); - tgt.setPath(src.getPath()); - tgt.setSourceId(src.getSourceId()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasHeaderField()) { + tgt.setHeaderField(src.getHeaderField()); + } + if (src.hasPath()) { + tgt.setPath(src.getPath()); + } + if (src.hasSourceId()) { + tgt.setSourceId(src.getSourceId()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ValueSet10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ValueSet10_50.java index 30dc2526d..cf360de9c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ValueSet10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/ValueSet10_50.java @@ -8,7 +8,6 @@ import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode; import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.r5.terminologies.CodeSystemUtilities; - import java.util.List; public class ValueSet10_50 { @@ -18,9 +17,15 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -29,9 +34,15 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -40,9 +51,15 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_10_50.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasLanguage()) { + tgt.setLanguage(src.getLanguage()); + } + if (src.hasUse()) { + tgt.setUse(VersionConvertor_10_50.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -51,9 +68,15 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_10_50.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasLanguage()) { + tgt.setLanguage(src.getLanguage()); + } + if (src.hasUse()) { + tgt.setUse(VersionConvertor_10_50.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -62,10 +85,18 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -74,10 +105,18 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -86,9 +125,15 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -97,9 +142,15 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -194,60 +245,112 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet(); VersionConvertor_10_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasIdentifier()) { + tgt.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasPublisher()) { + tgt.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_50.convertCodeableConceptToUsageContext(t)); - tgt.setImmutable(src.getImmutable()); - tgt.setPurpose(src.getRequirements()); - tgt.setCopyright(src.getCopyright()); + if (src.hasImmutable()) { + tgt.setImmutable(src.getImmutable()); + } + if (src.hasRequirements()) { + tgt.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgt.setCopyright(src.getCopyright()); + } if (src.hasExtensible()) tgt.addExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible", new BooleanType(src.getExtensible())); if (src.hasCompose()) { - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); - tgt.getCompose().setLockedDate(src.getLockedDate()); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } + if (src.hasLockedDate()) { + tgt.getCompose().setLockedDate(src.getLockedDate()); + } } if (src.hasCodeSystem() && advisor != null) { org.hl7.fhir.r5.model.CodeSystem tgtcs = new org.hl7.fhir.r5.model.CodeSystem(); VersionConvertor_10_50.copyDomainResource(src, tgtcs); - tgtcs.setUrl(src.getCodeSystem().getSystem()); - tgtcs.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); - tgtcs.setVersion(src.getCodeSystem().getVersion()); - tgtcs.setName(src.getName() + " Code System"); - tgtcs.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasCodeSystem()) { + tgtcs.setUrl(src.getCodeSystem().getSystem()); + } + if (src.hasIdentifier()) { + tgtcs.addIdentifier(VersionConvertor_10_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasCodeSystem()) { + tgtcs.setVersion(src.getCodeSystem().getVersion()); + } + if (src.hasName()) { + tgtcs.setName(src.getName() + " Code System"); + } + if (src.hasStatus()) { + tgtcs.setStatus(VersionConvertor_10_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgtcs.setExperimental(src.getExperimental()); - tgtcs.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgtcs.addContact(convertValueSetContactComponent(t)); + if (src.hasPublisher()) { + tgtcs.setPublisher(src.getPublisher()); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgtcs.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgtcs.setDate(src.getDate()); - tgtcs.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgtcs.setDescription(src.getDescription()); + } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_50.isJurisdiction(t)) tgtcs.addJurisdiction(VersionConvertor_10_50.convertCodeableConcept(t)); else tgtcs.addUseContext(VersionConvertor_10_50.convertCodeableConceptToUsageContext(t)); - tgtcs.setPurpose(src.getRequirements()); - tgtcs.setCopyright(src.getCopyright()); + if (src.hasRequirements()) { + tgtcs.setPurpose(src.getRequirements()); + } + if (src.hasCopyright()) { + tgtcs.setCopyright(src.getCopyright()); + } tgtcs.setContent(CodeSystemContentMode.COMPLETE); - tgtcs.setCaseSensitive(src.getCodeSystem().getCaseSensitive()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs : src.getCodeSystem().getConcept()) processConcept(tgtcs.getConcept(), cs, tgtcs); + if (src.hasCodeSystem()) { + tgtcs.setCaseSensitive(src.getCodeSystem().getCaseSensitive()); + } + if (src.hasCodeSystem()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs : src.getCodeSystem().getConcept()) processConcept(tgtcs.getConcept(), cs, tgtcs); + } advisor.handleCodeSystem(tgtcs, tgt); tgt.setUserData("r2-cs", tgtcs); tgt.getCompose().addInclude().setSystem(tgtcs.getUrl()); } - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + if (src.hasExpansion()) { + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + } return tgt; } @@ -260,9 +363,15 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent(); VersionConvertor_10_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasImport()) { + for (org.hl7.fhir.dstu2.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); + } + if (src.hasInclude()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -276,7 +385,9 @@ public class ValueSet10_50 { if (noSystem == null || !t.getSystem().equals(noSystem)) tgt.addInclude(convertConceptSetComponent(t)); } - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasExclude()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -285,8 +396,12 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -295,8 +410,12 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_50.convertContactPoint(t)); + } return tgt; } @@ -305,12 +424,24 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); - tgt.setTotal(src.getTotal()); - tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasTotal()) { + tgt.setTotal(src.getTotal()); + } + if (src.hasOffset()) { + tgt.setOffset(src.getOffset()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -319,12 +450,24 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); - tgt.setTotal(src.getTotal()); - tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } + if (src.hasTotal()) { + tgt.setTotal(src.getTotal()); + } + if (src.hasOffset()) { + tgt.setOffset(src.getOffset()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -333,12 +476,24 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setAbstract(src.getAbstract()); - tgt.setVersion(src.getVersion()); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -347,12 +502,24 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); - tgt.setAbstract(src.getAbstract()); - tgt.setVersion(src.getVersion()); - tgt.setCode(src.getCode()); - tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasVersion()) { + tgt.setVersion(src.getVersion()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasDisplay()) { + tgt.setDisplay(src.getDisplay()); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -361,8 +528,12 @@ public class ValueSet10_50 { return null; org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } return tgt; } @@ -371,8 +542,12 @@ public class ValueSet10_50 { return null; org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_10_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_10_50.convertType(src.getValue())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Bundle14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Bundle14_30.java index 7152203a9..eef10bc5b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Bundle14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Bundle14_30.java @@ -10,12 +10,20 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle(); VersionConvertor_14_30.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_14_30.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_14_30.convertSignature(src.getSignature())); + } return tgt; } @@ -24,12 +32,20 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu2016may.model.Bundle tgt = new org.hl7.fhir.dstu2016may.model.Bundle(); VersionConvertor_14_30.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_14_30.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_14_30.convertSignature(src.getSignature())); + } return tgt; } @@ -38,13 +54,23 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -53,13 +79,23 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -68,8 +104,12 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasIfNoneMatch()) tgt.setIfNoneMatch(src.getIfNoneMatch()); if (src.hasIfModifiedSince()) @@ -86,8 +126,12 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasIfNoneMatch()) tgt.setIfNoneMatch(src.getIfNoneMatch()); if (src.hasIfModifiedSince()) @@ -104,7 +148,9 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) @@ -119,7 +165,9 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) @@ -134,7 +182,9 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } if (src.hasScore()) tgt.setScore(src.getScore()); return tgt; @@ -145,7 +195,9 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } if (src.hasScore()) tgt.setScore(src.getScore()); return tgt; @@ -156,8 +208,12 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -166,8 +222,12 @@ public class Bundle14_30 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CodeSystem14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CodeSystem14_30.java index 23f9332e7..fb3dfc930 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CodeSystem14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CodeSystem14_30.java @@ -16,17 +16,23 @@ public class CodeSystem14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -47,12 +53,20 @@ public class CodeSystem14_30 { tgt.setCompositional(src.getCompositional()); if (src.hasVersionNeeded()) tgt.setVersionNeeded(src.getVersionNeeded()); - tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasContent()) { + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + } if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -63,24 +77,32 @@ public class CodeSystem14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) @@ -93,12 +115,20 @@ public class CodeSystem14_30 { tgt.setCompositional(src.getCompositional()); if (src.hasVersionNeeded()) tgt.setVersionNeeded(src.getVersionNeeded()); - tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasContent()) { + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + } if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -109,7 +139,9 @@ public class CodeSystem14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -120,7 +152,9 @@ public class CodeSystem14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -163,7 +197,9 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getOperator()) try { @@ -171,7 +207,9 @@ public class CodeSystem14_30 { } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setValue(src.getValue()); + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -180,11 +218,17 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (Enumeration t : src.getOperator()) tgt.addOperator(t.getValue().toCode()); - tgt.setValue(src.getValue()); + if (src.hasOperator()) { + for (Enumeration t : src.getOperator()) tgt.addOperator(t.getValue().toCode()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -193,14 +237,22 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -209,14 +261,22 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (ConceptDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (ConceptDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -227,8 +287,12 @@ public class CodeSystem14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -239,8 +303,12 @@ public class CodeSystem14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -249,8 +317,12 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } return tgt; } @@ -259,8 +331,12 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } return tgt; } @@ -269,10 +345,14 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setType(convertPropertyType(src.getType())); + if (src.hasType()) { + tgt.setType(convertPropertyType(src.getType())); + } return tgt; } @@ -281,10 +361,14 @@ public class CodeSystem14_30 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setType(convertPropertyType(src.getType())); + if (src.hasType()) { + tgt.setType(convertPropertyType(src.getType())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CompartmentDefinition14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CompartmentDefinition14_30.java index 855f2dccf..e1bcdb376 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CompartmentDefinition14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/CompartmentDefinition14_30.java @@ -10,23 +10,37 @@ public class CompartmentDefinition14_30 { return null; org.hl7.fhir.dstu3.model.CompartmentDefinition tgt = new org.hl7.fhir.dstu3.model.CompartmentDefinition(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionContactComponent t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionContactComponent t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasRequirements()) tgt.setPurpose(src.getRequirements()); - tgt.setCode(convertCompartmentType(src.getCode())); - tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasCode()) { + tgt.setCode(convertCompartmentType(src.getCode())); + } + if (src.hasSearch()) { + tgt.setSearch(src.getSearch()); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -35,23 +49,37 @@ public class CompartmentDefinition14_30 { return null; org.hl7.fhir.dstu2016may.model.CompartmentDefinition tgt = new org.hl7.fhir.dstu2016may.model.CompartmentDefinition(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); - tgt.setCode(convertCompartmentType(src.getCode())); - tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasCode()) { + tgt.setCode(convertCompartmentType(src.getCode())); + } + if (src.hasSearch()) { + tgt.setSearch(src.getSearch()); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -62,7 +90,9 @@ public class CompartmentDefinition14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -73,7 +103,9 @@ public class CompartmentDefinition14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -82,8 +114,12 @@ public class CompartmentDefinition14_30 { return null; org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasParam()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -94,8 +130,12 @@ public class CompartmentDefinition14_30 { return null; org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasParam()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ConceptMap14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ConceptMap14_30.java index 02a432904..5f7128dcb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ConceptMap14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ConceptMap14_30.java @@ -4,7 +4,6 @@ import org.hl7.fhir.convertors.VersionConvertor_14_30; import org.hl7.fhir.dstu3.model.ConceptMap; import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent; import org.hl7.fhir.exceptions.FHIRException; - import java.util.ArrayList; import java.util.List; @@ -17,31 +16,45 @@ public class ConceptMap14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_14_30.convertType(src.getTarget())); - for (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_14_30.convertType(src.getTarget())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } return tgt; } @@ -52,17 +65,23 @@ public class ConceptMap14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ConceptMap.ConceptMapContactComponent t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.ConceptMap.ConceptMapContactComponent t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -75,8 +94,12 @@ public class ConceptMap14_30 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_14_30.convertType(src.getTarget())); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_14_30.convertType(src.getTarget())); + } for (org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent t : src.getElement()) { List ws = convertSourceElementComponent(t); for (VersionConvertor_14_30.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp); @@ -91,7 +114,9 @@ public class ConceptMap14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -102,7 +127,9 @@ public class ConceptMap14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -165,9 +192,15 @@ public class ConceptMap14_30 { return null; org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setElement(src.getProperty()); - tgt.setSystem(src.getSystem()); - tgt.setCode(src.getCode()); + if (src.hasProperty()) { + tgt.setElement(src.getProperty()); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } return tgt; } @@ -176,9 +209,15 @@ public class ConceptMap14_30 { return null; org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setProperty(src.getElement()); - tgt.setSystem(src.getSystem()); - tgt.setCode(src.getCode()); + if (src.hasElement()) { + tgt.setProperty(src.getElement()); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } return tgt; } @@ -191,7 +230,9 @@ public class ConceptMap14_30 { tgt.setSystem(g.getSource()); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + } return tgt; } @@ -205,7 +246,9 @@ public class ConceptMap14_30 { if (src.hasCode()) tgt.setCode(src.getCode()); tgt.addTarget(convertTargetElementComponent(t)); - res.add(new VersionConvertor_14_30.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem())); + if (src.hasSystem()) { + res.add(new VersionConvertor_14_30.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem())); + } } return res; } @@ -219,11 +262,17 @@ public class ConceptMap14_30 { tgt.setSystem(g.getTarget()); if (src.hasCode()) tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } if (src.hasComment()) tgt.setComments(src.getComment()); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -234,11 +283,17 @@ public class ConceptMap14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } if (src.hasComments()) tgt.setComment(src.getComments()); - for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Conformance14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Conformance14_30.java index 0d4ca5ddd..2e4927016 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Conformance14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Conformance14_30.java @@ -46,33 +46,59 @@ public class Conformance14_30 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(src.getFhirVersion()); - tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasAcceptUnknown()) { + tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); + } + if (src.hasFormat()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -87,14 +113,18 @@ public class Conformance14_30 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_30.isJurisdiction(t)) @@ -105,16 +135,36 @@ public class Conformance14_30 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(src.getFhirVersion()); - tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion()); + } + if (src.hasAcceptUnknown()) { + tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); + } + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu2016may.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -125,7 +175,9 @@ public class Conformance14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -136,7 +188,9 @@ public class Conformance14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -145,10 +199,14 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } return tgt; } @@ -157,10 +215,14 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } return tgt; } @@ -195,7 +257,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceImplementationComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceImplementationComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasUrl()) tgt.setUrl(src.getUrl()); return tgt; @@ -206,7 +270,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasUrl()) tgt.setUrl(src.getUrl()); return tgt; @@ -217,12 +283,16 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + } return tgt; } @@ -231,12 +301,16 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); + } return tgt; } @@ -245,8 +319,12 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_14_30.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_14_30.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -255,8 +333,12 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_14_30.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_14_30.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -265,12 +347,24 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_14_30.convertCoding(src.getCode())); - tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - tgt.setMode(convertConformanceEventMode(src.getMode())); - tgt.setFocus(src.getFocus()); - tgt.setRequest(VersionConvertor_14_30.convertReference(src.getRequest())); - tgt.setResponse(VersionConvertor_14_30.convertReference(src.getResponse())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_14_30.convertCoding(src.getCode())); + } + if (src.hasCategory()) { + tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); + } + if (src.hasMode()) { + tgt.setMode(convertConformanceEventMode(src.getMode())); + } + if (src.hasFocus()) { + tgt.setFocus(src.getFocus()); + } + if (src.hasRequest()) { + tgt.setRequest(VersionConvertor_14_30.convertReference(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(VersionConvertor_14_30.convertReference(src.getResponse())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -281,12 +375,24 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(VersionConvertor_14_30.convertCoding(src.getCode())); - tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - tgt.setMode(convertConformanceEventMode(src.getMode())); - tgt.setFocus(src.getFocus()); - tgt.setRequest(VersionConvertor_14_30.convertReference(src.getRequest())); - tgt.setResponse(VersionConvertor_14_30.convertReference(src.getResponse())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_14_30.convertCoding(src.getCode())); + } + if (src.hasCategory()) { + tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); + } + if (src.hasMode()) { + tgt.setMode(convertConformanceEventMode(src.getMode())); + } + if (src.hasFocus()) { + tgt.setFocus(src.getFocus()); + } + if (src.hasRequest()) { + tgt.setRequest(VersionConvertor_14_30.convertReference(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(VersionConvertor_14_30.convertReference(src.getResponse())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -297,15 +403,29 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -314,15 +434,29 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -331,8 +465,12 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_14_30.convertReference(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(VersionConvertor_14_30.convertReference(src.getDefinition())); + } return tgt; } @@ -341,8 +479,12 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_14_30.convertReference(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinition(VersionConvertor_14_30.convertReference(src.getDefinition())); + } return tgt; } @@ -351,10 +493,18 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } if (src.hasReadHistory()) tgt.setReadHistory(src.getReadHistory()); if (src.hasUpdateCreate()) @@ -363,10 +513,18 @@ public class Conformance14_30 { tgt.setConditionalCreate(src.getConditionalCreate()); if (src.hasConditionalUpdate()) tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -375,10 +533,18 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); - for (org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } if (src.hasReadHistory()) tgt.setReadHistory(src.getReadHistory()); if (src.hasUpdateCreate()) @@ -387,10 +553,18 @@ public class Conformance14_30 { tgt.setConditionalCreate(src.getConditionalCreate()); if (src.hasConditionalUpdate()) tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -399,10 +573,14 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -413,10 +591,14 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -453,10 +635,14 @@ public class Conformance14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + if (src.hasCertificate()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + } return tgt; } @@ -467,10 +653,14 @@ public class Conformance14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + if (src.hasCertificate()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); + } return tgt; } @@ -479,7 +669,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasReleaseDate()) @@ -492,7 +684,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasReleaseDate()) @@ -591,7 +785,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -602,7 +798,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -669,7 +867,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -680,7 +880,9 @@ public class Conformance14_30 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/DataElement14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/DataElement14_30.java index bc25c1430..58574a76f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/DataElement14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/DataElement14_30.java @@ -12,10 +12,14 @@ public class DataElement14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) @@ -24,16 +28,24 @@ public class DataElement14_30 { tgt.setDate(src.getDate()); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_30.convertCodeableConceptToUsageContext(t)); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setStringency(convertDataElementStringency(src.getStringency())); - for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + if (src.hasStringency()) { + tgt.setStringency(convertDataElementStringency(src.getStringency())); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } + if (src.hasElement()) { + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + } return tgt; } @@ -44,10 +56,14 @@ public class DataElement14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) @@ -56,15 +72,25 @@ public class DataElement14_30 { tgt.setDate(src.getDate()); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setStringency(convertDataElementStringency(src.getStringency())); - for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + if (src.hasStringency()) { + tgt.setStringency(convertDataElementStringency(src.getStringency())); + } + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + } return tgt; } @@ -75,7 +101,9 @@ public class DataElement14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -86,7 +114,9 @@ public class DataElement14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -95,7 +125,9 @@ public class DataElement14_30 { return null; org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) @@ -110,7 +142,9 @@ public class DataElement14_30 { return null; org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ImplementationGuide14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ImplementationGuide14_30.java index 189f7bd21..29521334a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ImplementationGuide14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ImplementationGuide14_30.java @@ -86,32 +86,52 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); - tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + if (src.hasDependency()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasBinary()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); + } + if (src.hasPage()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + } return tgt; } @@ -120,16 +140,24 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -142,11 +170,21 @@ public class ImplementationGuide14_30 { tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); - tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + if (src.hasDependency()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasBinary()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); + } + if (src.hasPage()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); + } return tgt; } @@ -157,7 +195,9 @@ public class ImplementationGuide14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -168,7 +208,9 @@ public class ImplementationGuide14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -177,8 +219,12 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(convertGuideDependencyType(src.getType())); - tgt.setUri(src.getUri()); + if (src.hasType()) { + tgt.setType(convertGuideDependencyType(src.getType())); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -187,8 +233,12 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(convertGuideDependencyType(src.getType())); - tgt.setUri(src.getUri()); + if (src.hasType()) { + tgt.setType(convertGuideDependencyType(src.getType())); + } + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -197,8 +247,12 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } return tgt; } @@ -207,8 +261,12 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } return tgt; } @@ -217,10 +275,14 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + } return tgt; } @@ -229,10 +291,14 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); + } return tgt; } @@ -241,14 +307,18 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setExample(src.getExample()); + if (src.hasExample()) { + tgt.setExample(src.getExample()); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasAcronym()) tgt.setAcronym(src.getAcronym()); - tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); + } if (src.hasExampleFor()) tgt.setExampleFor(VersionConvertor_14_30.convertReference(src.getExampleFor())); return tgt; @@ -259,14 +329,18 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setExample(src.getExample()); + if (src.hasExample()) { + tgt.setExample(src.getExample()); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasAcronym()) tgt.setAcronym(src.getAcronym()); - tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_30.convertType(src.getSource())); + } if (src.hasExampleFor()) tgt.setExampleFor(VersionConvertor_14_30.convertReference(src.getExampleFor())); return tgt; @@ -277,14 +351,26 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setSource(src.getSource()); - tgt.setTitle(src.getName()); - tgt.setKind(convertGuidePageKind(src.getKind())); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addType(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); + if (src.hasSource()) { + tgt.setSource(src.getSource()); + } + if (src.hasName()) { + tgt.setTitle(src.getName()); + } + if (src.hasKind()) { + tgt.setKind(convertGuidePageKind(src.getKind())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addType(t.getValue()); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); + } if (src.hasFormat()) tgt.setFormat(src.getFormat()); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -293,14 +379,26 @@ public class ImplementationGuide14_30 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setSource(src.getSource()); - tgt.setName(src.getTitle()); - tgt.setKind(convertGuidePageKind(src.getKind())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getType()) tgt.addType(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); + if (src.hasSource()) { + tgt.setSource(src.getSource()); + } + if (src.hasTitle()) { + tgt.setName(src.getTitle()); + } + if (src.hasKind()) { + tgt.setKind(convertGuidePageKind(src.getKind())); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getType()) tgt.addType(t.getValue()); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); + } if (src.hasFormat()) tgt.setFormat(src.getFormat()); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/NamingSystem14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/NamingSystem14_30.java index 7f971c9cc..9882f0d9b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/NamingSystem14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/NamingSystem14_30.java @@ -10,25 +10,43 @@ public class NamingSystem14_30 { return null; org.hl7.fhir.dstu2016may.model.NamingSystem tgt = new org.hl7.fhir.dstu2016may.model.NamingSystem(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); - tgt.setDate(src.getDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } + if (src.hasDate()) { + tgt.setDate(src.getDate()); + } if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_14_30.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_30.convertCodeableConcept(src.getType())); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); - tgt.setReplacedBy(VersionConvertor_14_30.convertReference(src.getReplacedBy())); + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } + if (src.hasReplacedBy()) { + tgt.setReplacedBy(VersionConvertor_14_30.convertReference(src.getReplacedBy())); + } return tgt; } @@ -37,16 +55,28 @@ public class NamingSystem14_30 { return null; org.hl7.fhir.dstu3.model.NamingSystem tgt = new org.hl7.fhir.dstu3.model.NamingSystem(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); - tgt.setDate(src.getDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } + if (src.hasDate()) { + tgt.setDate(src.getDate()); + } if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_14_30.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_30.convertCodeableConcept(src.getType())); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_30.isJurisdiction(t)) @@ -55,8 +85,12 @@ public class NamingSystem14_30 { tgt.addUseContext(VersionConvertor_14_30.convertCodeableConceptToUsageContext(t)); if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); - tgt.setReplacedBy(VersionConvertor_14_30.convertReference(src.getReplacedBy())); + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } + if (src.hasReplacedBy()) { + tgt.setReplacedBy(VersionConvertor_14_30.convertReference(src.getReplacedBy())); + } return tgt; } @@ -67,7 +101,9 @@ public class NamingSystem14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -78,7 +114,9 @@ public class NamingSystem14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -151,11 +189,17 @@ public class NamingSystem14_30 { return null; org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } if (src.hasPreferred()) tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_14_30.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_14_30.convertPeriod(src.getPeriod())); + } return tgt; } @@ -164,11 +208,17 @@ public class NamingSystem14_30 { return null; org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } if (src.hasPreferred()) tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_14_30.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_14_30.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationDefinition14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationDefinition14_30.java index cbf516970..e65b8394b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationDefinition14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationDefinition14_30.java @@ -16,16 +16,24 @@ public class OperationDefinition14_30 { tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_30.isJurisdiction(t)) @@ -36,15 +44,27 @@ public class OperationDefinition14_30 { tgt.setPurpose(src.getRequirements()); if (src.hasIdempotent()) tgt.setIdempotent(src.getIdempotent()); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasComment()) tgt.setComment(src.getComment()); - tgt.setBase(VersionConvertor_14_30.convertReference(src.getBase())); - tgt.setSystem(src.getSystem()); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + if (src.hasBase()) { + tgt.setBase(VersionConvertor_14_30.convertReference(src.getBase())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + } tgt.setType(tgt.hasResource()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -57,34 +77,56 @@ public class OperationDefinition14_30 { tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasIdempotent()) tgt.setIdempotent(src.getIdempotent()); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasComment()) tgt.setComment(src.getComment()); - tgt.setBase(VersionConvertor_14_30.convertReference(src.getBase())); - tgt.setSystem(src.getSystem()); + if (src.hasBase()) { + tgt.setBase(VersionConvertor_14_30.convertReference(src.getBase())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.getType()) - for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); + } + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -95,7 +137,9 @@ public class OperationDefinition14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -106,7 +150,9 @@ public class OperationDefinition14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -115,8 +161,12 @@ public class OperationDefinition14_30 { return null; org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setStrength(VersionConvertor_14_30.convertBindingStrength(src.getStrength())); - tgt.setValueSet(VersionConvertor_14_30.convertType(src.getValueSet())); + if (src.hasStrength()) { + tgt.setStrength(VersionConvertor_14_30.convertBindingStrength(src.getStrength())); + } + if (src.hasValueSet()) { + tgt.setValueSet(VersionConvertor_14_30.convertType(src.getValueSet())); + } return tgt; } @@ -125,8 +175,12 @@ public class OperationDefinition14_30 { return null; org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setStrength(VersionConvertor_14_30.convertBindingStrength(src.getStrength())); - tgt.setValueSet(VersionConvertor_14_30.convertType(src.getValueSet())); + if (src.hasStrength()) { + tgt.setStrength(VersionConvertor_14_30.convertBindingStrength(src.getStrength())); + } + if (src.hasValueSet()) { + tgt.setValueSet(VersionConvertor_14_30.convertType(src.getValueSet())); + } return tgt; } @@ -135,18 +189,34 @@ public class OperationDefinition14_30 { return null; org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); if (src.hasType()) tgt.setType(src.getType()); - tgt.setSearchType(VersionConvertor_14_30.convertSearchParamType(src.getSearchType())); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasSearchType()) { + tgt.setSearchType(VersionConvertor_14_30.convertSearchParamType(src.getSearchType())); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -155,22 +225,42 @@ public class OperationDefinition14_30 { return null; org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); if (Utilities.existsInList(src.getType(), "token", "reference", "composite", "number", "date", "quantity", "uri")) { tgt.setType("string"); - tgt.setSearchType(SearchParamType.fromCode(src.getType())); + if (src.hasType()) { + tgt.setSearchType(SearchParamType.fromCode(src.getType())); + } } else { - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + } + if (src.hasSearchType()) { + tgt.setSearchType(VersionConvertor_14_30.convertSearchParamType(src.getSearchType())); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); } - tgt.setSearchType(VersionConvertor_14_30.convertSearchParamType(src.getSearchType())); - tgt.setProfile(VersionConvertor_14_30.convertReference(src.getProfile())); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationOutcome14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationOutcome14_30.java index 41939a74c..9e1d6a964 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationOutcome14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/OperationOutcome14_30.java @@ -178,7 +178,9 @@ public class OperationOutcome14_30 { return null; org.hl7.fhir.dstu2016may.model.OperationOutcome tgt = new org.hl7.fhir.dstu2016may.model.OperationOutcome(); VersionConvertor_14_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome14_30 { return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); VersionConvertor_14_30.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -196,13 +200,23 @@ public class OperationOutcome14_30 { return null; org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_14_30.convertCodeableConcept(src.getDetails())); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_14_30.convertCodeableConcept(src.getDetails())); + } if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + } return tgt; } @@ -211,13 +225,23 @@ public class OperationOutcome14_30 { return null; org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_14_30.convertCodeableConcept(src.getDetails())); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_14_30.convertCodeableConcept(src.getDetails())); + } if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Parameters14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Parameters14_30.java index 8edf96674..798ba3eb2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Parameters14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Parameters14_30.java @@ -10,7 +10,9 @@ public class Parameters14_30 { return null; org.hl7.fhir.dstu3.model.Parameters tgt = new org.hl7.fhir.dstu3.model.Parameters(); VersionConvertor_14_30.copyResource(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters14_30 { return null; org.hl7.fhir.dstu2016may.model.Parameters tgt = new org.hl7.fhir.dstu2016may.model.Parameters(); VersionConvertor_14_30.copyResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -28,10 +32,18 @@ public class Parameters14_30 { return null; org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); - tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); - for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -40,10 +52,18 @@ public class Parameters14_30 { return null; org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); - tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Questionnaire14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Questionnaire14_30.java index 137512d8e..95506365b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Questionnaire14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/Questionnaire14_30.java @@ -14,22 +14,38 @@ public class Questionnaire14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (ContactDetail t : src.getContact()) for (org.hl7.fhir.dstu3.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t1)); - for (UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasContact()) { + for (ContactDetail t : src.getContact()) for (org.hl7.fhir.dstu3.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t1)); + } + if (src.hasUseContext()) { + for (UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_30.convertCoding(t)); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_30.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -40,24 +56,36 @@ public class Questionnaire14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addContact(convertQuestionnaireContactComponent(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addContact(convertQuestionnaireContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_30.convertCodeableConceptToUsageContext(t)); if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_30.convertCoding(t)); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_30.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -77,13 +105,19 @@ public class Questionnaire14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_30.convertCoding(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_30.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasEnableWhen()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -92,10 +126,18 @@ public class Questionnaire14_30 { tgt.setReadOnly(src.getReadOnly()); if (src.hasMaxLength()) tgt.setMaxLength(src.getMaxLength()); - tgt.setOptions(VersionConvertor_14_30.convertReference(src.getOptions())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); - tgt.setInitial(VersionConvertor_14_30.convertType(src.getInitial())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasOptions()) { + tgt.setOptions(VersionConvertor_14_30.convertReference(src.getOptions())); + } + if (src.hasOption()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + } + if (src.hasInitial()) { + tgt.setInitial(VersionConvertor_14_30.convertType(src.getInitial())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -106,13 +148,19 @@ public class Questionnaire14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_30.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_30.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasEnableWhen()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -121,10 +169,18 @@ public class Questionnaire14_30 { tgt.setReadOnly(src.getReadOnly()); if (src.hasMaxLength()) tgt.setMaxLength(src.getMaxLength()); - tgt.setOptions(VersionConvertor_14_30.convertReference(src.getOptions())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); - tgt.setInitial(VersionConvertor_14_30.convertType(src.getInitial())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasOptions()) { + tgt.setOptions(VersionConvertor_14_30.convertReference(src.getOptions())); + } + if (src.hasOption()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + } + if (src.hasInitial()) { + tgt.setInitial(VersionConvertor_14_30.convertType(src.getInitial())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -133,10 +189,14 @@ public class Questionnaire14_30 { return null; org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setQuestion(src.getQuestion()); + if (src.hasQuestion()) { + tgt.setQuestion(src.getQuestion()); + } if (src.hasHasAnswer()) tgt.setAnswered(src.getHasAnswer()); - tgt.setAnswer(VersionConvertor_14_30.convertType(src.getAnswer())); + if (src.hasAnswer()) { + tgt.setAnswer(VersionConvertor_14_30.convertType(src.getAnswer())); + } return tgt; } @@ -145,10 +205,14 @@ public class Questionnaire14_30 { return null; org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setQuestion(src.getQuestion()); + if (src.hasQuestion()) { + tgt.setQuestion(src.getQuestion()); + } if (src.hasAnswered()) tgt.setHasAnswer(src.getAnswered()); - tgt.setAnswer(VersionConvertor_14_30.convertType(src.getAnswer())); + if (src.hasAnswer()) { + tgt.setAnswer(VersionConvertor_14_30.convertType(src.getAnswer())); + } return tgt; } @@ -157,7 +221,9 @@ public class Questionnaire14_30 { return null; org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } return tgt; } @@ -166,7 +232,9 @@ public class Questionnaire14_30 { return null; org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/QuestionnaireResponse14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/QuestionnaireResponse14_30.java index b2b7852f0..44a9e2659 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/QuestionnaireResponse14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/QuestionnaireResponse14_30.java @@ -10,16 +10,32 @@ public class QuestionnaireResponse14_30 { return null; org.hl7.fhir.dstu2016may.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_14_30.convertReference(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_14_30.convertReference(src.getContext())); - tgt.setAuthor(VersionConvertor_14_30.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaire(VersionConvertor_14_30.convertReference(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); + } + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_14_30.convertReference(src.getContext())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_14_30.convertReference(src.getAuthor())); + } if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_14_30.convertReference(src.getSource())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_30.convertReference(src.getSource())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -28,16 +44,32 @@ public class QuestionnaireResponse14_30 { return null; org.hl7.fhir.dstu3.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu3.model.QuestionnaireResponse(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_14_30.convertReference(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); - tgt.setContext(VersionConvertor_14_30.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_14_30.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaire(VersionConvertor_14_30.convertReference(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_14_30.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_14_30.convertReference(src.getAuthor())); + } if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_14_30.convertReference(src.getSource())); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_30.convertReference(src.getSource())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -46,8 +78,12 @@ public class QuestionnaireResponse14_30 { return null; org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -56,8 +92,12 @@ public class QuestionnaireResponse14_30 { return null; org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -70,9 +110,15 @@ public class QuestionnaireResponse14_30 { tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -85,9 +131,15 @@ public class QuestionnaireResponse14_30 { tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_30.convertReference(src.getSubject())); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/SearchParameter14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/SearchParameter14_30.java index 8fc1175a0..4ad293ef6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/SearchParameter14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/SearchParameter14_30.java @@ -10,31 +10,53 @@ public class SearchParameter14_30 { return null; org.hl7.fhir.dstu2016may.model.SearchParameter tgt = new org.hl7.fhir.dstu2016may.model.SearchParameter(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); - tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasExpression()) tgt.setExpression(src.getExpression()); if (src.hasXpath()) tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -43,32 +65,52 @@ public class SearchParameter14_30 { return null; org.hl7.fhir.dstu3.model.SearchParameter tgt = new org.hl7.fhir.dstu3.model.SearchParameter(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_30.convertCodeableConceptToUsageContext(t)); if (src.hasRequirements()) tgt.setPurpose(src.getRequirements()); - tgt.setCode(src.getCode()); - tgt.addBase(src.getBase()); - tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + tgt.addBase(src.getBase()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_14_30.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasExpression()) tgt.setExpression(src.getExpression()); if (src.hasXpath()) tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -79,7 +121,9 @@ public class SearchParameter14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -90,7 +134,9 @@ public class SearchParameter14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/StructureDefinition14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/StructureDefinition14_30.java index 17d18ec4a..6f994dfd9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/StructureDefinition14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/StructureDefinition14_30.java @@ -43,45 +43,71 @@ public class StructureDefinition14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasTitle()) tgt.setDisplay(src.getTitle()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_14_30.convertCoding(t)); + if (src.hasKeyword()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_14_30.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - tgt.setAbstract(src.getAbstract()); - tgt.setContextType(convertExtensionContext(src.getContextType())); - for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasContextType()) { + tgt.setContextType(convertExtensionContext(src.getContextType())); + } + if (src.hasContext()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); + } if (src.hasBaseDefinition()) tgt.setBaseDefinition(src.getBaseDefinition()); if (src.hasType() && src.getDerivation() == org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT) tgt.setBaseType(src.getType()); - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasDerivation()) { + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + } if (src.hasSnapshot()) tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } return tgt; } @@ -92,18 +118,26 @@ public class StructureDefinition14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDisplay()) tgt.setTitle(src.getDisplay()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -116,27 +150,45 @@ public class StructureDefinition14_30 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_14_30.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_14_30.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion()); - for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - tgt.setAbstract(src.getAbstract()); - tgt.setContextType(convertExtensionContext(src.getContextType())); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } + if (src.hasContextType()) { + tgt.setContextType(convertExtensionContext(src.getContextType())); + } + if (src.hasContext()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); + } if (src.getDerivation() == TypeDerivationRule.CONSTRAINT) tgt.setType(src.getBaseType()); else tgt.setType(src.getId()); if (src.hasBaseDefinition()) tgt.setBaseDefinition(src.getBaseDefinition()); - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasDerivation()) { + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + } if (src.hasSnapshot()) { - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } tgt.getSnapshot().getElementFirstRep().getType().clear(); } if (src.hasDifferential()) { - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } tgt.getDifferential().getElementFirstRep().getType().clear(); } return tgt; @@ -149,7 +201,9 @@ public class StructureDefinition14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -160,7 +214,9 @@ public class StructureDefinition14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -169,7 +225,9 @@ public class StructureDefinition14_30 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + } return tgt; } @@ -178,7 +236,9 @@ public class StructureDefinition14_30 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + } return tgt; } @@ -219,7 +279,9 @@ public class StructureDefinition14_30 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) @@ -234,7 +296,9 @@ public class StructureDefinition14_30 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) @@ -249,7 +313,9 @@ public class StructureDefinition14_30 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + } return tgt; } @@ -258,7 +324,9 @@ public class StructureDefinition14_30 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_30.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/TestScript14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/TestScript14_30.java index af8dd6417..f4ffd310e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/TestScript14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/TestScript14_30.java @@ -190,28 +190,40 @@ public class TestScript14_30 { tgt.setLabel(src.getLabel()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } if (src.hasCompareToSourceId()) tgt.setCompareToSourceId(src.getCompareToSourceId()); if (src.hasCompareToSourcePath()) tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } if (src.hasHeaderField()) tgt.setHeaderField(src.getHeaderField()); if (src.hasMinimumId()) tgt.setMinimumId(src.getMinimumId()); if (src.hasNavigationLinks()) tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } if (src.hasPath()) tgt.setPath(src.getPath()); if (src.hasResource()) tgt.setResource(src.getResource()); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } if (src.hasResponseCode()) tgt.setResponseCode(src.getResponseCode()); - tgt.setRule(convertSetupActionAssertRuleComponent(src.getRule())); - tgt.setRuleset(convertSetupActionAssertRulesetComponent(src.getRuleset())); + if (src.hasRule()) { + tgt.setRule(convertSetupActionAssertRuleComponent(src.getRule())); + } + if (src.hasRuleset()) { + tgt.setRuleset(convertSetupActionAssertRulesetComponent(src.getRuleset())); + } if (src.hasSourceId()) tgt.setSourceId(src.getSourceId()); if (src.hasValidateProfileId()) @@ -232,28 +244,40 @@ public class TestScript14_30 { tgt.setLabel(src.getLabel()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + if (src.hasDirection()) { + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + } if (src.hasCompareToSourceId()) tgt.setCompareToSourceId(src.getCompareToSourceId()); if (src.hasCompareToSourcePath()) tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - tgt.setContentType(convertContentType(src.getContentType())); + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } if (src.hasHeaderField()) tgt.setHeaderField(src.getHeaderField()); if (src.hasMinimumId()) tgt.setMinimumId(src.getMinimumId()); if (src.hasNavigationLinks()) tgt.setNavigationLinks(src.getNavigationLinks()); - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + if (src.hasOperator()) { + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + } if (src.hasPath()) tgt.setPath(src.getPath()); if (src.hasResource()) tgt.setResource(src.getResource()); - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + if (src.hasResponse()) { + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + } if (src.hasResponseCode()) tgt.setResponseCode(src.getResponseCode()); - tgt.setRule(convertSetupActionAssertRuleComponent(src.getRule())); - tgt.setRuleset(convertSetupActionAssertRulesetComponent(src.getRuleset())); + if (src.hasRule()) { + tgt.setRule(convertSetupActionAssertRuleComponent(src.getRule())); + } + if (src.hasRuleset()) { + tgt.setRuleset(convertSetupActionAssertRulesetComponent(src.getRuleset())); + } if (src.hasSourceId()) tgt.setSourceId(src.getSourceId()); if (src.hasValidateProfileId()) @@ -270,7 +294,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRuleParamComponent(t)); + if (src.hasParam()) { + for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRuleParamComponent(t)); + } return tgt; } @@ -279,7 +305,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRuleParamComponent(t)); + if (src.hasParam()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRuleParamComponent(t)); + } return tgt; } @@ -288,7 +316,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -299,7 +329,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -310,7 +342,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent t : src.getRule()) tgt.addRule(convertSetupActionAssertRulesetRuleComponent(t)); + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent t : src.getRule()) tgt.addRule(convertSetupActionAssertRulesetRuleComponent(t)); + } return tgt; } @@ -319,7 +353,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent t : src.getRule()) tgt.addRule(convertSetupActionAssertRulesetRuleComponent(t)); + if (src.hasRule()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent t : src.getRule()) tgt.addRule(convertSetupActionAssertRulesetRuleComponent(t)); + } return tgt; } @@ -328,7 +364,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRulesetRuleParamComponent(t)); + if (src.hasParam()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRulesetRuleParamComponent(t)); + } return tgt; } @@ -337,7 +375,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRulesetRuleParamComponent(t)); + if (src.hasParam()) { + for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertSetupActionAssertRulesetRuleParamComponent(t)); + } return tgt; } @@ -346,7 +386,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -357,7 +399,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -368,8 +412,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -378,8 +426,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -388,15 +440,21 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setType(VersionConvertor_14_30.convertCoding(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_30.convertCoding(src.getType())); + } if (src.hasResource()) tgt.setResource(src.getResource()); if (src.hasLabel()) tgt.setLabel(src.getLabel()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); if (src.hasEncodeRequestUrl()) @@ -405,7 +463,9 @@ public class TestScript14_30 { tgt.setOrigin(src.getOrigin()); if (src.hasParams()) tgt.setParams(src.getParams()); - for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + if (src.hasRequestHeader()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } if (src.hasResponseId()) tgt.setResponseId(src.getResponseId()); if (src.hasSourceId()) @@ -428,8 +488,12 @@ public class TestScript14_30 { tgt.setLabel(src.getLabel()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setAccept(convertContentType(src.getAccept())); - tgt.setContentType(convertContentType(src.getContentType())); + if (src.hasAccept()) { + tgt.setAccept(convertContentType(src.getAccept())); + } + if (src.hasContentType()) { + tgt.setContentType(convertContentType(src.getContentType())); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); if (src.hasEncodeRequestUrl()) @@ -438,7 +502,9 @@ public class TestScript14_30 { tgt.setOrigin(src.getOrigin()); if (src.hasParams()) tgt.setParams(src.getParams()); - for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + if (src.hasRequestHeader()) { + for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } if (src.hasResponseId()) tgt.setResponseId(src.getResponseId()); if (src.hasSourceId()) @@ -455,8 +521,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -465,8 +535,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setField(src.getField()); - tgt.setValue(src.getValue()); + if (src.hasField()) { + tgt.setField(src.getField()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -475,7 +549,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -484,7 +560,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } return tgt; } @@ -493,8 +571,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -503,8 +585,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestActionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + if (src.hasOperation()) { + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + } + if (src.hasAssert()) { + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + } return tgt; } @@ -513,17 +599,27 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript tgt = new org.hl7.fhir.dstu3.model.TestScript(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptContactComponent t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -536,17 +632,39 @@ public class TestScript14_30 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRuleComponent(t)); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent t : src.getRuleset()) tgt.addRuleset(convertTestScriptRulesetComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu2016may.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRuleComponent(t)); + } + if (src.hasRuleset()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent t : src.getRuleset()) tgt.addRuleset(convertTestScriptRulesetComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -555,39 +673,73 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript tgt = new org.hl7.fhir.dstu2016may.model.TestScript(); VersionConvertor_14_30.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); - tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(src.getIdentifier())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertTestScriptContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRuleComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent t : src.getRuleset()) tgt.addRuleset(convertTestScriptRulesetComponent(t)); - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } + if (src.hasMetadata()) { + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + } + if (src.hasFixture()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_14_30.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRuleComponent(t)); + } + if (src.hasRuleset()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent t : src.getRuleset()) tgt.addRuleset(convertTestScriptRulesetComponent(t)); + } + if (src.hasSetup()) { + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + } + if (src.hasTest()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) { + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + } return tgt; } @@ -598,7 +750,9 @@ public class TestScript14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -609,7 +763,9 @@ public class TestScript14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -618,8 +774,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIndex(src.getIndex()); - tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + if (src.hasIndex()) { + tgt.setIndex(src.getIndex()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + } return tgt; } @@ -628,8 +788,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIndex(src.getIndex()); - tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + if (src.hasIndex()) { + tgt.setIndex(src.getIndex()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + } return tgt; } @@ -672,11 +836,17 @@ public class TestScript14_30 { tgt.setValidated(src.getValidated()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2016may.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu2016may.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setCapabilities(VersionConvertor_14_30.convertReference(src.getConformance())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasConformance()) { + tgt.setCapabilities(VersionConvertor_14_30.convertReference(src.getConformance())); + } return tgt; } @@ -691,11 +861,17 @@ public class TestScript14_30 { tgt.setValidated(src.getValidated()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); - tgt.setConformance(VersionConvertor_14_30.convertReference(src.getCapabilities())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } + if (src.hasCapabilities()) { + tgt.setConformance(VersionConvertor_14_30.convertReference(src.getCapabilities())); + } return tgt; } @@ -704,8 +880,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -714,8 +894,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -724,7 +908,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -735,7 +921,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -746,8 +934,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIndex(src.getIndex()); - tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + if (src.hasIndex()) { + tgt.setIndex(src.getIndex()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + } return tgt; } @@ -756,8 +948,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIndex(src.getIndex()); - tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + if (src.hasIndex()) { + tgt.setIndex(src.getIndex()); + } + if (src.hasProfile()) { + tgt.setProfile(VersionConvertor_14_30.convertCoding(src.getProfile())); + } return tgt; } @@ -766,8 +962,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRuleParamComponent(t)); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); + } + if (src.hasParam()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRuleParamComponent(t)); + } return tgt; } @@ -776,8 +976,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); - for (org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRuleParamComponent(t)); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); + } + if (src.hasParam()) { + for (org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRuleParamComponent(t)); + } return tgt; } @@ -786,7 +990,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -797,7 +1003,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -808,8 +1016,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRulesetRuleComponent(t)); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRulesetRuleComponent(t)); + } return tgt; } @@ -818,8 +1030,12 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); - for (org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRulesetRuleComponent(t)); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_30.convertReference(src.getResource())); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent t : src.getRule()) tgt.addRule(convertTestScriptRulesetRuleComponent(t)); + } return tgt; } @@ -828,7 +1044,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRulesetRuleParamComponent(t)); + if (src.hasParam()) { + for (org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRulesetRuleParamComponent(t)); + } return tgt; } @@ -837,7 +1055,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRulesetRuleParamComponent(t)); + if (src.hasParam()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent t : src.getParam()) tgt.addParam(convertTestScriptRulesetRuleParamComponent(t)); + } return tgt; } @@ -846,7 +1066,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -857,7 +1079,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -868,7 +1092,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptSetupComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -877,7 +1103,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } return tgt; } @@ -886,7 +1114,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -895,7 +1125,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } return tgt; } @@ -908,7 +1140,9 @@ public class TestScript14_30 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -921,7 +1155,9 @@ public class TestScript14_30 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } return tgt; } @@ -930,7 +1166,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefaultValue()) tgt.setDefaultValue(src.getDefaultValue()); if (src.hasHeaderField()) @@ -947,7 +1185,9 @@ public class TestScript14_30 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefaultValue()) tgt.setDefaultValue(src.getDefaultValue()); if (src.hasHeaderField()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ValueSet14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ValueSet14_30.java index 69403a105..75ac5fdbe 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ValueSet14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/ValueSet14_30.java @@ -10,10 +10,14 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -22,10 +26,14 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -36,8 +44,12 @@ public class ValueSet14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -48,8 +60,12 @@ public class ValueSet14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_30.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -58,11 +74,17 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -71,11 +93,17 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -84,9 +112,15 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -95,9 +129,15 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -150,17 +190,23 @@ public class ValueSet14_30 { VersionConvertor_14_30.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.setIdentifier(VersionConvertor_14_30.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.getCompose().hasLockedDate()) @@ -169,7 +215,9 @@ public class ValueSet14_30 { tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_30.convertCodeableConcept(t)); + } if (src.hasImmutable()) tgt.setImmutable(src.getImmutable()); if (src.hasPurpose()) @@ -178,7 +226,9 @@ public class ValueSet14_30 { tgt.setCopyright(src.getCopyright()); if (src.hasExtensible()) tgt.setExtensible(src.getExtensible()); - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } if (src.hasExpansion()) tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); return tgt; @@ -197,12 +247,16 @@ public class ValueSet14_30 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_30.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -219,10 +273,14 @@ public class ValueSet14_30 { tgt.setCopyright(src.getCopyright()); if (src.hasExtensible()) tgt.setExtensible(src.getExtensible()); - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } if (src.hasLockedDate()) tgt.getCompose().setLockedDate(src.getLockedDate()); - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + if (src.hasExpansion()) { + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + } return tgt; } @@ -235,7 +293,9 @@ public class ValueSet14_30 { for (org.hl7.fhir.dstu3.model.UriType ti : t.getValueSet()) tgt.addImport(ti.getValue()); tgt.addInclude(convertConceptSetComponent(t)); } - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasExclude()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -244,9 +304,15 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent(); VersionConvertor_14_30.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasImport()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); + } + if (src.hasInclude()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -257,7 +323,9 @@ public class ValueSet14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -268,7 +336,9 @@ public class ValueSet14_30 { VersionConvertor_14_30.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_30.convertContactPoint(t)); + } return tgt; } @@ -277,14 +347,22 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -293,14 +371,22 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -319,7 +405,9 @@ public class ValueSet14_30 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasContains()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -338,7 +426,9 @@ public class ValueSet14_30 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -347,8 +437,12 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } return tgt; } @@ -357,8 +451,12 @@ public class ValueSet14_30 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_14_30.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_30.convertType(src.getValue())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Bundle14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Bundle14_40.java index a521bce69..fe353d461 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Bundle14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Bundle14_40.java @@ -10,12 +10,20 @@ public class Bundle14_40 { return null; org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); VersionConvertor_14_40.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_14_40.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_14_40.convertSignature(src.getSignature())); + } return tgt; } @@ -24,12 +32,20 @@ public class Bundle14_40 { return null; org.hl7.fhir.dstu2016may.model.Bundle tgt = new org.hl7.fhir.dstu2016may.model.Bundle(); VersionConvertor_14_40.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_14_40.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_14_40.convertSignature(src.getSignature())); + } return tgt; } @@ -38,13 +54,23 @@ public class Bundle14_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -53,13 +79,23 @@ public class Bundle14_40 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -68,8 +104,12 @@ public class Bundle14_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasIfNoneMatch()) tgt.setIfNoneMatch(src.getIfNoneMatch()); if (src.hasIfModifiedSince()) @@ -86,8 +126,12 @@ public class Bundle14_40 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasIfNoneMatch()) tgt.setIfNoneMatch(src.getIfNoneMatch()); if (src.hasIfModifiedSince()) @@ -104,7 +148,9 @@ public class Bundle14_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) @@ -119,7 +165,9 @@ public class Bundle14_40 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) @@ -134,7 +182,9 @@ public class Bundle14_40 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } if (src.hasScore()) tgt.setScore(src.getScore()); return tgt; @@ -145,7 +195,9 @@ public class Bundle14_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } if (src.hasScore()) tgt.setScore(src.getScore()); return tgt; @@ -156,8 +208,12 @@ public class Bundle14_40 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -166,8 +222,12 @@ public class Bundle14_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleLinkComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CodeSystem14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CodeSystem14_40.java index 6b8d5c9b6..cc611f325 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CodeSystem14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CodeSystem14_40.java @@ -22,12 +22,16 @@ public class CodeSystem14_40 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -48,12 +52,20 @@ public class CodeSystem14_40 { tgt.setCompositional(src.getCompositional()); if (src.hasVersionNeeded()) tgt.setVersionNeeded(src.getVersionNeeded()); - tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasContent()) { + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + } if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -70,19 +82,25 @@ public class CodeSystem14_40 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) @@ -95,12 +113,20 @@ public class CodeSystem14_40 { tgt.setCompositional(src.getCompositional()); if (src.hasVersionNeeded()) tgt.setVersionNeeded(src.getVersionNeeded()); - tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasContent()) { + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + } if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -111,7 +137,9 @@ public class CodeSystem14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -122,7 +150,9 @@ public class CodeSystem14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -165,7 +195,9 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getOperator()) try { @@ -173,7 +205,9 @@ public class CodeSystem14_40 { } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setValue(src.getValue()); + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -182,11 +216,17 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (Enumeration t : src.getOperator()) tgt.addOperator(t.getValue().toCode()); - tgt.setValue(src.getValue()); + if (src.hasOperator()) { + for (Enumeration t : src.getOperator()) tgt.addOperator(t.getValue().toCode()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -195,14 +235,22 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (ConceptDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (ConceptDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -211,14 +259,22 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -229,8 +285,12 @@ public class CodeSystem14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -241,8 +301,12 @@ public class CodeSystem14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -251,8 +315,12 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } @@ -261,8 +329,12 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } @@ -271,10 +343,14 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setType(convertPropertyType(src.getType())); + if (src.hasType()) { + tgt.setType(convertPropertyType(src.getType())); + } return tgt; } @@ -283,10 +359,14 @@ public class CodeSystem14_40 { return null; org.hl7.fhir.r4.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.PropertyComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setType(convertPropertyType(src.getType())); + if (src.hasType()) { + tgt.setType(convertPropertyType(src.getType())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CompartmentDefinition14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CompartmentDefinition14_40.java index 08d89ae5d..172a3cff2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CompartmentDefinition14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/CompartmentDefinition14_40.java @@ -10,23 +10,37 @@ public class CompartmentDefinition14_40 { return null; org.hl7.fhir.r4.model.CompartmentDefinition tgt = new org.hl7.fhir.r4.model.CompartmentDefinition(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionContactComponent t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionContactComponent t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasRequirements()) tgt.setPurpose(src.getRequirements()); - tgt.setCode(convertCompartmentType(src.getCode())); - tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasCode()) { + tgt.setCode(convertCompartmentType(src.getCode())); + } + if (src.hasSearch()) { + tgt.setSearch(src.getSearch()); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -35,23 +49,37 @@ public class CompartmentDefinition14_40 { return null; org.hl7.fhir.dstu2016may.model.CompartmentDefinition tgt = new org.hl7.fhir.dstu2016may.model.CompartmentDefinition(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); - tgt.setCode(convertCompartmentType(src.getCode())); - tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasCode()) { + tgt.setCode(convertCompartmentType(src.getCode())); + } + if (src.hasSearch()) { + tgt.setSearch(src.getSearch()); + } + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -62,7 +90,9 @@ public class CompartmentDefinition14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -73,7 +103,9 @@ public class CompartmentDefinition14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -82,8 +114,12 @@ public class CompartmentDefinition14_40 { return null; org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasParam()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -94,8 +130,12 @@ public class CompartmentDefinition14_40 { return null; org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.r4.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasParam()) { + for (org.hl7.fhir.r4.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ConceptMap14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ConceptMap14_40.java index ad73dac5e..3bced4698 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ConceptMap14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ConceptMap14_40.java @@ -5,7 +5,6 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CanonicalType; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent; - import java.util.ArrayList; import java.util.List; @@ -59,39 +58,55 @@ public class ConceptMap14_40 { VersionConvertor_14_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(src.getIdentifier())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(src.getIdentifier())); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.getSource() instanceof CanonicalType) tgt.setSource(VersionConvertor_14_40.convertCanonicalToReference((CanonicalType) src.getSource())); - else + else if (src.hasSource()) { tgt.setSource(VersionConvertor_14_40.convertType(src.getSource())); + } if (src.getTarget() instanceof CanonicalType) tgt.setTarget(VersionConvertor_14_40.convertCanonicalToReference((CanonicalType) src.getTarget())); - else + else if (src.hasTarget()) { tgt.setTarget(VersionConvertor_14_40.convertType(src.getTarget())); - tgt.setSource(VersionConvertor_14_40.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_14_40.convertType(src.getTarget())); - for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_40.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_14_40.convertType(src.getTarget())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } return tgt; } @@ -102,7 +117,9 @@ public class ConceptMap14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -113,7 +130,9 @@ public class ConceptMap14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -176,9 +195,15 @@ public class ConceptMap14_40 { return null; org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setProperty(src.getElement()); - tgt.setSystem(src.getSystem()); - tgt.setValue(src.getCode()); + if (src.hasElement()) { + tgt.setProperty(src.getElement()); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasCode()) { + tgt.setValue(src.getCode()); + } return tgt; } @@ -187,9 +212,15 @@ public class ConceptMap14_40 { return null; org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setElement(src.getProperty()); - tgt.setSystem(src.getSystem()); - tgt.setCode(src.getValue()); + if (src.hasProperty()) { + tgt.setElement(src.getProperty()); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasValue()) { + tgt.setCode(src.getValue()); + } return tgt; } @@ -203,7 +234,9 @@ public class ConceptMap14_40 { if (src.hasCode()) tgt.setCode(src.getCode()); tgt.addTarget(convertTargetElementComponent(t)); - res.add(new VersionConvertor_14_40.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem())); + if (src.hasSystem()) { + res.add(new VersionConvertor_14_40.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem())); + } } return res; } @@ -217,7 +250,9 @@ public class ConceptMap14_40 { tgt.setSystem(g.getSource()); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + } return tgt; } @@ -228,11 +263,17 @@ public class ConceptMap14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } if (src.hasComments()) tgt.setComment(src.getComments()); - for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -245,11 +286,17 @@ public class ConceptMap14_40 { tgt.setSystem(g.getTarget()); if (src.hasCode()) tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + if (src.hasEquivalence()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); + } if (src.hasComment()) tgt.setComments(src.getComment()); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Conformance14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Conformance14_40.java index 25b74f61c..cfbd421f5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Conformance14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Conformance14_40.java @@ -49,34 +49,58 @@ public class Conformance14_40 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(src.getFhirVersion().toCode()); + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion().toCode()); + } if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown")) tgt.setAcceptUnknown(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue())); - for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r4.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_14_40.convertCanonicalToReference(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r4.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_14_40.convertCanonicalToReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -91,14 +115,18 @@ public class Conformance14_40 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_40.isJurisdiction(t)) @@ -109,16 +137,32 @@ public class Conformance14_40 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } if (src.hasAcceptUnknown()) tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue())); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -129,7 +173,9 @@ public class Conformance14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -140,7 +186,9 @@ public class Conformance14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -149,10 +197,14 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_14_40.convertCanonicalToReference(src.getProfileElement())); + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_14_40.convertCanonicalToReference(src.getProfileElement())); + } return tgt; } @@ -161,10 +213,14 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setProfileElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getProfile())); + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -173,7 +229,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasUrl()) tgt.setUrl(src.getUrl()); return tgt; @@ -184,7 +242,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceImplementationComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceImplementationComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasUrl()) tgt.setUrl(src.getUrl()); return tgt; @@ -195,7 +255,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) @@ -231,7 +293,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) @@ -264,8 +328,12 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_14_40.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_14_40.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -274,8 +342,12 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_14_40.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_14_40.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -284,15 +356,29 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -301,15 +387,29 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r4.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -318,8 +418,12 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinitionElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinitionElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getDefinition())); + } return tgt; } @@ -328,8 +432,12 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_14_40.convertCanonicalToReference(src.getDefinitionElement())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinitionElement()) { + tgt.setDefinition(VersionConvertor_14_40.convertCanonicalToReference(src.getDefinitionElement())); + } return tgt; } @@ -338,10 +446,18 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_14_40.convertCanonicalToReference(src.getProfileElement())); - for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_14_40.convertCanonicalToReference(src.getProfileElement())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } if (src.hasReadHistory()) tgt.setReadHistory(src.getReadHistory()); if (src.hasUpdateCreate()) @@ -350,10 +466,18 @@ public class Conformance14_40 { tgt.setConditionalCreate(src.getConditionalCreate()); if (src.hasConditionalUpdate()) tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -362,10 +486,18 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getProfile())); - for (org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getProfile())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } if (src.hasReadHistory()) tgt.setReadHistory(src.getReadHistory()); if (src.hasUpdateCreate()) @@ -374,10 +506,18 @@ public class Conformance14_40 { tgt.setConditionalCreate(src.getConditionalCreate()); if (src.hasConditionalUpdate()) tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -386,10 +526,14 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -400,10 +544,14 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -416,7 +564,9 @@ public class Conformance14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -429,7 +579,9 @@ public class Conformance14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -440,7 +592,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasReleaseDate()) @@ -453,7 +607,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasReleaseDate()) @@ -522,7 +678,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -533,7 +691,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -600,7 +760,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -611,7 +773,9 @@ public class Conformance14_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/DataElement14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/DataElement14_40.java index fa5c58774..bc3133993 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/DataElement14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/DataElement14_40.java @@ -13,10 +13,14 @@ public class DataElement14_40 { VersionConvertor_14_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) @@ -25,15 +29,21 @@ public class DataElement14_40 { tgt.setDate(src.getDate()); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_40.convertCodeableConceptToUsageContext(t)); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.getSnapshot().addElement(VersionConvertor_14_40.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) if (src.hasElement()) { + tgt.getSnapshot().addElement(VersionConvertor_14_40.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + } tgt.setKind(StructureDefinitionKind.COMPLEXTYPE); tgt.setAbstract(false); tgt.setType(tgt.getName()); @@ -49,7 +59,9 @@ public class DataElement14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -60,7 +72,9 @@ public class DataElement14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -69,7 +83,9 @@ public class DataElement14_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ImplementationGuide14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ImplementationGuide14_40.java index 8a443444b..61a796ec8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ImplementationGuide14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ImplementationGuide14_40.java @@ -8,7 +8,6 @@ import org.hl7.fhir.r4.model.CanonicalType; import org.hl7.fhir.r4.model.Enumeration; import org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration; import org.hl7.fhir.r4.model.Type; - import java.util.List; public class ImplementationGuide14_40 { @@ -18,34 +17,54 @@ public class ImplementationGuide14_40 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) for (Enumeration v : src.getFhirVersion()) { tgt.setFhirVersion(v.asStringValue()); } - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasDefinition()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + } return tgt; } @@ -54,16 +73,24 @@ public class ImplementationGuide14_40 { return null; org.hl7.fhir.r4.model.ImplementationGuide tgt = new org.hl7.fhir.r4.model.ImplementationGuide(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -76,10 +103,18 @@ public class ImplementationGuide14_40 { tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) tgt.addFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); + if (src.hasDependency()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasPage()) { + tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); + } return tgt; } @@ -90,7 +125,9 @@ public class ImplementationGuide14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -101,7 +138,9 @@ public class ImplementationGuide14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -111,7 +150,9 @@ public class ImplementationGuide14_40 { org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_14_40.copyElement(src, tgt); tgt.setType(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.REFERENCE); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } return tgt; } @@ -120,7 +161,9 @@ public class ImplementationGuide14_40 { return null; org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } if (org.hl7.fhir.dstu2016may.utils.ToolingExtensions.hasExtension(src, VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION)) { tgt.setPackageId(org.hl7.fhir.dstu2016may.utils.ToolingExtensions.readStringExtension(src, VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION)); } @@ -135,8 +178,12 @@ public class ImplementationGuide14_40 { return null; org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -145,8 +192,12 @@ public class ImplementationGuide14_40 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfile(VersionConvertor_14_40.convertCanonicalToReference(src.getProfileElement())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_14_40.convertCanonicalToReference(src.getProfileElement())); + } return tgt; } @@ -173,8 +224,12 @@ public class ImplementationGuide14_40 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setId(src.getId()); - tgt.setName(src.getName()); + if (src.hasId()) { + tgt.setId(src.getId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -186,7 +241,9 @@ public class ImplementationGuide14_40 { org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); VersionConvertor_14_40.copyElement(src, tgt); if (src.hasExampleCanonicalType()) { - tgt.setExampleFor(VersionConvertor_14_40.convertCanonicalToReference(src.getExampleCanonicalType())); + if (src.hasExampleCanonicalType()) { + tgt.setExampleFor(VersionConvertor_14_40.convertCanonicalToReference(src.getExampleCanonicalType())); + } tgt.setExample(true); } else if (src.hasExampleBooleanType()) tgt.setExample(src.getExampleBooleanType().getValue()); @@ -229,10 +286,14 @@ public class ImplementationGuide14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasSource()) tgt.setName(convertUriToUrl(src.getSourceElement())); - tgt.setTitle(src.getName()); + if (src.hasName()) { + tgt.setTitle(src.getName()); + } if (src.hasKind()) tgt.setGeneration(convertPageGeneration(src.getKind())); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -243,10 +304,14 @@ public class ImplementationGuide14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasNameUrlType()) tgt.setSource(src.getNameUrlType().getValue()); - tgt.setName(src.getTitle()); + if (src.hasTitle()) { + tgt.setName(src.getTitle()); + } if (src.hasGeneration()) tgt.setKind(convertPageGeneration(src.getGeneration())); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/NamingSystem14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/NamingSystem14_40.java index f4e015a3e..9dda1cfc0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/NamingSystem14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/NamingSystem14_40.java @@ -10,16 +10,28 @@ public class NamingSystem14_40 { return null; org.hl7.fhir.r4.model.NamingSystem tgt = new org.hl7.fhir.r4.model.NamingSystem(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); - tgt.setDate(src.getDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } + if (src.hasDate()) { + tgt.setDate(src.getDate()); + } if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_14_40.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_40.convertCodeableConcept(src.getType())); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_40.isJurisdiction(t)) @@ -28,7 +40,9 @@ public class NamingSystem14_40 { tgt.addUseContext(VersionConvertor_14_40.convertCodeableConceptToUsageContext(t)); if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -37,24 +51,40 @@ public class NamingSystem14_40 { return null; org.hl7.fhir.dstu2016may.model.NamingSystem tgt = new org.hl7.fhir.dstu2016may.model.NamingSystem(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); - tgt.setDate(src.getDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } + if (src.hasDate()) { + tgt.setDate(src.getDate()); + } if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_14_40.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_40.convertCodeableConcept(src.getType())); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -65,7 +95,9 @@ public class NamingSystem14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -76,7 +108,9 @@ public class NamingSystem14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -149,11 +183,17 @@ public class NamingSystem14_40 { return null; org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } if (src.hasPreferred()) tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_14_40.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_14_40.convertPeriod(src.getPeriod())); + } return tgt; } @@ -162,11 +202,17 @@ public class NamingSystem14_40 { return null; org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } if (src.hasPreferred()) tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_14_40.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_14_40.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationDefinition14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationDefinition14_40.java index 540cc16cd..2421abdb7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationDefinition14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationDefinition14_40.java @@ -16,16 +16,24 @@ public class OperationDefinition14_40 { tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_40.isJurisdiction(t)) @@ -36,15 +44,27 @@ public class OperationDefinition14_40 { tgt.setPurpose(src.getRequirements()); if (src.hasIdempotent()) tgt.setAffectsState(!src.getIdempotent()); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasComment()) tgt.setComment(src.getComment()); - tgt.setBaseElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getBase())); - tgt.setSystem(src.getSystem()); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + if (src.hasBase()) { + tgt.setBaseElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getBase())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + } tgt.setType(tgt.hasResource()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -57,34 +77,56 @@ public class OperationDefinition14_40 { tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasAffectsState()) tgt.setIdempotent(!src.getAffectsState()); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasComment()) tgt.setComment(src.getComment()); - tgt.setBase(VersionConvertor_14_40.convertCanonicalToReference(src.getBaseElement())); - tgt.setSystem(src.getSystem()); + if (src.hasBaseElement()) { + tgt.setBase(VersionConvertor_14_40.convertCanonicalToReference(src.getBaseElement())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.getType()) - for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) tgt.addType(t.getValue()); + } + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -95,7 +137,9 @@ public class OperationDefinition14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -106,7 +150,9 @@ public class OperationDefinition14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -148,18 +194,34 @@ public class OperationDefinition14_40 { return null; org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); if (src.hasType()) tgt.setType(src.getType()); - tgt.setSearchType(VersionConvertor_14_40.convertSearchParamType(src.getSearchType())); - tgt.addTargetProfile(src.getProfile().getReference()); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasSearchType()) { + tgt.setSearchType(VersionConvertor_14_40.convertSearchParamType(src.getSearchType())); + } + if (src.hasProfile()) { + tgt.addTargetProfile(src.getProfile().getReference()); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -168,18 +230,34 @@ public class OperationDefinition14_40 { return null; org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); if (src.hasType()) tgt.setType(src.getType()); - tgt.setSearchType(VersionConvertor_14_40.convertSearchParamType(src.getSearchType())); - for (org.hl7.fhir.r4.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu2016may.model.Reference(t.getValue())); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasSearchType()) { + tgt.setSearchType(VersionConvertor_14_40.convertSearchParamType(src.getSearchType())); + } + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r4.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu2016may.model.Reference(t.getValue())); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationOutcome14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationOutcome14_40.java index 510edcbf0..5094da082 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationOutcome14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/OperationOutcome14_40.java @@ -178,7 +178,9 @@ public class OperationOutcome14_40 { return null; org.hl7.fhir.dstu2016may.model.OperationOutcome tgt = new org.hl7.fhir.dstu2016may.model.OperationOutcome(); VersionConvertor_14_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome14_40 { return null; org.hl7.fhir.r4.model.OperationOutcome tgt = new org.hl7.fhir.r4.model.OperationOutcome(); VersionConvertor_14_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -196,13 +200,23 @@ public class OperationOutcome14_40 { return null; org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_14_40.convertCodeableConcept(src.getDetails())); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_14_40.convertCodeableConcept(src.getDetails())); + } if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.r4.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_40.convertTo2016MayExpression(t.getValue())); + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.r4.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_40.convertTo2016MayExpression(t.getValue())); + } return tgt; } @@ -211,13 +225,23 @@ public class OperationOutcome14_40 { return null; org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_14_40.convertCodeableConcept(src.getDetails())); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_14_40.convertCodeableConcept(src.getDetails())); + } if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_40.convertToR4Expression(t.getValue())); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_40.convertToR4Expression(t.getValue())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Parameters14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Parameters14_40.java index f9233b5ba..420653609 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Parameters14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Parameters14_40.java @@ -10,7 +10,9 @@ public class Parameters14_40 { return null; org.hl7.fhir.dstu2016may.model.Parameters tgt = new org.hl7.fhir.dstu2016may.model.Parameters(); VersionConvertor_14_40.copyResource(src, tgt); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters14_40 { return null; org.hl7.fhir.r4.model.Parameters tgt = new org.hl7.fhir.r4.model.Parameters(); VersionConvertor_14_40.copyResource(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -28,10 +32,18 @@ public class Parameters14_40 { return null; org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); - tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); - for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -40,10 +52,18 @@ public class Parameters14_40 { return null; org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); - tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_40.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Questionnaire14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Questionnaire14_40.java index 76f3d7fae..1e36fcbff 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Questionnaire14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/Questionnaire14_40.java @@ -15,24 +15,36 @@ public class Questionnaire14_40 { VersionConvertor_14_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addContact(convertQuestionnaireContactComponent(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addContact(convertQuestionnaireContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_40.convertCodeableConceptToUsageContext(t)); if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_40.convertCoding(t)); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_40.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -43,22 +55,38 @@ public class Questionnaire14_40 { VersionConvertor_14_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r4.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t1)); - for (UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasContact()) { + for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r4.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t1)); + } + if (src.hasUseContext()) { + for (UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_40.convertCoding(t)); - for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_40.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -78,13 +106,19 @@ public class Questionnaire14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_40.convertCoding(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_40.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasEnableWhen()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -93,10 +127,18 @@ public class Questionnaire14_40 { tgt.setReadOnly(src.getReadOnly()); if (src.hasMaxLength()) tgt.setMaxLength(src.getMaxLength()); - tgt.setAnswerValueSetElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getOptions())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); - tgt.addInitial().setValue(VersionConvertor_14_40.convertType(src.getInitial())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasOptions()) { + tgt.setAnswerValueSetElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getOptions())); + } + if (src.hasOption()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); + } + if (src.hasInitial()) { + tgt.addInitial().setValue(VersionConvertor_14_40.convertType(src.getInitial())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -107,13 +149,19 @@ public class Questionnaire14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_40.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_40.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasEnableWhen()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -122,11 +170,17 @@ public class Questionnaire14_40 { tgt.setReadOnly(src.getReadOnly()); if (src.hasMaxLength()) tgt.setMaxLength(src.getMaxLength()); - tgt.setOptions(VersionConvertor_14_40.convertCanonicalToReference(src.getAnswerValueSetElement())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + if (src.hasAnswerValueSetElement()) { + tgt.setOptions(VersionConvertor_14_40.convertCanonicalToReference(src.getAnswerValueSetElement())); + } + if (src.hasAnswerOption()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + } if (src.hasInitial()) tgt.setInitial(VersionConvertor_14_40.convertType(src.getInitialFirstRep().getValue())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -135,12 +189,18 @@ public class Questionnaire14_40 { return null; org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setQuestion(src.getQuestion()); + if (src.hasQuestion()) { + tgt.setQuestion(src.getQuestion()); + } if (src.hasAnswered()) { tgt.setOperator(QuestionnaireItemOperator.EXISTS); - tgt.setAnswer(VersionConvertor_14_40.convertType(src.getAnsweredElement())); + if (src.hasAnsweredElement()) { + tgt.setAnswer(VersionConvertor_14_40.convertType(src.getAnsweredElement())); + } + } + if (src.hasAnswer()) { + tgt.setAnswer(VersionConvertor_14_40.convertType(src.getAnswer())); } - tgt.setAnswer(VersionConvertor_14_40.convertType(src.getAnswer())); return tgt; } @@ -149,7 +209,9 @@ public class Questionnaire14_40 { return null; org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setQuestion(src.getQuestion()); + if (src.hasQuestion()) { + tgt.setQuestion(src.getQuestion()); + } if (src.hasOperator() && src.getOperator() == QuestionnaireItemOperator.EXISTS) tgt.setAnswered(src.getAnswerBooleanType().getValue()); else @@ -162,7 +224,9 @@ public class Questionnaire14_40 { return null; org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } @@ -171,7 +235,9 @@ public class Questionnaire14_40 { return null; org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/QuestionnaireResponse14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/QuestionnaireResponse14_40.java index 70f49891c..3a159dd95 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/QuestionnaireResponse14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/QuestionnaireResponse14_40.java @@ -10,16 +10,32 @@ public class QuestionnaireResponse14_40 { return null; org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaireElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_14_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_14_40.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_14_40.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaireElement(VersionConvertor_14_40.convertReferenceToCanonical(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_14_40.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_14_40.convertReference(src.getAuthor())); + } if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_14_40.convertReference(src.getSource())); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_40.convertReference(src.getSource())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -28,16 +44,32 @@ public class QuestionnaireResponse14_40 { return null; org.hl7.fhir.dstu2016may.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_14_40.convertCanonicalToReference(src.getQuestionnaireElement())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_14_40.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_14_40.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_14_40.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaireElement()) { + tgt.setQuestionnaire(VersionConvertor_14_40.convertCanonicalToReference(src.getQuestionnaireElement())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_40.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_14_40.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_14_40.convertReference(src.getAuthor())); + } if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_14_40.convertReference(src.getSource())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_40.convertReference(src.getSource())); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -46,8 +78,12 @@ public class QuestionnaireResponse14_40 { return null; org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -56,8 +92,12 @@ public class QuestionnaireResponse14_40 { return null; org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -70,8 +110,12 @@ public class QuestionnaireResponse14_40 { tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -84,8 +128,12 @@ public class QuestionnaireResponse14_40 { tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/SearchParameter14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/SearchParameter14_40.java index b3df0a4c7..85e36ab84 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/SearchParameter14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/SearchParameter14_40.java @@ -10,32 +10,52 @@ public class SearchParameter14_40 { return null; org.hl7.fhir.r4.model.SearchParameter tgt = new org.hl7.fhir.r4.model.SearchParameter(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_40.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_40.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_40.convertCodeableConceptToUsageContext(t)); if (src.hasRequirements()) tgt.setPurpose(src.getRequirements()); - tgt.setCode(src.getCode()); - tgt.addBase(src.getBase()); - tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + tgt.addBase(src.getBase()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasExpression()) tgt.setExpression(VersionConvertor_14_40.convertToR4Expression(src.getExpression())); if (src.hasXpath()) tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -44,31 +64,53 @@ public class SearchParameter14_40 { return null; org.hl7.fhir.dstu2016may.model.SearchParameter tgt = new org.hl7.fhir.dstu2016may.model.SearchParameter(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); - tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_14_40.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasExpression()) tgt.setExpression(VersionConvertor_14_40.convertTo2016MayExpression(src.getExpression())); if (src.hasXpath()) tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -79,7 +121,9 @@ public class SearchParameter14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -90,7 +134,9 @@ public class SearchParameter14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureDefinition14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureDefinition14_40.java index 8dfd797b9..61c46854b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureDefinition14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureDefinition14_40.java @@ -50,35 +50,53 @@ public class StructureDefinition14_40 { VersionConvertor_14_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasTitle()) tgt.setDisplay(src.getTitle()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_14_40.convertCoding(t)); + if (src.hasKeyword()) { + for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_14_40.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); - for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - tgt.setAbstract(src.getAbstract()); + if (src.hasMapping()) { + for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) { if (!tgt.hasContextType()) tgt.setContextType(convertExtensionContext(t.getType(), t.getExpression())); @@ -88,10 +106,14 @@ public class StructureDefinition14_40 { tgt.setBaseDefinition(src.getBaseDefinition()); if (src.hasType() && src.getDerivation() == org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT) tgt.setBaseType(src.getType()); - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasDerivation()) { + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + } if (src.hasSnapshot()) tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } return tgt; } @@ -102,18 +124,26 @@ public class StructureDefinition14_40 { VersionConvertor_14_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDisplay()) tgt.setTitle(src.getDisplay()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -126,15 +156,25 @@ public class StructureDefinition14_40 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_14_40.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_14_40.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind(), src.getName())); - tgt.setAbstract(src.getAbstract()); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind(), src.getName())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.dstu2016may.model.StringType t : src.getContext()) { org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent ec = tgt.addContext(); - ec.setType(convertExtensionContext(src.getContextType())); + if (src.hasContextType()) { + ec.setType(convertExtensionContext(src.getContextType())); + } ec.setExpression("*".equals(t.getValue()) ? "Element" : t.getValue()); } if (src.getDerivation() == org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT) @@ -143,13 +183,19 @@ public class StructureDefinition14_40 { tgt.setType(src.getId()); if (src.hasBaseDefinition()) tgt.setBaseDefinition(src.getBaseDefinition()); - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasDerivation()) { + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + } if (src.hasSnapshot()) { - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } tgt.getSnapshot().getElementFirstRep().getType().clear(); } if (src.hasDifferential()) { - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } tgt.getDifferential().getElementFirstRep().getType().clear(); } if (tgt.getDerivation() == TypeDerivationRule.SPECIALIZATION) { @@ -169,7 +215,9 @@ public class StructureDefinition14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -180,7 +228,9 @@ public class StructureDefinition14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -189,7 +239,9 @@ public class StructureDefinition14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t)); + } return tgt; } @@ -198,7 +250,9 @@ public class StructureDefinition14_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) if (src.hasElement()) { + tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + } return tgt; } @@ -242,7 +296,9 @@ public class StructureDefinition14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) @@ -257,7 +313,9 @@ public class StructureDefinition14_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) @@ -272,7 +330,9 @@ public class StructureDefinition14_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) if (src.hasElement()) { + tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + } return tgt; } @@ -281,7 +341,9 @@ public class StructureDefinition14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_40.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureMap14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureMap14_40.java index d87fb1fd6..f6878be94 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureMap14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/StructureMap14_40.java @@ -14,31 +14,49 @@ public class StructureMap14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureMap tgt = new org.hl7.fhir.dstu2016may.model.StructureMap(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.r4.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -47,17 +65,27 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap tgt = new org.hl7.fhir.r4.model.StructureMap(); VersionConvertor_14_40.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContactComponent t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContactComponent t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -70,9 +98,15 @@ public class StructureMap14_40 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -83,7 +117,9 @@ public class StructureMap14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -94,7 +130,9 @@ public class StructureMap14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -129,15 +167,21 @@ public class StructureMap14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasExtends()) tgt.setExtends(src.getExtends()); if (!src.getTypeMode().equals(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NONE)) throw new FHIRException("Unable to downgrade structure map with group.typeMode other than 'None': " + src.getTypeMode().getDisplay()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -146,14 +190,20 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasExtends()) tgt.setExtends(src.getExtends()); tgt.setTypeMode(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NONE); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -162,10 +212,14 @@ public class StructureMap14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasType()) tgt.setType(src.getType()); - tgt.setMode(convertStructureMapInputMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertStructureMapInputMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -176,10 +230,14 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasType()) tgt.setType(src.getType()); - tgt.setMode(convertStructureMapInputMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertStructureMapInputMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -190,11 +248,21 @@ public class StructureMap14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSource()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -205,11 +273,21 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSource()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -220,8 +298,12 @@ public class StructureMap14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + } return tgt; } @@ -230,8 +312,12 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + } return tgt; } @@ -240,7 +326,9 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setMin(src.getRequired() ? 1 : 0); + if (src.hasRequired()) { + tgt.setMin(src.getRequired() ? 1 : 0); + } if (src.getContextType().equals(StructureMap.StructureMapContextType.TYPE)) tgt.setType(src.getContext()); if (src.hasElement()) @@ -262,7 +350,9 @@ public class StructureMap14_40 { org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent(); VersionConvertor_14_40.copyElement(src, tgt); tgt.setContextType(StructureMapContextType.TYPE); - tgt.setContext(src.getContext()); + if (src.hasContext()) { + tgt.setContext(src.getContext()); + } if (src.hasElement()) tgt.setElement(src.getElement()); if (src.hasListMode()) @@ -289,12 +379,16 @@ public class StructureMap14_40 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (Enumeration t : src.getListMode()) tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + if (src.hasListMode()) { + for (Enumeration t : src.getListMode()) tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } @@ -311,12 +405,16 @@ public class StructureMap14_40 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getListMode()) VersionConvertor_14_40.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + if (src.hasListMode()) { + for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getListMode()) VersionConvertor_14_40.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } @@ -325,7 +423,9 @@ public class StructureMap14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } @@ -334,7 +434,9 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } @@ -395,8 +497,12 @@ public class StructureMap14_40 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setMode(convertStructureMapStructureMode(src.getMode())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasMode()) { + tgt.setMode(convertStructureMapStructureMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -407,8 +513,12 @@ public class StructureMap14_40 { return null; org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setMode(convertStructureMapStructureMode(src.getMode())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasMode()) { + tgt.setMode(convertStructureMapStructureMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ValueSet14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ValueSet14_40.java index 5ebe9dc74..fbfe56d25 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ValueSet14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/ValueSet14_40.java @@ -11,10 +11,14 @@ public class ValueSet14_40 { return null; org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -23,10 +27,14 @@ public class ValueSet14_40 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -37,8 +45,12 @@ public class ValueSet14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -49,8 +61,12 @@ public class ValueSet14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_40.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -59,11 +75,17 @@ public class ValueSet14_40 { return null; org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -72,11 +94,17 @@ public class ValueSet14_40 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -85,9 +113,15 @@ public class ValueSet14_40 { return null; org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -96,9 +130,15 @@ public class ValueSet14_40 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -157,12 +197,16 @@ public class ValueSet14_40 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -179,10 +223,14 @@ public class ValueSet14_40 { tgt.setCopyright(src.getCopyright()); if (src.hasExtensible()) tgt.addExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible", new BooleanType(src.getExtensible())); - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } if (src.hasLockedDate()) tgt.getCompose().setLockedDate(src.getLockedDate()); - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + if (src.hasExpansion()) { + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + } return tgt; } @@ -193,17 +241,23 @@ public class ValueSet14_40 { VersionConvertor_14_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.setIdentifier(VersionConvertor_14_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_40.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.getCompose().hasLockedDate()) @@ -212,7 +266,9 @@ public class ValueSet14_40 { tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_40.convertCodeableConcept(t)); + } if (src.hasImmutable()) tgt.setImmutable(src.getImmutable()); if (src.hasPurpose()) @@ -221,7 +277,9 @@ public class ValueSet14_40 { tgt.setCopyright(src.getCopyright()); if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible")) tgt.setExtensible(((BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/valueset-extensible").getValue()).booleanValue()); - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } if (src.hasExpansion()) tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); return tgt; @@ -232,9 +290,15 @@ public class ValueSet14_40 { return null; org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent(); VersionConvertor_14_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasImport()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); + } + if (src.hasInclude()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -247,7 +311,9 @@ public class ValueSet14_40 { for (org.hl7.fhir.r4.model.UriType ti : t.getValueSet()) tgt.addImport(ti.getValue()); tgt.addInclude(convertConceptSetComponent(t)); } - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasExclude()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -258,7 +324,9 @@ public class ValueSet14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -269,7 +337,9 @@ public class ValueSet14_40 { VersionConvertor_14_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_40.convertContactPoint(t)); + } return tgt; } @@ -278,14 +348,22 @@ public class ValueSet14_40 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -294,14 +372,22 @@ public class ValueSet14_40 { return null; org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -320,7 +406,9 @@ public class ValueSet14_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -339,7 +427,9 @@ public class ValueSet14_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasContains()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -348,8 +438,12 @@ public class ValueSet14_40 { return null; org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } @@ -358,8 +452,12 @@ public class ValueSet14_40 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_14_40.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_40.convertType(src.getValue())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Bundle14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Bundle14_50.java index 3996863c8..becb96bd3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Bundle14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Bundle14_50.java @@ -10,12 +10,20 @@ public class Bundle14_50 { return null; org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle(); VersionConvertor_14_50.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_14_50.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_14_50.convertSignature(src.getSignature())); + } return tgt; } @@ -24,12 +32,20 @@ public class Bundle14_50 { return null; org.hl7.fhir.dstu2016may.model.Bundle tgt = new org.hl7.fhir.dstu2016may.model.Bundle(); VersionConvertor_14_50.copyResource(src, tgt); - tgt.setType(convertBundleType(src.getType())); + if (src.hasType()) { + tgt.setType(convertBundleType(src.getType())); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); - tgt.setSignature(VersionConvertor_14_50.convertSignature(src.getSignature())); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) { + tgt.setSignature(VersionConvertor_14_50.convertSignature(src.getSignature())); + } return tgt; } @@ -38,13 +54,23 @@ public class Bundle14_50 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -53,13 +79,23 @@ public class Bundle14_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); - tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); + } + if (src.hasSearch()) { + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + } + if (src.hasRequest()) { + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + } + if (src.hasResponse()) { + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + } return tgt; } @@ -68,8 +104,12 @@ public class Bundle14_50 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasIfNoneMatch()) tgt.setIfNoneMatch(src.getIfNoneMatch()); if (src.hasIfModifiedSince()) @@ -86,8 +126,12 @@ public class Bundle14_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMethod(convertHTTPVerb(src.getMethod())); - tgt.setUrl(src.getUrl()); + if (src.hasMethod()) { + tgt.setMethod(convertHTTPVerb(src.getMethod())); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasIfNoneMatch()) tgt.setIfNoneMatch(src.getIfNoneMatch()); if (src.hasIfModifiedSince()) @@ -104,7 +148,9 @@ public class Bundle14_50 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) @@ -119,7 +165,9 @@ public class Bundle14_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setStatus(src.getStatus()); + if (src.hasStatus()) { + tgt.setStatus(src.getStatus()); + } if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) @@ -134,7 +182,9 @@ public class Bundle14_50 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } if (src.hasScore()) tgt.setScore(src.getScore()); return tgt; @@ -145,7 +195,9 @@ public class Bundle14_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertSearchEntryMode(src.getMode())); + } if (src.hasScore()) tgt.setScore(src.getScore()); return tgt; @@ -156,8 +208,12 @@ public class Bundle14_50 { return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } @@ -166,8 +222,12 @@ public class Bundle14_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleLinkComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setRelation(src.getRelation()); - tgt.setUrl(src.getUrl()); + if (src.hasRelation()) { + tgt.setRelation(src.getRelation()); + } + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CodeSystem14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CodeSystem14_50.java index f3e1be9b4..f230297a1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CodeSystem14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CodeSystem14_50.java @@ -22,19 +22,25 @@ public class CodeSystem14_50 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) @@ -47,12 +53,20 @@ public class CodeSystem14_50 { tgt.setCompositional(src.getCompositional()); if (src.hasVersionNeeded()) tgt.setVersionNeeded(src.getVersionNeeded()); - tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasContent()) { + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + } if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -69,12 +83,16 @@ public class CodeSystem14_50 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent t : src.getContact()) tgt.addContact(convertCodeSystemContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -95,12 +113,20 @@ public class CodeSystem14_50 { tgt.setCompositional(src.getCompositional()); if (src.hasVersionNeeded()) tgt.setVersionNeeded(src.getVersionNeeded()); - tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasContent()) { + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + } if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -111,7 +137,9 @@ public class CodeSystem14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -122,7 +150,9 @@ public class CodeSystem14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -165,11 +195,17 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (Enumeration t : src.getOperator()) tgt.addOperator(t.getValue().toCode()); - tgt.setValue(src.getValue()); + if (src.hasOperator()) { + for (Enumeration t : src.getOperator()) tgt.addOperator(t.getValue().toCode()); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -178,7 +214,9 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getOperator()) try { @@ -186,7 +224,9 @@ public class CodeSystem14_50 { } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - tgt.setValue(src.getValue()); + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -195,14 +235,22 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (ConceptDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (ConceptDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -211,14 +259,22 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -229,8 +285,12 @@ public class CodeSystem14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -241,8 +301,12 @@ public class CodeSystem14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -251,8 +315,12 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } @@ -261,8 +329,12 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } @@ -271,10 +343,14 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.r5.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.PropertyComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setType(convertPropertyType(src.getType())); + if (src.hasType()) { + tgt.setType(convertPropertyType(src.getType())); + } return tgt; } @@ -283,10 +359,14 @@ public class CodeSystem14_50 { return null; org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - tgt.setType(convertPropertyType(src.getType())); + if (src.hasType()) { + tgt.setType(convertPropertyType(src.getType())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CompartmentDefinition14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CompartmentDefinition14_50.java index 147135ba1..e4a22c792 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CompartmentDefinition14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/CompartmentDefinition14_50.java @@ -10,23 +10,37 @@ public class CompartmentDefinition14_50 { return null; org.hl7.fhir.dstu2016may.model.CompartmentDefinition tgt = new org.hl7.fhir.dstu2016may.model.CompartmentDefinition(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); - tgt.setCode(convertCompartmentType(src.getCode())); - tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasCode()) { + tgt.setCode(convertCompartmentType(src.getCode())); + } + if (src.hasSearch()) { + tgt.setSearch(src.getSearch()); + } + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -35,23 +49,37 @@ public class CompartmentDefinition14_50 { return null; org.hl7.fhir.r5.model.CompartmentDefinition tgt = new org.hl7.fhir.r5.model.CompartmentDefinition(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionContactComponent t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionContactComponent t : src.getContact()) tgt.addContact(convertCompartmentDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasRequirements()) tgt.setPurpose(src.getRequirements()); - tgt.setCode(convertCompartmentType(src.getCode())); - tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasCode()) { + tgt.setCode(convertCompartmentType(src.getCode())); + } + if (src.hasSearch()) { + tgt.setSearch(src.getSearch()); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -62,7 +90,9 @@ public class CompartmentDefinition14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -73,7 +103,9 @@ public class CompartmentDefinition14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -83,9 +115,13 @@ public class CompartmentDefinition14_50 { org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); VersionConvertor_14_50.copyElement(src, tgt); if (src.hasCode()) { - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + } + if (src.hasParam()) { + for (org.hl7.fhir.r5.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); } - for (org.hl7.fhir.r5.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -96,8 +132,12 @@ public class CompartmentDefinition14_50 { return null; org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasParam()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java index 43f864bf7..491be6d5e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ConceptMap14_50.java @@ -5,7 +5,6 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.ConceptMap; import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent; - import java.util.ArrayList; import java.util.List; @@ -60,40 +59,56 @@ public class ConceptMap14_50 { if (src.hasUrl()) tgt.setUrl(src.getUrl()); if (src.hasIdentifier()) { - tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(src.getIdentifierFirstRep())); + } } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.getSource() instanceof CanonicalType) tgt.setSource(VersionConvertor_14_50.convertCanonicalToReference((CanonicalType) src.getSource())); - else + else if (src.hasSource()) { tgt.setSource(VersionConvertor_14_50.convertType(src.getSource())); + } if (src.getTarget() instanceof CanonicalType) tgt.setTarget(VersionConvertor_14_50.convertCanonicalToReference((CanonicalType) src.getTarget())); - else + else if (src.hasTarget()) { tgt.setTarget(VersionConvertor_14_50.convertType(src.getTarget())); - tgt.setSource(VersionConvertor_14_50.convertType(src.getSource())); - tgt.setTarget(VersionConvertor_14_50.convertType(src.getTarget())); - for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_50.convertType(src.getSource())); + } + if (src.hasTarget()) { + tgt.setTarget(VersionConvertor_14_50.convertType(src.getTarget())); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g)); + } return tgt; } @@ -104,7 +119,9 @@ public class ConceptMap14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -115,7 +132,9 @@ public class ConceptMap14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -168,9 +187,15 @@ public class ConceptMap14_50 { return null; org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setElement(src.getProperty()); - tgt.setSystem(src.getSystem()); - tgt.setCode(src.getValue()); + if (src.hasProperty()) { + tgt.setElement(src.getProperty()); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasValue()) { + tgt.setCode(src.getValue()); + } return tgt; } @@ -179,9 +204,15 @@ public class ConceptMap14_50 { return null; org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setProperty(src.getElement()); - tgt.setSystem(src.getSystem()); - tgt.setValue(src.getCode()); + if (src.hasElement()) { + tgt.setProperty(src.getElement()); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasCode()) { + tgt.setValue(src.getCode()); + } return tgt; } @@ -199,7 +230,9 @@ public class ConceptMap14_50 { } else { tgt.addTarget(convertTargetElementComponent(t)); } - res.add(new VersionConvertor_14_50.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem())); + if (src.hasSystem()) { + res.add(new VersionConvertor_14_50.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem())); + } } return res; } @@ -216,7 +249,9 @@ public class ConceptMap14_50 { if (src.hasNoMap() && src.getNoMap() == true) { tgt.addTarget(new org.hl7.fhir.dstu2016may.model.ConceptMap.TargetElementComponent().setEquivalence(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.UNMATCHED)); } else { - for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); + } } return tgt; } @@ -230,11 +265,17 @@ public class ConceptMap14_50 { tgt.setSystem(g.getTarget()); if (src.hasCode()) tgt.setCode(src.getCode()); - tgt.setEquivalence(convertConceptMapEquivalence(src.getRelationship())); + if (src.hasRelationship()) { + tgt.setEquivalence(convertConceptMapEquivalence(src.getRelationship())); + } if (src.hasComment()) tgt.setComments(src.getComment()); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -245,11 +286,17 @@ public class ConceptMap14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(src.getCode()); - tgt.setRelationship(convertConceptMapRelationship(src.getEquivalence())); + if (src.hasEquivalence()) { + tgt.setRelationship(convertConceptMapRelationship(src.getEquivalence())); + } if (src.hasComments()) tgt.setComment(src.getComments()); - for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Conformance14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Conformance14_50.java index 2b4f4a4bf..f935bcdd8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Conformance14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Conformance14_50.java @@ -49,14 +49,18 @@ public class Conformance14_50 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_50.isJurisdiction(t)) @@ -67,16 +71,32 @@ public class Conformance14_50 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); + } if (src.hasAcceptUnknown()) tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue())); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -91,34 +111,58 @@ public class Conformance14_50 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - tgt.setKind(convertConformanceStatementKind(src.getKind())); - tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); - tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - tgt.setFhirVersion(src.getFhirVersion().toCode()); + if (src.hasKind()) { + tgt.setKind(convertConformanceStatementKind(src.getKind())); + } + if (src.hasSoftware()) { + tgt.setSoftware(convertConformanceSoftwareComponent(src.getSoftware())); + } + if (src.hasImplementation()) { + tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); + } + if (src.hasFhirVersion()) { + tgt.setFhirVersion(src.getFhirVersion().toCode()); + } if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown")) tgt.setAcceptUnknown(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue())); - for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r5.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_14_50.convertCanonicalToReference(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasRest()) { + for (CapabilityStatementRestComponent r : src.getRest()) for (CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r5.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_14_50.convertCanonicalToReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertConformanceRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertConformanceMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertConformanceDocumentComponent(t)); + } return tgt; } @@ -129,7 +173,9 @@ public class Conformance14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -140,7 +186,9 @@ public class Conformance14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -149,10 +197,14 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setProfileElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getProfile())); + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -161,10 +213,14 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceDocumentComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertDocumentMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setProfile(VersionConvertor_14_50.convertCanonicalToReference(src.getProfileElement())); + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_14_50.convertCanonicalToReference(src.getProfileElement())); + } return tgt; } @@ -173,7 +229,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasUrl()) tgt.setUrl(src.getUrl()); return tgt; @@ -184,7 +242,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceImplementationComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceImplementationComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasUrl()) tgt.setUrl(src.getUrl()); return tgt; @@ -195,7 +255,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) @@ -227,7 +289,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) @@ -260,8 +324,12 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEndpointComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_14_50.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_14_50.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -270,8 +338,12 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setProtocol(VersionConvertor_14_50.convertCoding(src.getProtocol())); - tgt.setAddress(src.getAddress()); + if (src.hasProtocol()) { + tgt.setProtocol(VersionConvertor_14_50.convertCoding(src.getProtocol())); + } + if (src.hasAddress()) { + tgt.setAddress(src.getAddress()); + } return tgt; } @@ -280,15 +352,29 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -297,15 +383,29 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMode(convertRestfulConformanceMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertRestfulConformanceMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasSecurity()) { + tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); + } + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertConformanceRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertConformanceRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r5.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -314,8 +414,12 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinition(VersionConvertor_14_50.convertCanonicalToReference(src.getDefinitionElement())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinitionElement()) { + tgt.setDefinition(VersionConvertor_14_50.convertCanonicalToReference(src.getDefinitionElement())); + } return tgt; } @@ -324,8 +428,12 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setDefinitionElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getDefinition())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasDefinition()) { + tgt.setDefinitionElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getDefinition())); + } return tgt; } @@ -335,11 +443,19 @@ public class Conformance14_50 { org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceComponent(); VersionConvertor_14_50.copyElement(src, tgt); if (src.hasType()) { - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_14_50.convertCanonicalToReference(src.getProfileElement())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); } - tgt.setProfile(VersionConvertor_14_50.convertCanonicalToReference(src.getProfileElement())); - for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); if (src.hasReadHistory()) tgt.setReadHistory(src.getReadHistory()); if (src.hasUpdateCreate()) @@ -348,10 +464,18 @@ public class Conformance14_50 { tgt.setConditionalCreate(src.getConditionalCreate()); if (src.hasConditionalUpdate()) tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -360,10 +484,18 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getProfile())); - for (org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getProfile())); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) { + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + } if (src.hasReadHistory()) tgt.setReadHistory(src.getReadHistory()); if (src.hasUpdateCreate()) @@ -372,10 +504,18 @@ public class Conformance14_50 { tgt.setConditionalCreate(src.getConditionalCreate()); if (src.hasConditionalUpdate()) tgt.setConditionalUpdate(src.getConditionalUpdate()); - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + if (src.hasConditionalDelete()) { + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertConformanceRestResourceSearchParamComponent(t)); + } return tgt; } @@ -384,10 +524,14 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestResourceSearchParamComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -398,10 +542,14 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -414,7 +562,9 @@ public class Conformance14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -427,7 +577,9 @@ public class Conformance14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -438,7 +590,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasReleaseDate()) @@ -451,7 +605,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasReleaseDate()) @@ -520,7 +676,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -531,7 +689,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -598,7 +758,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent tgt = new org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -609,7 +771,9 @@ public class Conformance14_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasCode()) { + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/DataElement14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/DataElement14_50.java index cc9c08766..ffd4872b0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/DataElement14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/DataElement14_50.java @@ -13,10 +13,14 @@ public class DataElement14_50 { VersionConvertor_14_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) @@ -25,15 +29,21 @@ public class DataElement14_50 { tgt.setDate(src.getDate()); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_50.convertCodeableConceptToUsageContext(t)); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.getSnapshot().addElement(VersionConvertor_14_50.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) if (src.hasElement()) { + tgt.getSnapshot().addElement(VersionConvertor_14_50.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + } tgt.setKind(StructureDefinitionKind.COMPLEXTYPE); tgt.setAbstract(false); tgt.setType(tgt.getName()); @@ -49,7 +59,9 @@ public class DataElement14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -60,7 +72,9 @@ public class DataElement14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -69,7 +83,9 @@ public class DataElement14_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ImplementationGuide14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ImplementationGuide14_50.java index 4541953eb..f4be63718 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ImplementationGuide14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ImplementationGuide14_50.java @@ -8,7 +8,6 @@ import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.DataType; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration; - import java.util.List; public class ImplementationGuide14_50 { @@ -18,34 +17,54 @@ public class ImplementationGuide14_50 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) for (Enumeration v : src.getFhirVersion()) { tgt.setFhirVersion(v.asStringValue()); } - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasDefinition()) { + tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); + } return tgt; } @@ -54,16 +73,24 @@ public class ImplementationGuide14_50 { return null; org.hl7.fhir.r5.model.ImplementationGuide tgt = new org.hl7.fhir.r5.model.ImplementationGuide(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) tgt.addContact(convertImplementationGuideContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -76,10 +103,18 @@ public class ImplementationGuide14_50 { tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) tgt.addFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); + if (src.hasDependency()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasPage()) { + tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); + } return tgt; } @@ -90,7 +125,9 @@ public class ImplementationGuide14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -101,7 +138,9 @@ public class ImplementationGuide14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -110,7 +149,9 @@ public class ImplementationGuide14_50 { return null; org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } if (org.hl7.fhir.dstu2016may.utils.ToolingExtensions.hasExtension(src, VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION)) { tgt.setPackageId(org.hl7.fhir.dstu2016may.utils.ToolingExtensions.readStringExtension(src, VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION)); } @@ -126,7 +167,9 @@ public class ImplementationGuide14_50 { org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideDependencyComponent(); VersionConvertor_14_50.copyElement(src, tgt); tgt.setType(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.REFERENCE); - tgt.setUri(src.getUri()); + if (src.hasUri()) { + tgt.setUri(src.getUri()); + } if (src.hasPackageId()) tgt.addExtension(new org.hl7.fhir.dstu2016may.model.Extension(VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION, new org.hl7.fhir.dstu2016may.model.IdType(src.getPackageId()))); if (src.hasVersion()) @@ -140,9 +183,13 @@ public class ImplementationGuide14_50 { org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_14_50.copyElement(src, tgt); if (tgt.hasType()) { - tgt.setType(src.getType()); + if (src.hasType()) { + tgt.setType(src.getType()); + } + } + if (src.hasProfileElement()) { + tgt.setProfile(VersionConvertor_14_50.convertCanonicalToReference(src.getProfileElement())); } - tgt.setProfile(VersionConvertor_14_50.convertCanonicalToReference(src.getProfileElement())); return tgt; } @@ -151,8 +198,12 @@ public class ImplementationGuide14_50 { return null; org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setType(src.getType()); - tgt.setProfileElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getProfile())); + if (src.hasType()) { + tgt.setType(src.getType()); + } + if (src.hasProfile()) { + tgt.setProfileElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getProfile())); + } return tgt; } @@ -161,8 +212,12 @@ public class ImplementationGuide14_50 { return null; org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setId(src.getId()); - tgt.setName(src.getName()); + if (src.hasId()) { + tgt.setId(src.getId()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -192,7 +247,9 @@ public class ImplementationGuide14_50 { org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); VersionConvertor_14_50.copyElement(src, tgt); if (src.hasExampleCanonicalType()) { - tgt.setExampleFor(VersionConvertor_14_50.convertCanonicalToReference(src.getExampleCanonicalType())); + if (src.hasExampleCanonicalType()) { + tgt.setExampleFor(VersionConvertor_14_50.convertCanonicalToReference(src.getExampleCanonicalType())); + } tgt.setExample(true); } else if (src.hasExampleBooleanType()) tgt.setExample(src.getExampleBooleanType().getValue()); @@ -235,10 +292,14 @@ public class ImplementationGuide14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasNameUrlType()) tgt.setSource(src.getNameUrlType().getValue()); - tgt.setName(src.getTitle()); + if (src.hasTitle()) { + tgt.setName(src.getTitle()); + } if (src.hasGeneration()) tgt.setKind(convertPageGeneration(src.getGeneration())); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -249,10 +310,14 @@ public class ImplementationGuide14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasSource()) tgt.setName(convertUriToUrl(src.getSourceElement())); - tgt.setTitle(src.getName()); + if (src.hasName()) { + tgt.setTitle(src.getName()); + } if (src.hasKind()) tgt.setGeneration(convertPageGeneration(src.getKind())); - for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/NamingSystem14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/NamingSystem14_50.java index ddea442c6..409ff8e5e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/NamingSystem14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/NamingSystem14_50.java @@ -10,16 +10,28 @@ public class NamingSystem14_50 { return null; org.hl7.fhir.r5.model.NamingSystem tgt = new org.hl7.fhir.r5.model.NamingSystem(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); - tgt.setDate(src.getDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } + if (src.hasDate()) { + tgt.setDate(src.getDate()); + } if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemContactComponent t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_14_50.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_50.convertCodeableConcept(src.getType())); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_50.isJurisdiction(t)) @@ -28,7 +40,9 @@ public class NamingSystem14_50 { tgt.addUseContext(VersionConvertor_14_50.convertCodeableConceptToUsageContext(t)); if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -37,24 +51,40 @@ public class NamingSystem14_50 { return null; org.hl7.fhir.dstu2016may.model.NamingSystem tgt = new org.hl7.fhir.dstu2016may.model.NamingSystem(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertNamingSystemType(src.getKind())); - tgt.setDate(src.getDate()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertNamingSystemType(src.getKind())); + } + if (src.hasDate()) { + tgt.setDate(src.getDate()); + } if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertNamingSystemContactComponent(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); - tgt.setType(VersionConvertor_14_50.convertCodeableConcept(src.getType())); + if (src.hasType()) { + tgt.setType(VersionConvertor_14_50.convertCodeableConcept(src.getType())); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -65,7 +95,9 @@ public class NamingSystem14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -76,7 +108,9 @@ public class NamingSystem14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -149,11 +183,17 @@ public class NamingSystem14_50 { return null; org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } if (src.hasPreferred()) tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_14_50.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_14_50.convertPeriod(src.getPeriod())); + } return tgt; } @@ -162,11 +202,17 @@ public class NamingSystem14_50 { return null; org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - tgt.setValue(src.getValue()); + if (src.hasType()) { + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } if (src.hasPreferred()) tgt.setPreferred(src.getPreferred()); - tgt.setPeriod(VersionConvertor_14_50.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_14_50.convertPeriod(src.getPeriod())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationDefinition14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationDefinition14_50.java index 8dee82f2b..8e6edacec 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationDefinition14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationDefinition14_50.java @@ -18,34 +18,56 @@ public class OperationDefinition14_50 { tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasAffectsState()) tgt.setIdempotent(!src.getAffectsState()); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasComment()) tgt.setComment(src.getComment()); - tgt.setBase(VersionConvertor_14_50.convertCanonicalToReference(src.getBaseElement())); - tgt.setSystem(src.getSystem()); + if (src.hasBaseElement()) { + tgt.setBase(VersionConvertor_14_50.convertCanonicalToReference(src.getBaseElement())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.getType()) - for (CodeType t : src.getResource()) tgt.addType(t.getValue()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasResource()) { + for (CodeType t : src.getResource()) tgt.addType(t.getValue()); + } + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -58,16 +80,24 @@ public class OperationDefinition14_50 { tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); - tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasKind()) { + tgt.setKind(convertOperationKind(src.getKind())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionContactComponent t : src.getContact()) tgt.addContact(convertOperationDefinitionContactComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_50.isJurisdiction(t)) @@ -78,15 +108,27 @@ public class OperationDefinition14_50 { tgt.setPurpose(src.getRequirements()); if (src.hasIdempotent()) tgt.setAffectsState(!src.getIdempotent()); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasComment()) tgt.setComment(src.getComment()); - tgt.setBaseElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getBase())); - tgt.setSystem(src.getSystem()); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + if (src.hasBase()) { + tgt.setBaseElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getBase())); + } + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getType()) tgt.addResource(t.getValue()); + } tgt.setType(tgt.hasResource()); - tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + if (src.hasInstance()) { + tgt.setInstance(src.getInstance()); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -97,7 +139,9 @@ public class OperationDefinition14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -108,7 +152,9 @@ public class OperationDefinition14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -150,19 +196,37 @@ public class OperationDefinition14_50 { return null; org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); if (src.hasType()) { - tgt.setType(src.getType().toCode()); + if (src.hasType()) { + tgt.setType(src.getType().toCode()); + } + } + if (src.hasSearchType()) { + tgt.setSearchType(VersionConvertor_14_50.convertSearchParamType(src.getSearchType())); + } + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r5.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu2016may.model.Reference(t.getValue())); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); } - tgt.setSearchType(VersionConvertor_14_50.convertSearchParamType(src.getSearchType())); - for (org.hl7.fhir.r5.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu2016may.model.Reference(t.getValue())); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); return tgt; } @@ -171,18 +235,34 @@ public class OperationDefinition14_50 { return null; org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setUse(convertOperationParameterUse(src.getUse())); - tgt.setMin(src.getMin()); - tgt.setMax(src.getMax()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasUse()) { + tgt.setUse(convertOperationParameterUse(src.getUse())); + } + if (src.hasMin()) { + tgt.setMin(src.getMin()); + } + if (src.hasMax()) { + tgt.setMax(src.getMax()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); if (src.hasType()) tgt.setType(Enumerations.FHIRAllTypes.fromCode(src.getType())); - tgt.setSearchType(VersionConvertor_14_50.convertSearchParamType(src.getSearchType())); - tgt.addTargetProfile(src.getProfile().getReference()); - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasSearchType()) { + tgt.setSearchType(VersionConvertor_14_50.convertSearchParamType(src.getSearchType())); + } + if (src.hasProfile()) { + tgt.addTargetProfile(src.getProfile().getReference()); + } + if (src.hasBinding()) { + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationOutcome14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationOutcome14_50.java index d9e82bb8c..0c6a49f6e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationOutcome14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/OperationOutcome14_50.java @@ -178,7 +178,9 @@ public class OperationOutcome14_50 { return null; org.hl7.fhir.dstu2016may.model.OperationOutcome tgt = new org.hl7.fhir.dstu2016may.model.OperationOutcome(); VersionConvertor_14_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome14_50 { return null; org.hl7.fhir.r5.model.OperationOutcome tgt = new org.hl7.fhir.r5.model.OperationOutcome(); VersionConvertor_14_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -196,13 +200,23 @@ public class OperationOutcome14_50 { return null; org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_14_50.convertCodeableConcept(src.getDetails())); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_14_50.convertCodeableConcept(src.getDetails())); + } if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.r5.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_50.convertTo2016MayExpression(t.getValue())); + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.r5.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_50.convertTo2016MayExpression(t.getValue())); + } return tgt; } @@ -211,13 +225,23 @@ public class OperationOutcome14_50 { return null; org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - tgt.setCode(convertIssueType(src.getCode())); - tgt.setDetails(VersionConvertor_14_50.convertCodeableConcept(src.getDetails())); + if (src.hasSeverity()) { + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + } + if (src.hasCode()) { + tgt.setCode(convertIssueType(src.getCode())); + } + if (src.hasDetails()) { + tgt.setDetails(VersionConvertor_14_50.convertCodeableConcept(src.getDetails())); + } if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_50.convertToR4Expression(t.getValue())); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getExpression()) tgt.addExpression(VersionConvertor_14_50.convertToR4Expression(t.getValue())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Parameters14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Parameters14_50.java index 057542b21..07b4304ea 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Parameters14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Parameters14_50.java @@ -10,7 +10,9 @@ public class Parameters14_50 { return null; org.hl7.fhir.dstu2016may.model.Parameters tgt = new org.hl7.fhir.dstu2016may.model.Parameters(); VersionConvertor_14_50.copyResource(src, tgt); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters14_50 { return null; org.hl7.fhir.r5.model.Parameters tgt = new org.hl7.fhir.r5.model.Parameters(); VersionConvertor_14_50.copyResource(src, tgt); - for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -28,10 +32,18 @@ public class Parameters14_50 { return null; org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); - tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); - for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -40,10 +52,18 @@ public class Parameters14_50 { return null; org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.Parameters.ParametersParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); - tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } + if (src.hasResource()) { + tgt.setResource(VersionConvertor_14_50.convertResource(src.getResource())); + } + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Questionnaire14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Questionnaire14_50.java index 4b8440d5f..fdc628846 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Questionnaire14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/Questionnaire14_50.java @@ -16,24 +16,36 @@ public class Questionnaire14_50 { VersionConvertor_14_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addContact(convertQuestionnaireContactComponent(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addContact(convertQuestionnaireContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_50.convertCodeableConceptToUsageContext(t)); if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_50.convertCoding(t)); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_50.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -44,22 +56,38 @@ public class Questionnaire14_50 { VersionConvertor_14_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r5.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t1)); - for (UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasContact()) { + for (ContactDetail t : src.getContact()) for (org.hl7.fhir.r5.model.ContactPoint t1 : t.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t1)); + } + if (src.hasUseContext()) { + for (UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_50.convertCoding(t)); - for (CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_50.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -79,13 +107,19 @@ public class Questionnaire14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_50.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addConcept(VersionConvertor_14_50.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasEnableWhen()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -94,11 +128,17 @@ public class Questionnaire14_50 { tgt.setReadOnly(src.getReadOnly()); if (src.hasMaxLength()) tgt.setMaxLength(src.getMaxLength()); - tgt.setOptions(VersionConvertor_14_50.convertCanonicalToReference(src.getAnswerValueSetElement())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + if (src.hasAnswerValueSetElement()) { + tgt.setOptions(VersionConvertor_14_50.convertCanonicalToReference(src.getAnswerValueSetElement())); + } + if (src.hasAnswerOption()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + } if (src.hasInitial()) tgt.setInitial(VersionConvertor_14_50.convertType(src.getInitialFirstRep().getValue())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -109,13 +149,19 @@ public class Questionnaire14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasLinkId()) tgt.setLinkId(src.getLinkId()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_50.convertCoding(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(VersionConvertor_14_50.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasType()) { + tgt.setType(convertQuestionnaireItemType(src.getType())); + } + if (src.hasEnableWhen()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -124,10 +170,18 @@ public class Questionnaire14_50 { tgt.setReadOnly(src.getReadOnly()); if (src.hasMaxLength()) tgt.setMaxLength(src.getMaxLength()); - tgt.setAnswerValueSetElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getOptions())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); - tgt.addInitial().setValue(VersionConvertor_14_50.convertType(src.getInitial())); - for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasOptions()) { + tgt.setAnswerValueSetElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getOptions())); + } + if (src.hasOption()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); + } + if (src.hasInitial()) { + tgt.addInitial().setValue(VersionConvertor_14_50.convertType(src.getInitial())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -136,12 +190,18 @@ public class Questionnaire14_50 { return null; org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setQuestion(src.getQuestion()); + if (src.hasQuestion()) { + tgt.setQuestion(src.getQuestion()); + } if (src.hasAnswered()) { tgt.setOperator(QuestionnaireItemOperator.EXISTS); - tgt.setAnswer(VersionConvertor_14_50.convertType(src.getAnsweredElement())); + if (src.hasAnsweredElement()) { + tgt.setAnswer(VersionConvertor_14_50.convertType(src.getAnsweredElement())); + } + } + if (src.hasAnswer()) { + tgt.setAnswer(VersionConvertor_14_50.convertType(src.getAnswer())); } - tgt.setAnswer(VersionConvertor_14_50.convertType(src.getAnswer())); return tgt; } @@ -150,7 +210,9 @@ public class Questionnaire14_50 { return null; org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setQuestion(src.getQuestion()); + if (src.hasQuestion()) { + tgt.setQuestion(src.getQuestion()); + } if (src.hasOperator() && src.getOperator() == QuestionnaireItemOperator.EXISTS) tgt.setAnswered(src.getAnswerBooleanType().getValue()); else @@ -163,7 +225,9 @@ public class Questionnaire14_50 { return null; org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } @@ -172,7 +236,9 @@ public class Questionnaire14_50 { return null; org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/QuestionnaireResponse14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/QuestionnaireResponse14_50.java index 49e0cb724..f5aa04527 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/QuestionnaireResponse14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/QuestionnaireResponse14_50.java @@ -10,16 +10,32 @@ public class QuestionnaireResponse14_50 { return null; org.hl7.fhir.dstu2016may.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaire(VersionConvertor_14_50.convertCanonicalToReference(src.getQuestionnaireElement())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_14_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_14_50.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_14_50.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaireElement()) { + tgt.setQuestionnaire(VersionConvertor_14_50.convertCanonicalToReference(src.getQuestionnaireElement())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_14_50.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_14_50.convertReference(src.getAuthor())); + } if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_14_50.convertReference(src.getSource())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_50.convertReference(src.getSource())); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -28,16 +44,32 @@ public class QuestionnaireResponse14_50 { return null; org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(src.getIdentifier())); - tgt.setQuestionnaireElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getQuestionnaire())); - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - tgt.setSubject(VersionConvertor_14_50.convertReference(src.getSubject())); - tgt.setEncounter(VersionConvertor_14_50.convertReference(src.getEncounter())); - tgt.setAuthor(VersionConvertor_14_50.convertReference(src.getAuthor())); + if (src.hasIdentifier()) { + tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(src.getIdentifier())); + } + if (src.hasQuestionnaire()) { + tgt.setQuestionnaireElement(VersionConvertor_14_50.convertReferenceToCanonical(src.getQuestionnaire())); + } + if (src.hasStatus()) { + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + } + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_14_50.convertReference(src.getSubject())); + } + if (src.hasEncounter()) { + tgt.setEncounter(VersionConvertor_14_50.convertReference(src.getEncounter())); + } + if (src.hasAuthor()) { + tgt.setAuthor(VersionConvertor_14_50.convertReference(src.getAuthor())); + } if (src.hasAuthored()) tgt.setAuthored(src.getAuthored()); - tgt.setSource(VersionConvertor_14_50.convertReference(src.getSource())); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasSource()) { + tgt.setSource(VersionConvertor_14_50.convertReference(src.getSource())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -46,8 +78,12 @@ public class QuestionnaireResponse14_50 { return null; org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -56,8 +92,12 @@ public class QuestionnaireResponse14_50 { return null; org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -70,8 +110,12 @@ public class QuestionnaireResponse14_50 { tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -84,8 +128,12 @@ public class QuestionnaireResponse14_50 { tgt.setLinkId(src.getLinkId()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/SearchParameter14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/SearchParameter14_50.java index b72cc0c9f..ffedb2d22 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/SearchParameter14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/SearchParameter14_50.java @@ -11,31 +11,53 @@ public class SearchParameter14_50 { return null; org.hl7.fhir.dstu2016may.model.SearchParameter tgt = new org.hl7.fhir.dstu2016may.model.SearchParameter(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); - tgt.setCode(src.getCode()); - for (CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); - tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + for (CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasExpression()) tgt.setExpression(VersionConvertor_14_50.convertTo2016MayExpression(src.getExpression())); if (src.hasXpath()) tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -44,32 +66,52 @@ public class SearchParameter14_50 { return null; org.hl7.fhir.r5.model.SearchParameter tgt = new org.hl7.fhir.r5.model.SearchParameter(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterContactComponent t : src.getContact()) tgt.addContact(convertSearchParameterContactComponent(t)); + } for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_14_50.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_14_50.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_14_50.convertCodeableConceptToUsageContext(t)); if (src.hasRequirements()) tgt.setPurpose(src.getRequirements()); - tgt.setCode(src.getCode()); - tgt.addBase(src.getBase()); - tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); - tgt.setDescription(src.getDescription()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } + if (src.hasBase()) { + tgt.addBase(src.getBase()); + } + if (src.hasType()) { + tgt.setType(VersionConvertor_14_50.convertSearchParamType(src.getType())); + } + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } if (src.hasExpression()) tgt.setExpression(VersionConvertor_14_50.convertToR4Expression(src.getExpression())); if (src.hasXpath()) tgt.setXpath(src.getXpath()); - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + if (src.hasXpathUsage()) { + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } return tgt; } @@ -80,7 +122,9 @@ public class SearchParameter14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -91,7 +135,9 @@ public class SearchParameter14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureDefinition14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureDefinition14_50.java index ec79b04e1..6f2cc246a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureDefinition14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureDefinition14_50.java @@ -50,35 +50,53 @@ public class StructureDefinition14_50 { VersionConvertor_14_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasTitle()) tgt.setDisplay(src.getTitle()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_14_50.convertCoding(t)); + if (src.hasKeyword()) { + for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addCode(VersionConvertor_14_50.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); - for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - tgt.setAbstract(src.getAbstract()); + if (src.hasMapping()) { + for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) { if (!tgt.hasContextType()) tgt.setContextType(convertExtensionContext(t.getType(), t.getExpression())); @@ -88,10 +106,14 @@ public class StructureDefinition14_50 { tgt.setBaseDefinition(src.getBaseDefinition()); if (src.hasType() && src.getDerivation() == org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT) tgt.setBaseType(src.getType()); - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasDerivation()) { + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + } if (src.hasSnapshot()) tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } return tgt; } @@ -102,18 +124,26 @@ public class StructureDefinition14_50 { VersionConvertor_14_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasDisplay()) tgt.setTitle(src.getDisplay()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) tgt.addContact(convertStructureDefinitionContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -126,15 +156,25 @@ public class StructureDefinition14_50 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_14_50.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCode()) tgt.addKeyword(VersionConvertor_14_50.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - tgt.setKind(convertStructureDefinitionKind(src.getKind(), src.getName())); - tgt.setAbstract(src.getAbstract()); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) { + tgt.setKind(convertStructureDefinitionKind(src.getKind(), src.getName())); + } + if (src.hasAbstract()) { + tgt.setAbstract(src.getAbstract()); + } for (org.hl7.fhir.dstu2016may.model.StringType t : src.getContext()) { org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent ec = tgt.addContext(); - ec.setType(convertExtensionContext(src.getContextType())); + if (src.hasContextType()) { + ec.setType(convertExtensionContext(src.getContextType())); + } ec.setExpression("*".equals(t.getValue()) ? "Element" : t.getValue()); } if (src.getDerivation() == org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT) @@ -143,13 +183,19 @@ public class StructureDefinition14_50 { tgt.setType(src.getId()); if (src.hasBaseDefinition()) tgt.setBaseDefinition(src.getBaseDefinition()); - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasDerivation()) { + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + } if (src.hasSnapshot()) { - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + if (src.hasSnapshot()) { + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + } tgt.getSnapshot().getElementFirstRep().getType().clear(); } if (src.hasDifferential()) { - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + if (src.hasDifferential()) { + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + } tgt.getDifferential().getElementFirstRep().getType().clear(); } if (tgt.getDerivation() == TypeDerivationRule.SPECIALIZATION) { @@ -169,7 +215,9 @@ public class StructureDefinition14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -180,7 +228,9 @@ public class StructureDefinition14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -189,7 +239,9 @@ public class StructureDefinition14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t)); + } return tgt; } @@ -198,7 +250,11 @@ public class StructureDefinition14_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) if (src.hasElement()) { + tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + } + } return tgt; } @@ -242,7 +298,9 @@ public class StructureDefinition14_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) @@ -257,7 +315,9 @@ public class StructureDefinition14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setIdentity(src.getIdentity()); + if (src.hasIdentity()) { + tgt.setIdentity(src.getIdentity()); + } if (src.hasUri()) tgt.setUri(src.getUri()); if (src.hasName()) @@ -272,7 +332,11 @@ public class StructureDefinition14_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + if (src.hasElement()) { + for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) if (src.hasElement()) { + tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t, src.getElement(), src.getElement().indexOf(t))); + } + } return tgt; } @@ -281,7 +345,9 @@ public class StructureDefinition14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_14_50.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureMap14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureMap14_50.java index 8b9487f64..d62e1dd2c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureMap14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/StructureMap14_50.java @@ -14,17 +14,27 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap tgt = new org.hl7.fhir.r5.model.StructureMap(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); - for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContactComponent t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContactComponent t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -37,9 +47,15 @@ public class StructureMap14_50 { tgt.setPurpose(src.getRequirements()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -48,31 +64,49 @@ public class StructureMap14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureMap tgt = new org.hl7.fhir.dstu2016may.model.StructureMap(); VersionConvertor_14_50.copyDomainResource(src, tgt); - tgt.setUrl(src.getUrl()); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.r5.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -83,7 +117,9 @@ public class StructureMap14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -94,7 +130,9 @@ public class StructureMap14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -129,14 +167,20 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasExtends()) tgt.setExtends(src.getExtends()); tgt.setTypeMode(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NONE); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -145,15 +189,21 @@ public class StructureMap14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasExtends()) tgt.setExtends(src.getExtends()); if (!src.getTypeMode().equals(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NONE)) throw new FHIRException("Unable to downgrade structure map with group.typeMode other than 'None': " + src.getTypeMode().getDisplay()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -162,10 +212,14 @@ public class StructureMap14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupInputComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasType()) tgt.setType(src.getType()); - tgt.setMode(convertStructureMapInputMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertStructureMapInputMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -176,10 +230,14 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); + if (src.hasName()) { + tgt.setName(src.getName()); + } if (src.hasType()) tgt.setType(src.getType()); - tgt.setMode(convertStructureMapInputMode(src.getMode())); + if (src.hasMode()) { + tgt.setMode(convertStructureMapInputMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -190,11 +248,21 @@ public class StructureMap14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSource()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -205,11 +273,21 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasSource()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -220,8 +298,12 @@ public class StructureMap14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleDependentComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + } return tgt; } @@ -230,8 +312,12 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu2016may.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue()); + } return tgt; } @@ -241,7 +327,9 @@ public class StructureMap14_50 { org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleSourceComponent(); VersionConvertor_14_50.copyElement(src, tgt); tgt.setContextType(StructureMapContextType.TYPE); - tgt.setContext(src.getContext()); + if (src.hasContext()) { + tgt.setContext(src.getContext()); + } if (src.hasElement()) tgt.setElement(src.getElement()); if (src.hasListMode()) @@ -260,7 +348,9 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setMin(src.getRequired() ? 1 : 0); + if (src.hasRequired()) { + tgt.setMin(src.getRequired() ? 1 : 0); + } if (src.getContextType().equals(StructureMap.StructureMapContextType.TYPE)) tgt.setType(src.getContext()); if (src.hasElement()) @@ -289,12 +379,16 @@ public class StructureMap14_50 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (Enumeration t : src.getListMode()) tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + if (src.hasListMode()) { + for (Enumeration t : src.getListMode()) tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } @@ -311,12 +405,16 @@ public class StructureMap14_50 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getListMode()) VersionConvertor_14_50.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + if (src.hasListMode()) { + for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getListMode()) VersionConvertor_14_50.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } @@ -325,7 +423,9 @@ public class StructureMap14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } @@ -334,7 +434,9 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } @@ -395,8 +497,12 @@ public class StructureMap14_50 { return null; org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setMode(convertStructureMapStructureMode(src.getMode())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasMode()) { + tgt.setMode(convertStructureMapStructureMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -407,8 +513,12 @@ public class StructureMap14_50 { return null; org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setUrl(src.getUrl()); - tgt.setMode(convertStructureMapStructureMode(src.getMode())); + if (src.hasUrl()) { + tgt.setUrl(src.getUrl()); + } + if (src.hasMode()) { + tgt.setMode(convertStructureMapStructureMode(src.getMode())); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ValueSet14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ValueSet14_50.java index 106c4b7d4..63cc558d1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ValueSet14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/ValueSet14_50.java @@ -11,10 +11,14 @@ public class ValueSet14_50 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -23,10 +27,14 @@ public class ValueSet14_50 { return null; org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setCode(src.getCode()); + if (src.hasCode()) { + tgt.setCode(src.getCode()); + } if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -37,8 +45,12 @@ public class ValueSet14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -49,8 +61,12 @@ public class ValueSet14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); - tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); - tgt.setValue(src.getValue()); + if (src.hasUse()) { + tgt.setUse(VersionConvertor_14_50.convertCoding(src.getUse())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -59,11 +75,17 @@ public class ValueSet14_50 { return null; org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -72,11 +94,17 @@ public class ValueSet14_50 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setSystem(src.getSystem()); + if (src.hasSystem()) { + tgt.setSystem(src.getSystem()); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } return tgt; } @@ -85,9 +113,15 @@ public class ValueSet14_50 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -96,9 +130,15 @@ public class ValueSet14_50 { return null; org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setProperty(src.getProperty()); - tgt.setOp(convertFilterOperator(src.getOp())); - tgt.setValue(src.getValue()); + if (src.hasProperty()) { + tgt.setProperty(src.getProperty()); + } + if (src.hasOp()) { + tgt.setOp(convertFilterOperator(src.getOp())); + } + if (src.hasValue()) { + tgt.setValue(src.getValue()); + } return tgt; } @@ -157,12 +197,16 @@ public class ValueSet14_50 { tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetContactComponent t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) @@ -179,10 +223,14 @@ public class ValueSet14_50 { tgt.setCopyright(src.getCopyright()); if (src.hasExtensible()) tgt.addExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible", new BooleanType(src.getExtensible())); - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } if (src.hasLockedDate()) tgt.getCompose().setLockedDate(src.getLockedDate()); - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + if (src.hasExpansion()) { + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + } return tgt; } @@ -193,17 +241,23 @@ public class ValueSet14_50 { VersionConvertor_14_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.setIdentifier(VersionConvertor_14_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) tgt.setName(src.getName()); - tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(VersionConvertor_14_50.convertConformanceResourceStatus(src.getStatus())); + } if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.getCompose().hasLockedDate()) @@ -212,7 +266,9 @@ public class ValueSet14_50 { tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t.getValueCodeableConcept())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(VersionConvertor_14_50.convertCodeableConcept(t)); + } if (src.hasImmutable()) tgt.setImmutable(src.getImmutable()); if (src.hasPurpose()) @@ -221,7 +277,9 @@ public class ValueSet14_50 { tgt.setCopyright(src.getCopyright()); if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible")) tgt.setExtensible(((BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/valueset-extensible").getValue()).booleanValue()); - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasCompose()) { + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + } if (src.hasExpansion()) tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); return tgt; @@ -232,9 +290,15 @@ public class ValueSet14_50 { return null; org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent(); VersionConvertor_14_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasImport()) { + for (org.hl7.fhir.dstu2016may.model.UriType t : src.getImport()) tgt.addInclude().addValueSet(t.getValue()); + } + if (src.hasInclude()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -247,7 +311,9 @@ public class ValueSet14_50 { for (org.hl7.fhir.r5.model.UriType ti : t.getValueSet()) tgt.addImport(ti.getValue()); tgt.addInclude(convertConceptSetComponent(t)); } - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasExclude()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -258,7 +324,9 @@ public class ValueSet14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -269,7 +337,9 @@ public class ValueSet14_50 { VersionConvertor_14_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_14_50.convertContactPoint(t)); + } return tgt; } @@ -278,14 +348,22 @@ public class ValueSet14_50 { return null; org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -294,14 +372,22 @@ public class ValueSet14_50 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setIdentifier(src.getIdentifier()); - tgt.setTimestamp(src.getTimestamp()); + if (src.hasIdentifier()) { + tgt.setIdentifier(src.getIdentifier()); + } + if (src.hasTimestamp()) { + tgt.setTimestamp(src.getTimestamp()); + } if (src.hasTotal()) tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -320,7 +406,9 @@ public class ValueSet14_50 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasContains()) { + for (org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -339,7 +427,9 @@ public class ValueSet14_50 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -348,8 +438,12 @@ public class ValueSet14_50 { return null; org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } @@ -358,8 +452,12 @@ public class ValueSet14_50 { return null; org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent(); VersionConvertor_14_50.copyElement(src, tgt); - tgt.setName(src.getName()); - tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + if (src.hasName()) { + tgt.setName(src.getName()); + } + if (src.hasValue()) { + tgt.setValue(VersionConvertor_14_50.convertType(src.getValue())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ActivityDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ActivityDefinition30_40.java index 933d43d5b..bd5c1297c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ActivityDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ActivityDefinition30_40.java @@ -14,7 +14,9 @@ public class ActivityDefinition30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -41,9 +43,15 @@ public class ActivityDefinition30_40 { tgt.setLastReviewDateElement(VersionConvertor_30_40.convertDate(src.getLastReviewDateElement())); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_40.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + } for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) { org.hl7.fhir.dstu3.model.Contributor c = new org.hl7.fhir.dstu3.model.Contributor(); c.setType(ContributorType.AUTHOR); @@ -68,11 +76,17 @@ public class ActivityDefinition30_40 { c.addContact(VersionConvertor_30_40.convertContactDetail(t)); tgt.addContributor(c); } - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_40.convertCanonicalToReference(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_40.convertCanonicalToReference(t)); + } if (src.hasKind()) tgt.setKind(convertActivityDefinitionKind(src.getKind())); if (src.hasCode()) @@ -81,16 +95,24 @@ public class ActivityDefinition30_40 { tgt.setTiming(VersionConvertor_30_40.convertType(src.getTiming())); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + } if (src.hasProduct()) tgt.setProduct(VersionConvertor_30_40.convertType(src.getProduct())); if (src.hasQuantity()) tgt.setQuantity(VersionConvertor_30_40.convertSimpleQuantity(src.getQuantity())); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasDosage()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasTransform()) tgt.setTransform(VersionConvertor_30_40.convertCanonicalToReference(src.getTransformElement())); - for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + } return tgt; } @@ -101,7 +123,9 @@ public class ActivityDefinition30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -128,9 +152,15 @@ public class ActivityDefinition30_40 { tgt.setLastReviewDateElement(VersionConvertor_30_40.convertDate(src.getLastReviewDateElement())); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_40.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + } for (org.hl7.fhir.dstu3.model.Contributor t : src.getContributor()) { if (t.getType() == ContributorType.AUTHOR) for (ContactDetail c : t.getContact()) tgt.addAuthor(VersionConvertor_30_40.convertContactDetail(c)); @@ -141,11 +171,17 @@ public class ActivityDefinition30_40 { if (t.getType() == ContributorType.ENDORSER) for (ContactDetail c : t.getContact()) tgt.addEndorser(VersionConvertor_30_40.convertContactDetail(c)); } - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); + } if (src.hasKind()) tgt.setKind(convertActivityDefinitionKind(src.getKind())); if (src.hasCode()) @@ -154,16 +190,24 @@ public class ActivityDefinition30_40 { tgt.setTiming(VersionConvertor_30_40.convertType(src.getTiming())); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + } if (src.hasProduct()) tgt.setProduct(VersionConvertor_30_40.convertType(src.getProduct())); if (src.hasQuantity()) tgt.setQuantity(VersionConvertor_30_40.convertSimpleQuantity(src.getQuantity())); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasDosage()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasTransform()) tgt.setTransformElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getTransform())); - for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AllergyIntolerance30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AllergyIntolerance30_40.java index d9ed8ac8b..e69834e77 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AllergyIntolerance30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AllergyIntolerance30_40.java @@ -10,14 +10,18 @@ public class AllergyIntolerance30_40 { return null; org.hl7.fhir.dstu3.model.AllergyIntolerance tgt = new org.hl7.fhir.dstu3.model.AllergyIntolerance(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertAllergyIntoleranceClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertAllergyIntoleranceVerificationStatus(src.getVerificationStatus())); if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getCategory()) VersionConvertor_30_40.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getCategory()) VersionConvertor_30_40.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + } if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -34,8 +38,12 @@ public class AllergyIntolerance30_40 { tgt.setAsserter(VersionConvertor_30_40.convertReference(src.getAsserter())); if (src.hasLastOccurrence()) tgt.setLastOccurrenceElement(VersionConvertor_30_40.convertDateTime(src.getLastOccurrenceElement())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasReaction()) { + for (org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + } return tgt; } @@ -44,14 +52,18 @@ public class AllergyIntolerance30_40 { return null; org.hl7.fhir.r4.model.AllergyIntolerance tgt = new org.hl7.fhir.r4.model.AllergyIntolerance(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertAllergyIntoleranceClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertAllergyIntoleranceVerificationStatus(src.getVerificationStatus())); if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getCategory()) VersionConvertor_30_40.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getCategory()) VersionConvertor_30_40.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + } if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -68,8 +80,12 @@ public class AllergyIntolerance30_40 { tgt.setAsserter(VersionConvertor_30_40.convertReference(src.getAsserter())); if (src.hasLastOccurrence()) tgt.setLastOccurrenceElement(VersionConvertor_30_40.convertDateTime(src.getLastOccurrenceElement())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasReaction()) { + for (org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + } return tgt; } @@ -171,7 +187,9 @@ public class AllergyIntolerance30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasSubstance()) tgt.setSubstance(VersionConvertor_30_40.convertCodeableConcept(src.getSubstance())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasManifestation()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasOnset()) @@ -180,7 +198,9 @@ public class AllergyIntolerance30_40 { tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); if (src.hasExposureRoute()) tgt.setExposureRoute(VersionConvertor_30_40.convertCodeableConcept(src.getExposureRoute())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -191,7 +211,9 @@ public class AllergyIntolerance30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasSubstance()) tgt.setSubstance(VersionConvertor_30_40.convertCodeableConcept(src.getSubstance())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasManifestation()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasOnset()) @@ -200,7 +222,9 @@ public class AllergyIntolerance30_40 { tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); if (src.hasExposureRoute()) tgt.setExposureRoute(VersionConvertor_30_40.convertCodeableConcept(src.getExposureRoute())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Appointment30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Appointment30_40.java index a840375d4..5c9cf3176 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Appointment30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Appointment30_40.java @@ -10,36 +10,56 @@ public class Appointment30_40 { return null; org.hl7.fhir.r4.model.Appointment tgt = new org.hl7.fhir.r4.model.Appointment(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertAppointmentStatus(src.getStatus())); if (src.hasServiceCategory()) tgt.addServiceCategory(VersionConvertor_30_40.convertCodeableConcept(src.getServiceCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_40.convertCodeableConcept(src.getAppointmentType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getIndication()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasIndication()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getIndication()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } if (src.hasPriority()) tgt.setPriority(src.getPriority()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStart()) tgt.setStartElement(VersionConvertor_30_40.convertInstant(src.getStartElement())); if (src.hasEnd()) tgt.setEnd(src.getEnd()); if (src.hasMinutesDuration()) tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_40.convertReference(t)); + if (src.hasSlot()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_40.convertReference(t)); + } if (src.hasCreated()) tgt.setCreatedElement(VersionConvertor_30_40.convertDateTime(src.getCreatedElement())); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); - for (org.hl7.fhir.dstu3.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_40.convertPeriod(t)); + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } + if (src.hasRequestedPeriod()) { + for (org.hl7.fhir.dstu3.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_40.convertPeriod(t)); + } return tgt; } @@ -48,36 +68,56 @@ public class Appointment30_40 { return null; org.hl7.fhir.dstu3.model.Appointment tgt = new org.hl7.fhir.dstu3.model.Appointment(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertAppointmentStatus(src.getStatus())); if (src.hasServiceCategory()) tgt.setServiceCategory(VersionConvertor_30_40.convertCodeableConcept(src.getServiceCategoryFirstRep())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_40.convertCodeableConcept(src.getAppointmentType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addIndication(VersionConvertor_30_40.convertReference(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addIndication(VersionConvertor_30_40.convertReference(t)); + } if (src.hasPriority()) tgt.setPriority(src.getPriority()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStart()) tgt.setStartElement(VersionConvertor_30_40.convertInstant(src.getStartElement())); if (src.hasEnd()) tgt.setEnd(src.getEnd()); if (src.hasMinutesDuration()) tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.r4.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_40.convertReference(t)); + if (src.hasSlot()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_40.convertReference(t)); + } if (src.hasCreated()) tgt.setCreatedElement(VersionConvertor_30_40.convertDateTime(src.getCreatedElement())); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); - for (org.hl7.fhir.r4.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_40.convertPeriod(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } + if (src.hasRequestedPeriod()) { + for (org.hl7.fhir.r4.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_40.convertPeriod(t)); + } return tgt; } @@ -86,7 +126,9 @@ public class Appointment30_40 { return null; org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); if (src.hasRequired()) @@ -101,7 +143,9 @@ public class Appointment30_40 { return null; org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); if (src.hasRequired()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AppointmentResponse30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AppointmentResponse30_40.java index 38b96541f..c70be99d0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AppointmentResponse30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AppointmentResponse30_40.java @@ -10,14 +10,18 @@ public class AppointmentResponse30_40 { return null; org.hl7.fhir.r4.model.AppointmentResponse tgt = new org.hl7.fhir.r4.model.AppointmentResponse(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasAppointment()) tgt.setAppointment(VersionConvertor_30_40.convertReference(src.getAppointment())); if (src.hasStart()) tgt.setStartElement(VersionConvertor_30_40.convertInstant(src.getStartElement())); if (src.hasEnd()) tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasParticipantType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); if (src.hasParticipantStatus()) @@ -32,14 +36,18 @@ public class AppointmentResponse30_40 { return null; org.hl7.fhir.dstu3.model.AppointmentResponse tgt = new org.hl7.fhir.dstu3.model.AppointmentResponse(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasAppointment()) tgt.setAppointment(VersionConvertor_30_40.convertReference(src.getAppointment())); if (src.hasStart()) tgt.setStartElement(VersionConvertor_30_40.convertInstant(src.getStartElement())); if (src.hasEnd()) tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasParticipantType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); if (src.hasParticipantStatus()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AuditEvent30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AuditEvent30_40.java index dd38d779f..04bdc6792 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AuditEvent30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/AuditEvent30_40.java @@ -12,7 +12,9 @@ public class AuditEvent30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCoding(src.getType())); - for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_40.convertCoding(t)); + if (src.hasSubtype()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasAction()) tgt.setAction(convertAuditEventAction(src.getAction())); if (src.hasRecorded()) @@ -21,11 +23,17 @@ public class AuditEvent30_40 { tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); if (src.hasOutcomeDesc()) tgt.setOutcomeDesc(src.getOutcomeDesc()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } if (src.hasSource()) tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + if (src.hasEntity()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + } return tgt; } @@ -36,7 +44,9 @@ public class AuditEvent30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCoding(src.getType())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_40.convertCoding(t)); + if (src.hasSubtype()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasAction()) tgt.setAction(convertAuditEventAction(src.getAction())); if (src.hasRecorded()) @@ -45,11 +55,17 @@ public class AuditEvent30_40 { tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); if (src.hasOutcomeDesc()) tgt.setOutcomeDesc(src.getOutcomeDesc()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } if (src.hasSource()) tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + if (src.hasEntity()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + } return tgt; } @@ -96,7 +112,9 @@ public class AuditEvent30_40 { return null; org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasRole()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasWho()) { if (src.getWho().hasIdentifier()) tgt.setUserId(VersionConvertor_30_40.convertIdentifier(src.getWho().getIdentifier())); @@ -111,12 +129,16 @@ public class AuditEvent30_40 { tgt.setRequestor(src.getRequestor()); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + if (src.hasPolicy()) { + for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } if (src.hasMedia()) tgt.setMedia(VersionConvertor_30_40.convertCoding(src.getMedia())); if (src.hasNetwork()) tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_40.convertCodeableConcept(t)); + } return tgt; } @@ -125,7 +147,9 @@ public class AuditEvent30_40 { return null; org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasRole()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasReference()) tgt.setWho(VersionConvertor_30_40.convertReference(src.getReference())); if (src.hasUserId()) @@ -138,12 +162,16 @@ public class AuditEvent30_40 { tgt.setRequestor(src.getRequestor()); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } if (src.hasMedia()) tgt.setMedia(VersionConvertor_30_40.convertCoding(src.getMedia())); if (src.hasNetwork()) tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_40.convertCodeableConcept(t)); + } return tgt; } @@ -224,14 +252,18 @@ public class AuditEvent30_40 { tgt.setRole(VersionConvertor_30_40.convertCoding(src.getRole())); if (src.hasLifecycle()) tgt.setLifecycle(VersionConvertor_30_40.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasQuery()) tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -252,14 +284,18 @@ public class AuditEvent30_40 { tgt.setRole(VersionConvertor_30_40.convertCoding(src.getRole())); if (src.hasLifecycle()) tgt.setLifecycle(VersionConvertor_30_40.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasQuery()) tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -332,7 +368,9 @@ public class AuditEvent30_40 { tgt.setSite(src.getSite()); if (src.hasObserver()) tgt.setIdentifier(VersionConvertor_30_40.convertIdentifier(src.getObserver().getIdentifier())); - for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCoding(t)); + } return tgt; } @@ -345,7 +383,9 @@ public class AuditEvent30_40 { tgt.setSite(src.getSite()); if (src.hasIdentifier()) tgt.getObserver().setIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCoding(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Basic30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Basic30_40.java index 1b457dcd3..a6c4f4ec7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Basic30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Basic30_40.java @@ -10,7 +10,9 @@ public class Basic30_40 { return null; org.hl7.fhir.r4.model.Basic tgt = new org.hl7.fhir.r4.model.Basic(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasSubject()) @@ -27,7 +29,9 @@ public class Basic30_40 { return null; org.hl7.fhir.dstu3.model.Basic tgt = new org.hl7.fhir.dstu3.model.Basic(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasSubject()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/BodySite30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/BodySite30_40.java index bba68b6d5..95b0cf715 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/BodySite30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/BodySite30_40.java @@ -10,12 +10,16 @@ public class BodySite30_40 { return null; org.hl7.fhir.dstu3.model.BodySite tgt = new org.hl7.fhir.dstu3.model.BodySite(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_40.convertAttachment(t)); + if (src.hasImage()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_40.convertAttachment(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_40.convertReference(src.getPatient())); return tgt; @@ -26,12 +30,16 @@ public class BodySite30_40 { return null; org.hl7.fhir.r4.model.BodyStructure tgt = new org.hl7.fhir.r4.model.BodyStructure(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_40.convertAttachment(t)); + if (src.hasImage()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_40.convertAttachment(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_40.convertReference(src.getPatient())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Bundle30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Bundle30_40.java index b4d6e246a..21760a229 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Bundle30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Bundle30_40.java @@ -16,8 +16,12 @@ public class Bundle30_40 { tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } if (src.hasSignature()) tgt.setSignature(VersionConvertor_30_40.convertSignature(src.getSignature())); return tgt; @@ -34,8 +38,12 @@ public class Bundle30_40 { tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } if (src.hasSignature()) tgt.setSignature(VersionConvertor_30_40.convertSignature(src.getSignature())); return tgt; @@ -46,7 +54,9 @@ public class Bundle30_40 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); if (src.hasResource()) @@ -65,7 +75,9 @@ public class Bundle30_40 { return null; org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); if (src.hasResource()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CapabilityStatement30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CapabilityStatement30_40.java index f979d6d1d..229530876 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CapabilityStatement30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CapabilityStatement30_40.java @@ -27,18 +27,26 @@ public class CapabilityStatement30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasKind()) tgt.setKind(convertCapabilityStatementKind(src.getKind())); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + if (src.hasInstantiates()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + } if (src.hasSoftware()) tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); if (src.hasImplementation()) @@ -47,18 +55,32 @@ public class CapabilityStatement30_40 { tgt.setFhirVersion(src.getFhirVersion().toCode()); if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown")) tgt.setAcceptUnknown(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue())); - for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.r4.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); - for (org.hl7.fhir.r4.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent r : src.getRest()) for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r4.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_30_40.convertCanonicalToReference(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasPatchFormat()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); + } + if (src.hasImplementationGuide()) { + for (org.hl7.fhir.r4.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); + } + if (src.hasRest()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent r : src.getRest()) for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r4.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_30_40.convertCanonicalToReference(t)); + } for (org.hl7.fhir.r4.model.Extension ext : src.getExtension()) { if ("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile".equals(ext.getUrl())) { tgt.addProfile(VersionConvertor_30_40.convertReference((org.hl7.fhir.r4.model.Reference) ext.getValue())); } } - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + if (src.hasRest()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + } return tgt; } @@ -83,18 +105,26 @@ public class CapabilityStatement30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasKind()) tgt.setKind(convertCapabilityStatementKind(src.getKind())); - for (org.hl7.fhir.dstu3.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + if (src.hasInstantiates()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + } if (src.hasSoftware()) tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); if (src.hasImplementation()) @@ -103,13 +133,27 @@ public class CapabilityStatement30_40 { tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); if (src.hasAcceptUnknown()) tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); - for (org.hl7.fhir.dstu3.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile", VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasPatchFormat()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); + } + if (src.hasImplementationGuide()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile", VersionConvertor_30_40.convertReference(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + } return tgt; } @@ -200,12 +244,16 @@ public class CapabilityStatement30_40 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + if (src.hasSupportedMessage()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + } for (org.hl7.fhir.r4.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) { org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent event = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent(); tgt.addEvent(event); @@ -237,12 +285,16 @@ public class CapabilityStatement30_40 { return null; org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + if (src.hasSupportedMessage()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + } for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) { org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT); e.addExtension(new org.hl7.fhir.r4.model.Extension("code", VersionConvertor_30_40.convertCoding(t.getCode()))); @@ -325,11 +377,21 @@ public class CapabilityStatement30_40 { tgt.setDocumentation(src.getDocumentation()); if (src.hasSecurity()) tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -344,11 +406,21 @@ public class CapabilityStatement30_40 { tgt.setDocumentation(src.getDocumentation()); if (src.hasSecurity()) tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r4.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -387,7 +459,9 @@ public class CapabilityStatement30_40 { tgt.setProfileElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getProfile())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } if (src.hasVersioning()) tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); if (src.hasReadHistory()) @@ -402,10 +476,18 @@ public class CapabilityStatement30_40 { tgt.setConditionalUpdate(src.getConditionalUpdate()); if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_40.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + if (src.hasReferencePolicy()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_40.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } return tgt; } @@ -420,7 +502,9 @@ public class CapabilityStatement30_40 { tgt.setProfile(VersionConvertor_30_40.convertCanonicalToReference(src.getProfileElement())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + if (src.hasInteraction()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } if (src.hasVersioning()) tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); if (src.hasReadHistory()) @@ -435,10 +519,18 @@ public class CapabilityStatement30_40 { tgt.setConditionalUpdate(src.getConditionalUpdate()); if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_40.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + if (src.hasReferencePolicy()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_40.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } return tgt; } @@ -481,7 +573,9 @@ public class CapabilityStatement30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -494,7 +588,9 @@ public class CapabilityStatement30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CarePlan30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CarePlan30_40.java index b35cff895..a9ab6d378 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CarePlan30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CarePlan30_40.java @@ -2,7 +2,6 @@ package org.hl7.fhir.convertors.conv30_40; import org.hl7.fhir.convertors.VersionConvertor_30_40; import org.hl7.fhir.exceptions.FHIRException; - import java.util.List; public class CarePlan30_40 { @@ -14,7 +13,9 @@ public class CarePlan30_40 { return null; org.hl7.fhir.dstu3.model.CarePlan tgt = new org.hl7.fhir.dstu3.model.CarePlan(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) { tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); } @@ -25,31 +26,47 @@ public class CarePlan30_40 { tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); } if (src.hasStatus()) { - tgt.setStatus(convertCarePlanStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } } if (src.hasIntent()) { - tgt.setIntent(convertCarePlanIntent(src.getIntent())); + if (src.hasIntent()) { + tgt.setIntent(convertCarePlanIntent(src.getIntent())); + } } for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) { tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); } if (src.hasTitle()) { - tgt.setTitle(src.getTitle()); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } if (src.hasSubject()) { - tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); + } } if (src.hasEncounter()) { - tgt.setContext(VersionConvertor_30_40.convertReference(src.getEncounter())); + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_30_40.convertReference(src.getEncounter())); + } } if (src.hasPeriod()) { - tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); + } } if (src.hasAuthor()) { - tgt.addAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.addAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); + } } for (org.hl7.fhir.r4.model.Reference t : src.getCareTeam()) { tgt.addCareTeam(VersionConvertor_30_40.convertReference(t)); @@ -153,10 +170,14 @@ public class CarePlan30_40 { tgt.addProgress(VersionConvertor_30_40.convertAnnotation(t)); } if (src.hasReference()) { - tgt.setReference(VersionConvertor_30_40.convertReference(src.getReference())); + if (src.hasReference()) { + tgt.setReference(VersionConvertor_30_40.convertReference(src.getReference())); + } } if (src.hasDetail()) { - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } } return tgt; } @@ -176,10 +197,14 @@ public class CarePlan30_40 { tgt.addProgress(VersionConvertor_30_40.convertAnnotation(t)); } if (src.hasReference()) { - tgt.setReference(VersionConvertor_30_40.convertReference(src.getReference())); + if (src.hasReference()) { + tgt.setReference(VersionConvertor_30_40.convertReference(src.getReference())); + } } if (src.hasDetail()) { - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } } return tgt; } @@ -192,11 +217,15 @@ public class CarePlan30_40 { if (src.hasCategory()) { org.hl7.fhir.r4.model.Extension t = new org.hl7.fhir.r4.model.Extension(); t.setUrl(CarePlanActivityDetailComponentExtension); - t.setValue(VersionConvertor_30_40.convertType(src.getCategory())); + if (src.hasCategory()) { + t.setValue(VersionConvertor_30_40.convertType(src.getCategory())); + } tgt.addExtension(t); } if (src.hasCode()) { - tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); + } } for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) { tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); @@ -208,37 +237,55 @@ public class CarePlan30_40 { tgt.addGoal(VersionConvertor_30_40.convertReference(t)); } if (src.hasStatus()) { - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } } if (src.hasStatusReason()) { org.hl7.fhir.r4.model.Coding code = new org.hl7.fhir.r4.model.Coding(); - code.setCode(src.getStatusReason()); + if (src.hasStatusReason()) { + code.setCode(src.getStatusReason()); + } org.hl7.fhir.r4.model.CodeableConcept t = new org.hl7.fhir.r4.model.CodeableConcept(code); tgt.setStatusReason(t); } if (src.hasProhibited()) { - tgt.setDoNotPerform(src.getProhibited()); + if (src.hasProhibited()) { + tgt.setDoNotPerform(src.getProhibited()); + } } if (src.hasScheduled()) { - tgt.setScheduled(VersionConvertor_30_40.convertType(src.getScheduled())); + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_30_40.convertType(src.getScheduled())); + } } if (src.hasLocation()) { - tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); + } } for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) { tgt.addPerformer(VersionConvertor_30_40.convertReference(t)); } if (src.hasProduct()) { - tgt.setProduct(VersionConvertor_30_40.convertType(src.getProduct())); + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_30_40.convertType(src.getProduct())); + } } if (src.hasDailyAmount()) { - tgt.setDailyAmount(VersionConvertor_30_40.convertSimpleQuantity(src.getDailyAmount())); + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_30_40.convertSimpleQuantity(src.getDailyAmount())); + } } if (src.hasQuantity()) { - tgt.setQuantity(VersionConvertor_30_40.convertSimpleQuantity(src.getQuantity())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_30_40.convertSimpleQuantity(src.getQuantity())); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CareTeam30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CareTeam30_40.java index df2f79ff8..569ad8e6a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CareTeam30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CareTeam30_40.java @@ -10,10 +10,14 @@ public class CareTeam30_40 { return null; org.hl7.fhir.dstu3.model.CareTeam tgt = new org.hl7.fhir.dstu3.model.CareTeam(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertCareTeamStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasSubject()) @@ -22,11 +26,21 @@ public class CareTeam30_40 { tgt.setContext(VersionConvertor_30_40.convertReference(src.getEncounter())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasManagingOrganization()) { + for (org.hl7.fhir.r4.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -35,10 +49,14 @@ public class CareTeam30_40 { return null; org.hl7.fhir.r4.model.CareTeam tgt = new org.hl7.fhir.r4.model.CareTeam(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertCareTeamStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasSubject()) @@ -47,11 +65,21 @@ public class CareTeam30_40 { tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getContext())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasManagingOrganization()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ClinicalImpression30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ClinicalImpression30_40.java index 6702ad1f0..f2518dfc8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ClinicalImpression30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ClinicalImpression30_40.java @@ -10,7 +10,9 @@ public class ClinicalImpression30_40 { return null; org.hl7.fhir.dstu3.model.ClinicalImpression tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); if (src.hasCode()) @@ -29,15 +31,29 @@ public class ClinicalImpression30_40 { tgt.setAssessor(VersionConvertor_30_40.convertReference(src.getAssessor())); if (src.hasPrevious()) tgt.setPrevious(VersionConvertor_30_40.convertReference(src.getPrevious())); - for (org.hl7.fhir.r4.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionInvestigationComponent t : src.getInvestigation()) tgt.addInvestigation(convertClinicalImpressionInvestigationComponent(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + if (src.hasProblem()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasInvestigation()) { + for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionInvestigationComponent t : src.getInvestigation()) tgt.addInvestigation(convertClinicalImpressionInvestigationComponent(t)); + } + if (src.hasProtocol()) { + for (org.hl7.fhir.r4.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + } if (src.hasSummary()) tgt.setSummary(src.getSummary()); - for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasFinding()) { + for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } + if (src.hasPrognosisCodeableConcept()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasPrognosisReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -46,7 +62,9 @@ public class ClinicalImpression30_40 { return null; org.hl7.fhir.r4.model.ClinicalImpression tgt = new org.hl7.fhir.r4.model.ClinicalImpression(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); if (src.hasCode()) @@ -65,15 +83,29 @@ public class ClinicalImpression30_40 { tgt.setAssessor(VersionConvertor_30_40.convertReference(src.getAssessor())); if (src.hasPrevious()) tgt.setPrevious(VersionConvertor_30_40.convertReference(src.getPrevious())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionInvestigationComponent t : src.getInvestigation()) tgt.addInvestigation(convertClinicalImpressionInvestigationComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + if (src.hasProblem()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasInvestigation()) { + for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionInvestigationComponent t : src.getInvestigation()) tgt.addInvestigation(convertClinicalImpressionInvestigationComponent(t)); + } + if (src.hasProtocol()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + } if (src.hasSummary()) tgt.setSummary(src.getSummary()); - for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasFinding()) { + for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } + if (src.hasPrognosisCodeableConcept()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasPrognosisReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -112,7 +144,9 @@ public class ClinicalImpression30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getItem()) tgt.addItem(VersionConvertor_30_40.convertReference(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getItem()) tgt.addItem(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -123,7 +157,9 @@ public class ClinicalImpression30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.Reference t : src.getItem()) tgt.addItem(VersionConvertor_30_40.convertReference(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Reference t : src.getItem()) tgt.addItem(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CodeSystem30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CodeSystem30_40.java index 0913ba2a4..d9c6e1856 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CodeSystem30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CodeSystem30_40.java @@ -28,11 +28,17 @@ public class CodeSystem30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) @@ -51,9 +57,15 @@ public class CodeSystem30_40 { tgt.setContent(convertCodeSystemContentMode(src.getContent())); if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -80,11 +92,17 @@ public class CodeSystem30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) @@ -103,9 +121,15 @@ public class CodeSystem30_40 { tgt.setContent(convertCodeSystemContentMode(src.getContent())); if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -152,7 +176,9 @@ public class CodeSystem30_40 { tgt.setCode(src.getCode()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.Enumeration t : src.getOperator()) VersionConvertor_30_40.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_40.convertFilterOperator(t.getValue()))); + if (src.hasOperator()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getOperator()) VersionConvertor_30_40.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_40.convertFilterOperator(t.getValue()))); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -167,7 +193,9 @@ public class CodeSystem30_40 { tgt.setCode(src.getCode()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getOperator()) VersionConvertor_30_40.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_40.convertFilterOperator(t.getValue()))); + if (src.hasOperator()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getOperator()) VersionConvertor_30_40.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_40.convertFilterOperator(t.getValue()))); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -218,9 +246,15 @@ public class CodeSystem30_40 { tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -235,9 +269,15 @@ public class CodeSystem30_40 { tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Communication30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Communication30_40.java index 93f91baf4..d61f7676a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Communication30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Communication30_40.java @@ -10,10 +10,18 @@ public class Communication30_40 { return null; org.hl7.fhir.dstu3.model.Communication tgt = new org.hl7.fhir.dstu3.model.Communication(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) if (src.getStatus() == org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE) tgt.setNotDone(true); @@ -21,11 +29,17 @@ public class Communication30_40 { tgt.setStatus(convertCommunicationStatus(src.getStatus())); if (src.hasStatusReason()) tgt.setNotDoneReason(VersionConvertor_30_40.convertCodeableConcept(src.getStatusReason())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_40.convertReference(t)); + if (src.hasRecipient()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_40.convertReference(t)); + } if (src.hasEncounter()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getEncounter())); if (src.hasSent()) @@ -34,10 +48,18 @@ public class Communication30_40 { tgt.setReceivedElement(VersionConvertor_30_40.convertDateTime(src.getReceivedElement())); if (src.hasSender()) tgt.setSender(VersionConvertor_30_40.convertReference(src.getSender())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -46,21 +68,35 @@ public class Communication30_40 { return null; org.hl7.fhir.r4.model.Communication tgt = new org.hl7.fhir.r4.model.Communication(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasNotDone()) tgt.setStatus(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE); else if (src.hasStatus()) tgt.setStatus(convertCommunicationStatus(src.getStatus())); if (src.hasNotDoneReason()) tgt.setStatusReason(VersionConvertor_30_40.convertCodeableConcept(src.getNotDoneReason())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_40.convertReference(t)); + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_40.convertReference(t)); + } if (src.hasContext()) tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getContext())); if (src.hasSent()) @@ -69,10 +105,18 @@ public class Communication30_40 { tgt.setReceivedElement(VersionConvertor_30_40.convertDateTime(src.getReceivedElement())); if (src.hasSender()) tgt.setSender(VersionConvertor_30_40.convertReference(src.getSender())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CompartmentDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CompartmentDefinition30_40.java index 972b09b5e..eb18ce686 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CompartmentDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/CompartmentDefinition30_40.java @@ -24,18 +24,26 @@ public class CompartmentDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(convertCompartmentType(src.getCode())); if (src.hasSearch()) tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -58,18 +66,26 @@ public class CompartmentDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(convertCompartmentType(src.getCode())); if (src.hasSearch()) tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -80,7 +96,9 @@ public class CompartmentDefinition30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasParam()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -93,7 +111,9 @@ public class CompartmentDefinition30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.r4.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasParam()) { + for (org.hl7.fhir.r4.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Composition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Composition30_40.java index 052c6ea67..09395e561 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Composition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Composition30_40.java @@ -24,17 +24,27 @@ public class Composition30_40 { tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getEncounter())); if (src.hasDateElement()) tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_40.convertReference(t)); + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_40.convertReference(t)); + } if (src.hasTitle()) tgt.setTitle(src.getTitle()); if (src.hasConfidentiality()) tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); - for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + if (src.hasAttester()) { + for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_40.convertReference(src.getCustodian())); - for (org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); - for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasSection()) { + for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -57,17 +67,27 @@ public class Composition30_40 { tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getEncounter())); if (src.hasDateElement()) tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_40.convertReference(t)); + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_40.convertReference(t)); + } if (src.hasTitle()) tgt.setTitle(src.getTitle()); if (src.hasConfidentiality()) tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); - for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + if (src.hasAttester()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_40.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); - for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -138,10 +158,14 @@ public class Composition30_40 { return null; org.hl7.fhir.r4.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionEventComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -150,10 +174,14 @@ public class Composition30_40 { return null; org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -272,10 +300,14 @@ public class Composition30_40 { tgt.setMode(convertSectionMode(src.getMode())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_40.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r4.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_40.convertReference(t)); + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_40.convertReference(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_40.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasSection()) { + for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -294,10 +326,14 @@ public class Composition30_40 { tgt.setMode(convertSectionMode(src.getMode())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_40.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_40.convertReference(t)); + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_40.convertReference(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_40.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasSection()) { + for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ConceptMap30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ConceptMap30_40.java index d5cd47973..50acbac77 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ConceptMap30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ConceptMap30_40.java @@ -28,11 +28,17 @@ public class ConceptMap30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) @@ -41,7 +47,9 @@ public class ConceptMap30_40 { tgt.setSource(VersionConvertor_30_40.convertType(src.getSource())); if (src.hasTarget()) tgt.setTarget(VersionConvertor_30_40.convertType(src.getTarget())); - for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) tgt.addGroup(convertConceptMapGroupComponent(t)); + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) tgt.addGroup(convertConceptMapGroupComponent(t)); + } return tgt; } @@ -160,7 +168,9 @@ public class ConceptMap30_40 { tgt.setTarget(src.getTarget()); if (src.hasTargetVersion()) tgt.setTargetVersion(src.getTargetVersion()); - for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + } if (src.hasUnmapped()) tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); return tgt; @@ -179,7 +189,9 @@ public class ConceptMap30_40 { tgt.setTarget(src.getTarget()); if (src.hasTargetVersion()) tgt.setTargetVersion(src.getTargetVersion()); - for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + } if (src.hasUnmapped()) tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); return tgt; @@ -288,7 +300,9 @@ public class ConceptMap30_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t)); + } return tgt; } @@ -301,7 +315,9 @@ public class ConceptMap30_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t)); + } return tgt; } @@ -318,8 +334,12 @@ public class ConceptMap30_40 { tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -336,8 +356,12 @@ public class ConceptMap30_40 { tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Condition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Condition30_40.java index bc6d94a78..00eaab598 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Condition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Condition30_40.java @@ -18,17 +18,23 @@ public class Condition30_40 { return null; org.hl7.fhir.r4.model.Condition tgt = new org.hl7.fhir.r4.model.Condition(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasSeverity()) tgt.setSeverity(VersionConvertor_30_40.convertCodeableConcept(src.getSeverity())); if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasContext()) @@ -43,8 +49,12 @@ public class Condition30_40 { tgt.setAsserter(VersionConvertor_30_40.convertReference(src.getAsserter())); if (src.hasStage()) tgt.addStage(convertConditionStageComponent(src.getStage())); - for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasEvidence()) { + for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -53,17 +63,23 @@ public class Condition30_40 { return null; org.hl7.fhir.dstu3.model.Condition tgt = new org.hl7.fhir.dstu3.model.Condition(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasSeverity()) tgt.setSeverity(VersionConvertor_30_40.convertCodeableConcept(src.getSeverity())); if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasBodySite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasEncounter()) @@ -78,8 +94,12 @@ public class Condition30_40 { tgt.setAsserter(VersionConvertor_30_40.convertReference(src.getAsserter())); if (src.hasStage()) tgt.setStage(convertConditionStageComponent(src.getStageFirstRep())); - for (org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasEvidence()) { + for (org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -129,8 +149,12 @@ public class Condition30_40 { return null; org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -139,8 +163,12 @@ public class Condition30_40 { return null; org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -151,7 +179,9 @@ public class Condition30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasSummary()) tgt.setSummary(VersionConvertor_30_40.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_40.convertReference(t)); + if (src.hasAssessment()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -162,7 +192,9 @@ public class Condition30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasSummary()) tgt.setSummary(VersionConvertor_30_40.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.r4.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_40.convertReference(t)); + if (src.hasAssessment()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Consent30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Consent30_40.java index 361856a80..f64b4e9b5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Consent30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Consent30_40.java @@ -3,7 +3,6 @@ package org.hl7.fhir.convertors.conv30_40; import org.hl7.fhir.convertors.VersionConvertor_30_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeableConcept; - import java.util.List; public class Consent30_40 { @@ -17,34 +16,56 @@ public class Consent30_40 { tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifier())); if (src.hasStatus()) tgt.setStatus(convertConsentState(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_40.convertReference(src.getPatient())); if (src.hasDateTime()) tgt.setDateTimeElement(VersionConvertor_30_40.convertDateTime(src.getDateTimeElement())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getConsentingParty()) tgt.addPerformer(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getOrganization()) tgt.addOrganization(VersionConvertor_30_40.convertReference(t)); + if (src.hasConsentingParty()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getConsentingParty()) tgt.addPerformer(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasOrganization()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getOrganization()) tgt.addOrganization(VersionConvertor_30_40.convertReference(t)); + } if (src.hasSource()) tgt.setSource(VersionConvertor_30_40.convertType(src.getSource())); - for (org.hl7.fhir.dstu3.model.Consent.ConsentPolicyComponent t : src.getPolicy()) tgt.addPolicy(convertConsentPolicyComponent(t)); + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu3.model.Consent.ConsentPolicyComponent t : src.getPolicy()) tgt.addPolicy(convertConsentPolicyComponent(t)); + } if (src.hasPolicyRule()) { org.hl7.fhir.r4.model.Coding c = new org.hl7.fhir.r4.model.Coding(); c.setSystem(VersionConvertor_30_40.URN_IETF_RFC_3986); - c.setCode(src.getPolicyRule()); + if (src.hasPolicyRule()) { + c.setCode(src.getPolicyRule()); + } tgt.setPolicyRule(new CodeableConcept(c)); } if (src.hasSecurityLabel() || src.hasPeriod() || src.hasActor() || src.hasAction() || src.hasPurpose() || src.hasDataPeriod() || src.hasData() || src.hasExcept()) { org.hl7.fhir.r4.model.Consent.provisionComponent pc = new org.hl7.fhir.r4.model.Consent.provisionComponent(); if (src.hasPeriod()) pc.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Consent.ConsentActorComponent t : src.getActor()) pc.addActor(convertConsentActorComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) pc.addAction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) pc.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.dstu3.model.Coding t : src.getPurpose()) pc.addPurpose(VersionConvertor_30_40.convertCoding(t)); + if (src.hasActor()) { + for (org.hl7.fhir.dstu3.model.Consent.ConsentActorComponent t : src.getActor()) pc.addActor(convertConsentActorComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) pc.addAction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) pc.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasPurpose()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getPurpose()) pc.addPurpose(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasDataPeriod()) pc.setDataPeriod(VersionConvertor_30_40.convertPeriod(src.getDataPeriod())); - for (org.hl7.fhir.dstu3.model.Consent.ConsentDataComponent t : src.getData()) pc.addData(convertConsentDataComponent(t)); - for (org.hl7.fhir.dstu3.model.Consent.ExceptComponent t : src.getExcept()) pc.addProvision(convertExceptComponent(t)); + if (src.hasData()) { + for (org.hl7.fhir.dstu3.model.Consent.ConsentDataComponent t : src.getData()) pc.addData(convertConsentDataComponent(t)); + } + if (src.hasExcept()) { + for (org.hl7.fhir.dstu3.model.Consent.ExceptComponent t : src.getExcept()) pc.addProvision(convertExceptComponent(t)); + } tgt.setProvision(pc); } return tgt; @@ -304,15 +325,29 @@ public class Consent30_40 { tgt.setType(convertConsentExceptType(src.getType())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Consent.provisionActorComponent t : src.getActor()) tgt.addActor(convertExceptActorComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.r4.model.Coding t : src.getPurpose()) tgt.addPurpose(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.r4.model.Coding t : src.getClass_()) tgt.addClass_(VersionConvertor_30_40.convertCoding(t)); - for (CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + if (src.hasActor()) { + for (org.hl7.fhir.r4.model.Consent.provisionActorComponent t : src.getActor()) tgt.addActor(convertExceptActorComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasPurpose()) { + for (org.hl7.fhir.r4.model.Coding t : src.getPurpose()) tgt.addPurpose(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasClass_()) { + for (org.hl7.fhir.r4.model.Coding t : src.getClass_()) tgt.addClass_(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasCode()) { + for (CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasDataPeriod()) tgt.setDataPeriod(VersionConvertor_30_40.convertPeriod(src.getDataPeriod())); - for (org.hl7.fhir.r4.model.Consent.provisionDataComponent t : src.getData()) tgt.addData(convertExceptDataComponent(t)); + if (src.hasData()) { + for (org.hl7.fhir.r4.model.Consent.provisionDataComponent t : src.getData()) tgt.addData(convertExceptDataComponent(t)); + } return tgt; } @@ -325,15 +360,29 @@ public class Consent30_40 { tgt.setType(convertConsentExceptType(src.getType())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Consent.ExceptActorComponent t : src.getActor()) tgt.addActor(convertExceptActorComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.dstu3.model.Coding t : src.getPurpose()) tgt.addPurpose(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.dstu3.model.Coding t : src.getClass_()) tgt.addClass_(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(new CodeableConcept(VersionConvertor_30_40.convertCoding(t))); + if (src.hasActor()) { + for (org.hl7.fhir.dstu3.model.Consent.ExceptActorComponent t : src.getActor()) tgt.addActor(convertExceptActorComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasPurpose()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getPurpose()) tgt.addPurpose(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasClass_()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getClass_()) tgt.addClass_(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(new CodeableConcept(VersionConvertor_30_40.convertCoding(t))); + } if (src.hasDataPeriod()) tgt.setDataPeriod(VersionConvertor_30_40.convertPeriod(src.getDataPeriod())); - for (org.hl7.fhir.dstu3.model.Consent.ExceptDataComponent t : src.getData()) tgt.addData(convertExceptDataComponent(t)); + if (src.hasData()) { + for (org.hl7.fhir.dstu3.model.Consent.ExceptDataComponent t : src.getData()) tgt.addData(convertExceptDataComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DataElement30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DataElement30_40.java index d86bcec7a..68ebcb526 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DataElement30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DataElement30_40.java @@ -12,7 +12,9 @@ public class DataElement30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl().replace("/DataElement/", "/StructureDefinition/de-")); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasStatus()) @@ -27,13 +29,23 @@ public class DataElement30_40 { tgt.setName(src.getName()); if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.getSnapshot().addElement(VersionConvertor_30_40.convertElementDefinition(t)); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.getSnapshot().addElement(VersionConvertor_30_40.convertElementDefinition(t)); + } tgt.setKind(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); tgt.setAbstract(false); tgt.setType(tgt.getName()); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DetectedIssue30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DetectedIssue30_40.java index 785778390..d6b6a212e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DetectedIssue30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DetectedIssue30_40.java @@ -24,12 +24,16 @@ public class DetectedIssue30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getIdentifiedDateTimeType())); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); - for (org.hl7.fhir.r4.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_40.convertReference(t)); + if (src.hasImplicated()) { + for (org.hl7.fhir.r4.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_40.convertReference(t)); + } if (src.hasDetail()) tgt.setDetail(src.getDetail()); if (src.hasReference()) tgt.setReference(src.getReference()); - for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasMitigation()) { + for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -52,12 +56,16 @@ public class DetectedIssue30_40 { tgt.setIdentified(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_40.convertReference(t)); + if (src.hasImplicated()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_40.convertReference(t)); + } if (src.hasDetail()) tgt.setDetail(src.getDetail()); if (src.hasReference()) tgt.setReference(src.getReference()); - for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasMitigation()) { + for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DeviceUseStatement30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DeviceUseStatement30_40.java index 60206163a..71866d1df 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DeviceUseStatement30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DeviceUseStatement30_40.java @@ -10,7 +10,9 @@ public class DeviceUseStatement30_40 { return null; org.hl7.fhir.r4.model.DeviceUseStatement tgt = new org.hl7.fhir.r4.model.DeviceUseStatement(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); if (src.hasSubject()) @@ -23,10 +25,14 @@ public class DeviceUseStatement30_40 { tgt.setSource(VersionConvertor_30_40.convertReference(src.getSource())); if (src.hasDevice()) tgt.setDevice(VersionConvertor_30_40.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasIndication()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasBodySite()) tgt.setBodySite(VersionConvertor_30_40.convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -35,7 +41,9 @@ public class DeviceUseStatement30_40 { return null; org.hl7.fhir.dstu3.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu3.model.DeviceUseStatement(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); if (src.hasSubject()) @@ -48,10 +56,14 @@ public class DeviceUseStatement30_40 { tgt.setSource(VersionConvertor_30_40.convertReference(src.getSource())); if (src.hasDevice()) tgt.setDevice(VersionConvertor_30_40.convertReference(src.getDevice())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addIndication(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addIndication(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasBodySite()) tgt.setBodySite(VersionConvertor_30_40.convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DiagnosticReport30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DiagnosticReport30_40.java index 780b7df6d..29e7ef055 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DiagnosticReport30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DiagnosticReport30_40.java @@ -10,8 +10,12 @@ public class DiagnosticReport30_40 { return null; org.hl7.fhir.r4.model.DiagnosticReport tgt = new org.hl7.fhir.r4.model.DiagnosticReport(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); if (src.hasCategory()) @@ -26,14 +30,26 @@ public class DiagnosticReport30_40 { tgt.setEffective(VersionConvertor_30_40.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssuedElement(VersionConvertor_30_40.convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); + if (src.hasSpecimen()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); + } if (src.hasConclusion()) tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_40.convertAttachment(t)); + if (src.hasCodedDiagnosis()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_40.convertAttachment(t)); + } return tgt; } @@ -42,8 +58,12 @@ public class DiagnosticReport30_40 { return null; org.hl7.fhir.dstu3.model.DiagnosticReport tgt = new org.hl7.fhir.dstu3.model.DiagnosticReport(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); if (src.hasCategory()) @@ -58,14 +78,26 @@ public class DiagnosticReport30_40 { tgt.setEffective(VersionConvertor_30_40.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssuedElement(VersionConvertor_30_40.convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + if (src.hasSpecimen()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.r4.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.r4.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasMedia()) { + for (org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + } if (src.hasConclusion()) tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_40.convertAttachment(t)); + if (src.hasConclusionCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_40.convertAttachment(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DocumentReference30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DocumentReference30_40.java index 017f586a1..66c5f66d6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DocumentReference30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/DocumentReference30_40.java @@ -18,7 +18,9 @@ public class DocumentReference30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasMasterIdentifier()) tgt.setMasterIdentifier(VersionConvertor_30_40.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); if (src.hasDocStatus()) @@ -35,11 +37,17 @@ public class DocumentReference30_40 { tgt.setAuthenticator(VersionConvertor_30_40.convertReference(src.getAuthenticator())); if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_40.convertReference(src.getCustodian())); - for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } if (src.hasContext()) tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); return tgt; @@ -52,7 +60,9 @@ public class DocumentReference30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasMasterIdentifier()) tgt.setMasterIdentifier(VersionConvertor_30_40.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); if (src.hasDocStatus()) @@ -69,11 +79,17 @@ public class DocumentReference30_40 { tgt.setAuthenticator(VersionConvertor_30_40.convertReference(src.getAuthenticator())); if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_40.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } if (src.hasContext()) tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); return tgt; @@ -110,7 +126,9 @@ public class DocumentReference30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasEncounter()) tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getEncounterFirstRep())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); if (src.hasFacilityType()) @@ -119,7 +137,9 @@ public class DocumentReference30_40 { tgt.setPracticeSetting(VersionConvertor_30_40.convertCodeableConcept(src.getPracticeSetting())); if (src.hasSourcePatientInfo()) tgt.setSourcePatientInfo(VersionConvertor_30_40.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.r4.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasRelated()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -130,7 +150,9 @@ public class DocumentReference30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasEncounter()) tgt.addEncounter(VersionConvertor_30_40.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); if (src.hasFacilityType()) @@ -139,7 +161,9 @@ public class DocumentReference30_40 { tgt.setPracticeSetting(VersionConvertor_30_40.convertCodeableConcept(src.getPracticeSetting())); if (src.hasSourcePatientInfo()) tgt.setSourcePatientInfo(VersionConvertor_30_40.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasRelated()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Encounter30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Encounter30_40.java index e2a894984..1b9bc3679 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Encounter30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Encounter30_40.java @@ -34,33 +34,55 @@ public class Encounter30_40 { return null; org.hl7.fhir.dstu3.model.Encounter tgt = new org.hl7.fhir.dstu3.model.Encounter(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEncounterStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + } if (src.hasClass_()) tgt.setClass_(VersionConvertor_30_40.convertCoding(src.getClass_())); - for (org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasClassHistory()) { + for (org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_40.convertCodeableConcept(src.getPriority())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } if (src.hasAppointment()) tgt.setAppointment(VersionConvertor_30_40.convertReference(src.getAppointmentFirstRep())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); if (src.hasLength()) tgt.setLength(VersionConvertor_30_40.convertDuration(src.getLength())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r4.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + } if (src.hasHospitalization()) tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } if (src.hasServiceProvider()) tgt.setServiceProvider(VersionConvertor_30_40.convertReference(src.getServiceProvider())); if (src.hasPartOf()) @@ -73,33 +95,55 @@ public class Encounter30_40 { return null; org.hl7.fhir.r4.model.Encounter tgt = new org.hl7.fhir.r4.model.Encounter(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEncounterStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu3.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + } if (src.hasClass_()) tgt.setClass_(VersionConvertor_30_40.convertCoding(src.getClass_())); - for (org.hl7.fhir.dstu3.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasClassHistory()) { + for (org.hl7.fhir.dstu3.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_40.convertCodeableConcept(src.getPriority())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } if (src.hasAppointment()) tgt.addAppointment(VersionConvertor_30_40.convertReference(src.getAppointment())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); if (src.hasLength()) tgt.setLength(VersionConvertor_30_40.convertDuration(src.getLength())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.dstu3.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + } if (src.hasHospitalization()) tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } if (src.hasServiceProvider()) tgt.setServiceProvider(VersionConvertor_30_40.convertReference(src.getServiceProvider())); if (src.hasPartOf()) @@ -120,9 +164,15 @@ public class Encounter30_40 { tgt.setAdmitSource(VersionConvertor_30_40.convertCodeableConcept(src.getAdmitSource())); if (src.hasReAdmission()) tgt.setReAdmission(VersionConvertor_30_40.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasDietPreference()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_40.convertReference(src.getDestination())); if (src.hasDischargeDisposition()) @@ -143,9 +193,15 @@ public class Encounter30_40 { tgt.setAdmitSource(VersionConvertor_30_40.convertCodeableConcept(src.getAdmitSource())); if (src.hasReAdmission()) tgt.setReAdmission(VersionConvertor_30_40.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasDietPreference()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_40.convertReference(src.getDestination())); if (src.hasDischargeDisposition()) @@ -220,7 +276,9 @@ public class Encounter30_40 { return null; org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); if (src.hasIndividual()) @@ -233,7 +291,9 @@ public class Encounter30_40 { return null; org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); if (src.hasIndividual()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Endpoint30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Endpoint30_40.java index d93784c0f..5a3a1f2a6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Endpoint30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Endpoint30_40.java @@ -10,7 +10,9 @@ public class Endpoint30_40 { return null; org.hl7.fhir.r4.model.Endpoint tgt = new org.hl7.fhir.r4.model.Endpoint(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEndpointStatus(src.getStatus())); if (src.hasConnectionType()) @@ -19,14 +21,22 @@ public class Endpoint30_40 { tgt.setName(src.getName()); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + if (src.hasPayloadType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasPayloadMimeType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + } if (src.hasAddress()) tgt.setAddress(src.getAddress()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + if (src.hasHeader()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + } return tgt; } @@ -35,7 +45,9 @@ public class Endpoint30_40 { return null; org.hl7.fhir.dstu3.model.Endpoint tgt = new org.hl7.fhir.dstu3.model.Endpoint(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEndpointStatus(src.getStatus())); if (src.hasConnectionType()) @@ -44,14 +56,22 @@ public class Endpoint30_40 { tgt.setName(src.getName()); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + if (src.hasPayloadType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasPayloadMimeType()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + } if (src.hasAddress()) tgt.setAddress(src.getAddress()); - for (org.hl7.fhir.r4.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + if (src.hasHeader()) { + for (org.hl7.fhir.r4.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/EpisodeOfCare30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/EpisodeOfCare30_40.java index 27c570a87..30252d61f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/EpisodeOfCare30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/EpisodeOfCare30_40.java @@ -10,23 +10,37 @@ public class EpisodeOfCare30_40 { return null; org.hl7.fhir.r4.model.EpisodeOfCare tgt = new org.hl7.fhir.r4.model.EpisodeOfCare(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.dstu3.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_40.convertReference(src.getPatient())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_40.convertReference(t)); + if (src.hasReferralRequest()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_40.convertReference(t)); + } if (src.hasCareManager()) tgt.setCareManager(VersionConvertor_30_40.convertReference(src.getCareManager())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + if (src.hasTeam()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -35,23 +49,37 @@ public class EpisodeOfCare30_40 { return null; org.hl7.fhir.dstu3.model.EpisodeOfCare tgt = new org.hl7.fhir.dstu3.model.EpisodeOfCare(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_40.convertDiagnosisComponent(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_40.convertReference(src.getPatient())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_40.convertReference(t)); + if (src.hasReferralRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_40.convertReference(t)); + } if (src.hasCareManager()) tgt.setCareManager(VersionConvertor_30_40.convertReference(src.getCareManager())); - for (org.hl7.fhir.r4.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + if (src.hasTeam()) { + for (org.hl7.fhir.r4.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ExpansionProfile30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ExpansionProfile30_40.java index 1d190c398..a626f41d2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ExpansionProfile30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ExpansionProfile30_40.java @@ -29,7 +29,9 @@ public class ExpansionProfile30_40 { tgt.addParameter("force-system-version", t.getSystem() + "|" + t.getVersion()); } if (src.hasExcludedSystem()) { - tgt.addParameter("exclude-system", src.getExcludedSystem().getSystem() + "|" + src.getExcludedSystem().getVersion()); + if (src.hasExcludedSystem()) { + tgt.addParameter("exclude-system", src.getExcludedSystem().getSystem() + "|" + src.getExcludedSystem().getVersion()); + } } if (src.hasIncludeDesignations()) tgt.addParameter("includeDesignations", src.getIncludeDesignations()); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/FamilyMemberHistory30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/FamilyMemberHistory30_40.java index e7e129e11..120538df7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/FamilyMemberHistory30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/FamilyMemberHistory30_40.java @@ -44,8 +44,12 @@ public class FamilyMemberHistory30_40 { return null; org.hl7.fhir.dstu3.model.FamilyMemberHistory tgt = new org.hl7.fhir.dstu3.model.FamilyMemberHistory(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + } if (src.hasStatus()) tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); if (src.hasDataAbsentReason()) @@ -66,10 +70,18 @@ public class FamilyMemberHistory30_40 { tgt.setEstimatedAge(src.getEstimatedAge()); if (src.hasDeceased()) tgt.setDeceased(VersionConvertor_30_40.convertType(src.getDeceased())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -78,8 +90,12 @@ public class FamilyMemberHistory30_40 { return null; org.hl7.fhir.r4.model.FamilyMemberHistory tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); + } if (src.hasStatus()) tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); if (src.hasNotDoneReason()) @@ -100,10 +116,18 @@ public class FamilyMemberHistory30_40 { tgt.setEstimatedAge(src.getEstimatedAge()); if (src.hasDeceased()) tgt.setDeceased(VersionConvertor_30_40.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -118,7 +142,9 @@ public class FamilyMemberHistory30_40 { tgt.setOutcome(VersionConvertor_30_40.convertCodeableConcept(src.getOutcome())); if (src.hasOnset()) tgt.setOnset(VersionConvertor_30_40.convertType(src.getOnset())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -133,7 +159,9 @@ public class FamilyMemberHistory30_40 { tgt.setOutcome(VersionConvertor_30_40.convertCodeableConcept(src.getOutcome())); if (src.hasOnset()) tgt.setOnset(VersionConvertor_30_40.convertType(src.getOnset())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Flag30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Flag30_40.java index 32aebbf51..84baf077f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Flag30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Flag30_40.java @@ -10,7 +10,9 @@ public class Flag30_40 { return null; org.hl7.fhir.dstu3.model.Flag tgt = new org.hl7.fhir.dstu3.model.Flag(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFlagStatus(src.getStatus())); if (src.hasCategory()) @@ -33,7 +35,9 @@ public class Flag30_40 { return null; org.hl7.fhir.r4.model.Flag tgt = new org.hl7.fhir.r4.model.Flag(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFlagStatus(src.getStatus())); if (src.hasCategory()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Goal30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Goal30_40.java index fd93dc4fe..ec4ebc290 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Goal30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Goal30_40.java @@ -10,10 +10,14 @@ public class Goal30_40 { return null; org.hl7.fhir.dstu3.model.Goal tgt = new org.hl7.fhir.dstu3.model.Goal(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasLifecycleStatus()) tgt.setStatus(convertGoalStatus(src.getLifecycleStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_40.convertCodeableConcept(src.getPriority())); if (src.hasDescription()) @@ -30,10 +34,18 @@ public class Goal30_40 { tgt.setStatusReason(src.getStatusReason()); if (src.hasExpressedBy()) tgt.setExpressedBy(VersionConvertor_30_40.convertReference(src.getExpressedBy())); - for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCode()) tgt.addOutcomeCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference()) tgt.addOutcomeReference(VersionConvertor_30_40.convertReference(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasOutcomeCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCode()) tgt.addOutcomeCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasOutcomeReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference()) tgt.addOutcomeReference(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -42,10 +54,14 @@ public class Goal30_40 { return null; org.hl7.fhir.r4.model.Goal tgt = new org.hl7.fhir.r4.model.Goal(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setLifecycleStatus(convertGoalStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_40.convertCodeableConcept(src.getPriority())); if (src.hasDescription()) @@ -62,10 +78,18 @@ public class Goal30_40 { tgt.setStatusReason(src.getStatusReason()); if (src.hasExpressedBy()) tgt.setExpressedBy(VersionConvertor_30_40.convertReference(src.getExpressedBy())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOutcomeCode()) tgt.addOutcomeCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getOutcomeReference()) tgt.addOutcomeReference(VersionConvertor_30_40.convertReference(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasOutcomeCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOutcomeCode()) tgt.addOutcomeCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasOutcomeReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getOutcomeReference()) tgt.addOutcomeReference(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/GraphDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/GraphDefinition30_40.java index b4603d489..00a8ee11e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/GraphDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/GraphDefinition30_40.java @@ -96,18 +96,26 @@ public class GraphDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasStart()) tgt.setStartElement(VersionConvertor_30_40.convertCode(src.getStartElement())); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } @@ -130,18 +138,26 @@ public class GraphDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasStart()) tgt.setStartElement(VersionConvertor_30_40.convertCode(src.getStartElement())); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } @@ -160,7 +176,9 @@ public class GraphDefinition30_40 { tgt.setMax(src.getMax()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + } return tgt; } @@ -179,7 +197,9 @@ public class GraphDefinition30_40 { tgt.setMax(src.getMax()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + } return tgt; } @@ -224,8 +244,12 @@ public class GraphDefinition30_40 { tgt.setType(src.getType()); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasCompartment()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + } + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } @@ -238,8 +262,12 @@ public class GraphDefinition30_40 { tgt.setType(src.getType()); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Group30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Group30_40.java index c9d1e2cc4..4c18fc5fe 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Group30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Group30_40.java @@ -10,7 +10,9 @@ public class Group30_40 { return null; org.hl7.fhir.dstu3.model.Group tgt = new org.hl7.fhir.dstu3.model.Group(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasType()) @@ -23,8 +25,12 @@ public class Group30_40 { tgt.setName(src.getName()); if (src.hasQuantity()) tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.r4.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.r4.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -33,7 +39,9 @@ public class Group30_40 { return null; org.hl7.fhir.r4.model.Group tgt = new org.hl7.fhir.r4.model.Group(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasType()) @@ -46,8 +54,12 @@ public class Group30_40 { tgt.setName(src.getName()); if (src.hasQuantity()) tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.dstu3.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.dstu3.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/HealthcareService30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/HealthcareService30_40.java index 40e710023..60897a30b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/HealthcareService30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/HealthcareService30_40.java @@ -12,16 +12,24 @@ public class HealthcareService30_40 { return null; org.hl7.fhir.dstu3.model.HealthcareService tgt = new org.hl7.fhir.dstu3.model.HealthcareService(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasProvidedBy()) tgt.setProvidedBy(VersionConvertor_30_40.convertReference(src.getProvidedBy())); if (src.hasCategory()) tgt.setCategory(VersionConvertor_30_40.convertCodeableConcept(src.getCategoryFirstRep())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasComment()) @@ -30,24 +38,44 @@ public class HealthcareService30_40 { tgt.setExtraDetails(src.getExtraDetails()); if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_40.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasEligibility()) { - tgt.setEligibility(VersionConvertor_30_40.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); + if (src.hasEligibility()) { + tgt.setEligibility(VersionConvertor_30_40.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); + } if (src.getEligibilityFirstRep().hasComment()) tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); } - for (CodeableConcept t : src.getProgram()) tgt.addProgramName(t.getText()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasProgram()) { + for (CodeableConcept t : src.getProgram()) tgt.addProgramName(t.getText()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAppointmentRequired()) tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -56,16 +84,24 @@ public class HealthcareService30_40 { return null; org.hl7.fhir.r4.model.HealthcareService tgt = new org.hl7.fhir.r4.model.HealthcareService(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasProvidedBy()) tgt.setProvidedBy(VersionConvertor_30_40.convertReference(src.getProvidedBy())); if (src.hasCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(src.getCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasComment()) @@ -74,25 +110,45 @@ public class HealthcareService30_40 { tgt.setExtraDetails(src.getExtraDetails()); if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_40.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasEligibility() || src.hasEligibilityNote()) { HealthcareServiceEligibilityComponent t = tgt.addEligibility(); - t.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getEligibility())); + if (src.hasEligibility()) { + t.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getEligibility())); + } if (src.hasEligibilityNote()) t.setComment(src.getEligibilityNote()); } - for (org.hl7.fhir.dstu3.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasProgramName()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAppointmentRequired()) tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -101,7 +157,9 @@ public class HealthcareService30_40 { return null; org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -116,7 +174,9 @@ public class HealthcareService30_40 { return null; org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImagingStudy30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImagingStudy30_40.java index bd50189b5..9b7d2710b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImagingStudy30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImagingStudy30_40.java @@ -2,7 +2,6 @@ package org.hl7.fhir.convertors.conv30_40; import org.hl7.fhir.convertors.VersionConvertor_30_40; import org.hl7.fhir.exceptions.FHIRException; - import java.util.List; public class ImagingStudy30_40 { @@ -179,31 +178,47 @@ public class ImagingStudy30_40 { org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasUid()) { - tgt.setUid(src.getUid()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } } if (src.hasNumber()) { - tgt.setNumber(src.getNumber()); + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } } if (src.hasModality()) { - tgt.setModality(VersionConvertor_30_40.convertCoding(src.getModality())); + if (src.hasModality()) { + tgt.setModality(VersionConvertor_30_40.convertCoding(src.getModality())); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } if (src.hasNumberOfInstances()) { - tgt.setNumberOfInstances(src.getNumberOfInstances()); + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } } for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) { tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); } if (src.hasBodySite()) { - tgt.setBodySite(VersionConvertor_30_40.convertCoding(src.getBodySite())); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_30_40.convertCoding(src.getBodySite())); + } } if (src.hasLaterality()) { - tgt.setLaterality(VersionConvertor_30_40.convertCoding(src.getLaterality())); + if (src.hasLaterality()) { + tgt.setLaterality(VersionConvertor_30_40.convertCoding(src.getLaterality())); + } } if (src.hasStarted()) { - tgt.setStartedElement(VersionConvertor_30_40.convertDateTime(src.getStartedElement())); + if (src.hasStartedElement()) { + tgt.setStartedElement(VersionConvertor_30_40.convertDateTime(src.getStartedElement())); + } } for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) { tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); @@ -217,31 +232,47 @@ public class ImagingStudy30_40 { org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasUid()) { - tgt.setUid(src.getUid()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } } if (src.hasNumber()) { - tgt.setNumber(src.getNumber()); + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } } if (src.hasModality()) { - tgt.setModality(VersionConvertor_30_40.convertCoding(src.getModality())); + if (src.hasModality()) { + tgt.setModality(VersionConvertor_30_40.convertCoding(src.getModality())); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } if (src.hasNumberOfInstances()) { - tgt.setNumberOfInstances(src.getNumberOfInstances()); + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } } for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) { tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); } if (src.hasBodySite()) { - tgt.setBodySite(VersionConvertor_30_40.convertCoding(src.getBodySite())); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_30_40.convertCoding(src.getBodySite())); + } } if (src.hasLaterality()) { - tgt.setLaterality(VersionConvertor_30_40.convertCoding(src.getLaterality())); + if (src.hasLaterality()) { + tgt.setLaterality(VersionConvertor_30_40.convertCoding(src.getLaterality())); + } } if (src.hasStarted()) { - tgt.setStartedElement(VersionConvertor_30_40.convertDateTime(src.getStartedElement())); + if (src.hasStartedElement()) { + tgt.setStartedElement(VersionConvertor_30_40.convertDateTime(src.getStartedElement())); + } } for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) { tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); @@ -255,19 +286,27 @@ public class ImagingStudy30_40 { org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasUid()) { - tgt.setUid(src.getUid()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } } if (src.hasSopClass()) { org.hl7.fhir.r4.model.Coding c = new org.hl7.fhir.r4.model.Coding(); c.setSystem(VersionConvertor_30_40.URN_IETF_RFC_3986); - c.setCode(src.getSopClass()); + if (src.hasSopClass()) { + c.setCode(src.getSopClass()); + } tgt.setSopClass(c); } if (src.hasNumber()) { - tgt.setNumber(src.getNumber()); + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } } if (src.hasTitle()) { - tgt.setTitle(src.getTitle()); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Immunization30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Immunization30_40.java index 3f32b3bc7..aef8d238a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Immunization30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Immunization30_40.java @@ -10,7 +10,9 @@ public class Immunization30_40 { return null; org.hl7.fhir.r4.model.Immunization tgt = new org.hl7.fhir.r4.model.Immunization(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertImmunizationStatus(src.getStatus())); if (src.hasVaccineCode()) @@ -39,9 +41,15 @@ public class Immunization30_40 { tgt.setRoute(VersionConvertor_30_40.convertCodeableConcept(src.getRoute())); if (src.hasDoseQuantity()) tgt.setDoseQuantity(VersionConvertor_30_40.convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationPractitionerComponent t : src.getPractitioner()) tgt.addPerformer(convertImmunizationPractitionerComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getExplanation().getReason()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasPractitioner()) { + for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationPractitionerComponent t : src.getPractitioner()) tgt.addPerformer(convertImmunizationPractitionerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasExplanation()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getExplanation().getReason()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } return tgt; } @@ -50,7 +58,9 @@ public class Immunization30_40 { return null; org.hl7.fhir.dstu3.model.Immunization tgt = new org.hl7.fhir.dstu3.model.Immunization(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertImmunizationStatus(src.getStatus())); if (src.hasVaccineCode()) @@ -79,9 +89,15 @@ public class Immunization30_40 { tgt.setRoute(VersionConvertor_30_40.convertCodeableConcept(src.getRoute())); if (src.hasDoseQuantity()) tgt.setDoseQuantity(VersionConvertor_30_40.convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) tgt.addPractitioner(convertImmunizationPractitionerComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.getExplanation().addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) tgt.addPractitioner(convertImmunizationPractitionerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.getExplanation().addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImplementationGuide30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImplementationGuide30_40.java index 27a6ac578..09b7c9cf1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImplementationGuide30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ImplementationGuide30_40.java @@ -3,7 +3,6 @@ package org.hl7.fhir.convertors.conv30_40; import org.hl7.fhir.convertors.VersionConvertor_30_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Enumeration; - import java.util.List; public class ImplementationGuide30_40 { @@ -27,11 +26,17 @@ public class ImplementationGuide30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) @@ -39,12 +44,18 @@ public class ImplementationGuide30_40 { tgt.setFhirVersion(v.asStringValue()); break; } - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) { findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); } - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + if (src.hasGlobal()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } if (src.getDefinition().hasPage()) tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); return tgt; @@ -69,18 +80,30 @@ public class ImplementationGuide30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) tgt.addFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + if (src.hasDependency()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } if (src.hasPage()) tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); return tgt; @@ -136,7 +159,9 @@ public class ImplementationGuide30_40 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_30_40.copyElement(src, tgt); - tgt.setId(src.getId()); + if (src.hasId()) { + tgt.setId(src.getId()); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasDescription()) @@ -189,7 +214,9 @@ public class ImplementationGuide30_40 { org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasExampleCanonicalType()) { - tgt.setExampleFor(VersionConvertor_30_40.convertCanonicalToReference(src.getExampleCanonicalType())); + if (src.hasExampleCanonicalType()) { + tgt.setExampleFor(VersionConvertor_30_40.convertCanonicalToReference(src.getExampleCanonicalType())); + } tgt.setExample(true); } else if (src.hasExampleBooleanType()) tgt.setExample(src.getExampleBooleanType().getValue()); @@ -215,7 +242,9 @@ public class ImplementationGuide30_40 { tgt.setTitle(src.getTitle()); if (src.hasGeneration()) tgt.setKind(convertPageGeneration(src.getGeneration())); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -230,7 +259,9 @@ public class ImplementationGuide30_40 { tgt.setTitle(src.getTitle()); if (src.hasKind()) tgt.setGeneration(convertPageGeneration(src.getKind())); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Library30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Library30_40.java index 644ddaac2..ea2287a93 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Library30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Library30_40.java @@ -14,7 +14,9 @@ public class Library30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -31,11 +33,17 @@ public class Library30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasUsage()) @@ -48,7 +56,9 @@ public class Library30_40 { tgt.setLastReviewDateElement(VersionConvertor_30_40.convertDate(src.getLastReviewDateElement())); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_40.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + } for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) { org.hl7.fhir.dstu3.model.Contributor c = new org.hl7.fhir.dstu3.model.Contributor(); c.setType(ContributorType.AUTHOR); @@ -73,10 +83,18 @@ public class Library30_40 { c.addContact(VersionConvertor_30_40.convertContactDetail(t)); tgt.addContributor(c); } - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_40.convertParameterDefinition(t)); - for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_40.convertDataRequirement(t)); - for (org.hl7.fhir.r4.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_40.convertAttachment(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_40.convertParameterDefinition(t)); + } + if (src.hasDataRequirement()) { + for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_40.convertDataRequirement(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_40.convertAttachment(t)); + } return tgt; } @@ -87,7 +105,9 @@ public class Library30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -104,11 +124,17 @@ public class Library30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasUsage()) @@ -131,10 +157,18 @@ public class Library30_40 { if (t.getType() == ContributorType.ENDORSER) for (ContactDetail c : t.getContact()) tgt.addEndorser(VersionConvertor_30_40.convertContactDetail(c)); } - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_40.convertParameterDefinition(t)); - for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_40.convertDataRequirement(t)); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_40.convertAttachment(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_40.convertParameterDefinition(t)); + } + if (src.hasDataRequirement()) { + for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_40.convertDataRequirement(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_40.convertAttachment(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Linkage30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Linkage30_40.java index 86f1e76b9..a3e3fbf2b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Linkage30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Linkage30_40.java @@ -14,7 +14,9 @@ public class Linkage30_40 { tgt.setActive(src.getActive()); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); - for (org.hl7.fhir.dstu3.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + } return tgt; } @@ -27,7 +29,9 @@ public class Linkage30_40 { tgt.setActive(src.getActive()); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); - for (org.hl7.fhir.r4.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/List30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/List30_40.java index aad07829e..cf8dd05bd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/List30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/List30_40.java @@ -10,7 +10,9 @@ public class List30_40 { return null; org.hl7.fhir.r4.model.ListResource tgt = new org.hl7.fhir.r4.model.ListResource(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertListStatus(src.getStatus())); if (src.hasMode()) @@ -29,8 +31,12 @@ public class List30_40 { tgt.setSource(VersionConvertor_30_40.convertReference(src.getSource())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_40.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_40.convertCodeableConcept(src.getEmptyReason())); return tgt; @@ -41,7 +47,9 @@ public class List30_40 { return null; org.hl7.fhir.dstu3.model.ListResource tgt = new org.hl7.fhir.dstu3.model.ListResource(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertListStatus(src.getStatus())); if (src.hasMode()) @@ -60,8 +68,12 @@ public class List30_40 { tgt.setSource(VersionConvertor_30_40.convertReference(src.getSource())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_40.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_40.convertCodeableConcept(src.getEmptyReason())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Location30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Location30_40.java index f5f20ec44..4041ed91b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Location30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Location30_40.java @@ -10,21 +10,27 @@ public class Location30_40 { return null; org.hl7.fhir.r4.model.Location tgt = new org.hl7.fhir.r4.model.Location(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertLocationStatus(src.getStatus())); if (src.hasOperationalStatus()) tgt.setOperationalStatus(VersionConvertor_30_40.convertCoding(src.getOperationalStatus())); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + if (src.hasAlias()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasMode()) tgt.setMode(convertLocationMode(src.getMode())); if (src.hasType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_40.convertAddress(src.getAddress())); if (src.hasPhysicalType()) @@ -35,7 +41,9 @@ public class Location30_40 { tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_40.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -44,21 +52,27 @@ public class Location30_40 { return null; org.hl7.fhir.dstu3.model.Location tgt = new org.hl7.fhir.dstu3.model.Location(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertLocationStatus(src.getStatus())); if (src.hasOperationalStatus()) tgt.setOperationalStatus(VersionConvertor_30_40.convertCoding(src.getOperationalStatus())); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + if (src.hasAlias()) { + for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasMode()) tgt.setMode(convertLocationMode(src.getMode())); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getTypeFirstRep())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_40.convertAddress(src.getAddress())); if (src.hasPhysicalType()) @@ -69,7 +83,9 @@ public class Location30_40 { tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_40.convertReference(src.getPartOf())); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Media30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Media30_40.java index bc0794a6e..0aa475f26 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Media30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Media30_40.java @@ -90,51 +90,79 @@ public class Media30_40 { if (src.hasType()) { org.hl7.fhir.r4.model.Coding coding = new org.hl7.fhir.r4.model.Coding(); coding.setSystem(CODE_SYSTEM_MEDIA_TYPE); - coding.setCode(src.getType().toCode().replace("photo", "image")); + if (src.hasType()) { + coding.setCode(src.getType().toCode().replace("photo", "image")); + } CodeableConcept codeableConcept = new CodeableConcept(coding); tgt.setType(codeableConcept); } if (src.hasSubtype()) { - tgt.setModality(VersionConvertor_30_40.convertCodeableConcept(src.getSubtype())); + if (src.hasSubtype()) { + tgt.setModality(VersionConvertor_30_40.convertCodeableConcept(src.getSubtype())); + } } if (src.hasView()) { - tgt.setView(VersionConvertor_30_40.convertCodeableConcept(src.getView())); + if (src.hasView()) { + tgt.setView(VersionConvertor_30_40.convertCodeableConcept(src.getView())); + } } if (src.hasSubject()) { - tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); + } } if (src.hasContext()) { - tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getContext())); + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getContext())); + } } if (src.hasOccurrence()) { - tgt.setCreated(VersionConvertor_30_40.convertType(src.getOccurrence())); + if (src.hasOccurrence()) { + tgt.setCreated(VersionConvertor_30_40.convertType(src.getOccurrence())); + } } if (src.hasOperator()) { - tgt.setOperator(VersionConvertor_30_40.convertReference(src.getOperator())); + if (src.hasOperator()) { + tgt.setOperator(VersionConvertor_30_40.convertReference(src.getOperator())); + } } for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) { tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); } if (src.hasBodySite()) { - tgt.setBodySite(VersionConvertor_30_40.convertCodeableConcept(src.getBodySite())); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_30_40.convertCodeableConcept(src.getBodySite())); + } } if (src.hasDevice()) { - tgt.setDevice(VersionConvertor_30_40.convertReference(src.getDevice())); + if (src.hasDevice()) { + tgt.setDevice(VersionConvertor_30_40.convertReference(src.getDevice())); + } } if (src.hasHeight()) { - tgt.setHeight(src.getHeight()); + if (src.hasHeight()) { + tgt.setHeight(src.getHeight()); + } } if (src.hasWidth()) { - tgt.setWidth(src.getWidth()); + if (src.hasWidth()) { + tgt.setWidth(src.getWidth()); + } } if (src.hasFrames()) { - tgt.setFrames(src.getFrames()); + if (src.hasFrames()) { + tgt.setFrames(src.getFrames()); + } } if (src.hasDuration()) { - tgt.setDuration(src.getDuration()); + if (src.hasDuration()) { + tgt.setDuration(src.getDuration()); + } } if (src.hasContent()) { - tgt.setContent(VersionConvertor_30_40.convertAttachment(src.getContent())); + if (src.hasContent()) { + tgt.setContent(VersionConvertor_30_40.convertAttachment(src.getContent())); + } } for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) { tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Medication30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Medication30_40.java index 674e5153f..85fbaff6a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Medication30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Medication30_40.java @@ -18,7 +18,9 @@ public class Medication30_40 { tgt.setManufacturer(VersionConvertor_30_40.convertReference(src.getManufacturer())); if (src.hasForm()) tgt.setForm(VersionConvertor_30_40.convertCodeableConcept(src.getForm())); - for (org.hl7.fhir.dstu3.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu3.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + } if (src.hasPackage()) tgt.setBatch(convertMedicationPackageBatchComponent(src.getPackage().getBatchFirstRep())); return tgt; @@ -37,7 +39,9 @@ public class Medication30_40 { tgt.setManufacturer(VersionConvertor_30_40.convertReference(src.getManufacturer())); if (src.hasForm()) tgt.setForm(VersionConvertor_30_40.convertCodeableConcept(src.getForm())); - for (org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + if (src.hasIngredient()) { + for (org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + } if (src.hasBatch()) tgt.getPackage().addBatch(convertMedicationPackageBatchComponent(src.getBatch())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationAdministration30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationAdministration30_40.java index 9e7d8ca26..405298fa1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationAdministration30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationAdministration30_40.java @@ -10,9 +10,15 @@ public class MedicationAdministration30_40 { return null; org.hl7.fhir.dstu3.model.MedicationAdministration tgt = new org.hl7.fhir.dstu3.model.MedicationAdministration(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) tgt.addDefinition().setReference(t.getValue()); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasInstantiates()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) tgt.addDefinition().setReference(t.getValue()); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertMedicationAdministrationStatus(src.getStatus())); if (src.hasCategory()) @@ -23,19 +29,33 @@ public class MedicationAdministration30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasContext()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getContext())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasEffective()) tgt.setEffective(VersionConvertor_30_40.convertType(src.getEffective())); - for (org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } if (src.hasRequest()) tgt.setPrescription(VersionConvertor_30_40.convertReference(src.getRequest())); - for (org.hl7.fhir.r4.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasDevice()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } if (src.hasDosage()) tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); - for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + if (src.hasEventHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -44,9 +64,15 @@ public class MedicationAdministration30_40 { return null; org.hl7.fhir.r4.model.MedicationAdministration tgt = new org.hl7.fhir.r4.model.MedicationAdministration(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiates(t.getReference()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiates(t.getReference()); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertMedicationAdministrationStatus(src.getStatus())); if (src.hasCategory()) @@ -57,19 +83,33 @@ public class MedicationAdministration30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasContext()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getContext())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasEffective()) tgt.setEffective(VersionConvertor_30_40.convertType(src.getEffective())); - for (org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } if (src.hasPrescription()) tgt.setRequest(VersionConvertor_30_40.convertReference(src.getPrescription())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasDevice()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } if (src.hasDosage()) tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + if (src.hasEventHistory()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationDispense30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationDispense30_40.java index 7e67ddfb5..93146df8b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationDispense30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationDispense30_40.java @@ -10,8 +10,12 @@ public class MedicationDispense30_40 { return null; org.hl7.fhir.dstu3.model.MedicationDispense tgt = new org.hl7.fhir.dstu3.model.MedicationDispense(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); if (src.hasCategory()) @@ -22,9 +26,15 @@ public class MedicationDispense30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasContext()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getContext())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_40.convertReference(t)); + } if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); if (src.hasQuantity()) @@ -37,13 +47,23 @@ public class MedicationDispense30_40 { tgt.setWhenHandedOverElement(VersionConvertor_30_40.convertDateTime(src.getWhenHandedOverElement())); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_40.convertReference(src.getDestination())); - for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + } if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); - for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -52,8 +72,12 @@ public class MedicationDispense30_40 { return null; org.hl7.fhir.r4.model.MedicationDispense tgt = new org.hl7.fhir.r4.model.MedicationDispense(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); if (src.hasCategory()) @@ -64,9 +88,15 @@ public class MedicationDispense30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasContext()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getContext())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_40.convertReference(t)); + } if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); if (src.hasQuantity()) @@ -79,13 +109,23 @@ public class MedicationDispense30_40 { tgt.setWhenHandedOverElement(VersionConvertor_30_40.convertDateTime(src.getWhenHandedOverElement())); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_40.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + } if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -130,8 +170,12 @@ public class MedicationDispense30_40 { tgt.setWasSubstituted(src.getWasSubstituted()); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_30_40.convertReference(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -144,8 +188,12 @@ public class MedicationDispense30_40 { tgt.setWasSubstituted(src.getWasSubstituted()); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_30_40.convertReference(t)); + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.r4.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_30_40.convertReference(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationRequest30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationRequest30_40.java index bd8a9dde3..a51c38c3f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationRequest30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationRequest30_40.java @@ -10,8 +10,12 @@ public class MedicationRequest30_40 { return null; org.hl7.fhir.r4.model.MedicationRequest tgt = new org.hl7.fhir.r4.model.MedicationRequest(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } if (src.hasGroupIdentifier()) tgt.setGroupIdentifier(VersionConvertor_30_40.convertIdentifier(src.getGroupIdentifier())); if (src.hasStatus()) @@ -26,23 +30,37 @@ public class MedicationRequest30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasContext()) tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getContext())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasAuthoredOn()) tgt.setAuthoredOnElement(VersionConvertor_30_40.convertDateTime(src.getAuthoredOnElement())); if (src.hasRecorder()) tgt.setRecorder(VersionConvertor_30_40.convertReference(src.getRecorder())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + } if (src.hasDispenseRequest()) tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); if (src.hasPriorPrescription()) tgt.setPriorPrescription(VersionConvertor_30_40.convertReference(src.getPriorPrescription())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -51,8 +69,12 @@ public class MedicationRequest30_40 { return null; org.hl7.fhir.dstu3.model.MedicationRequest tgt = new org.hl7.fhir.dstu3.model.MedicationRequest(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } if (src.hasGroupIdentifier()) tgt.setGroupIdentifier(VersionConvertor_30_40.convertIdentifier(src.getGroupIdentifier())); if (src.hasStatus()) @@ -67,23 +89,37 @@ public class MedicationRequest30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasEncounter()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getEncounter())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_40.convertReference(t)); + } if (src.hasAuthoredOn()) tgt.setAuthoredOnElement(VersionConvertor_30_40.convertDateTime(src.getAuthoredOnElement())); if (src.hasRecorder()) tgt.setRecorder(VersionConvertor_30_40.convertReference(src.getRecorder())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_40.convertDosage(t)); + } if (src.hasDispenseRequest()) tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); if (src.hasPriorPrescription()) tgt.setPriorPrescription(VersionConvertor_30_40.convertReference(src.getPriorPrescription())); - for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationStatement30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationStatement30_40.java index 6b22144e4..7d9fc34d2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationStatement30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MedicationStatement30_40.java @@ -10,9 +10,15 @@ public class MedicationStatement30_40 { return null; org.hl7.fhir.dstu3.model.MedicationStatement tgt = new org.hl7.fhir.dstu3.model.MedicationStatement(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasContext()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getContext())); if (src.hasStatus()) @@ -29,11 +35,21 @@ public class MedicationStatement30_40 { tgt.setInformationSource(VersionConvertor_30_40.convertReference(src.getInformationSource())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasDosage()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); + } return tgt; } @@ -42,9 +58,15 @@ public class MedicationStatement30_40 { return null; org.hl7.fhir.r4.model.MedicationStatement tgt = new org.hl7.fhir.r4.model.MedicationStatement(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasContext()) tgt.setContext(VersionConvertor_30_40.convertReference(src.getContext())); if (src.hasStatus()) @@ -61,11 +83,21 @@ public class MedicationStatement30_40 { tgt.setInformationSource(VersionConvertor_30_40.convertReference(src.getInformationSource())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } + if (src.hasDosage()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_40.convertDosage(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageDefinition30_40.java index eb35738db..a973da45c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageDefinition30_40.java @@ -28,27 +28,41 @@ public class MessageDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasBase()) tgt.setBase(VersionConvertor_30_40.convertCanonicalToReference(src.getBaseElement())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getParent()) tgt.addParent(VersionConvertor_30_40.convertCanonicalToReference(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getReplaces()) tgt.addReplaces(VersionConvertor_30_40.convertCanonicalToReference(t)); + if (src.hasParent()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getParent()) tgt.addParent(VersionConvertor_30_40.convertCanonicalToReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getReplaces()) tgt.addReplaces(VersionConvertor_30_40.convertCanonicalToReference(t)); + } if (src.hasEventCoding()) tgt.setEvent(VersionConvertor_30_40.convertCoding(src.getEventCoding())); if (src.hasCategory()) tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + } if (src.hasResponseRequired()) tgt.setResponseRequired(src.getResponseRequired() != org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + if (src.hasAllowedResponse()) { + for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + } return tgt; } @@ -75,27 +89,41 @@ public class MessageDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasBase()) tgt.setBaseElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getBase())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.getParent().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReplaces()) tgt.getReplaces().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); + if (src.hasParent()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.getParent().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReplaces()) tgt.getReplaces().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); + } if (src.hasEvent()) tgt.setEvent(VersionConvertor_30_40.convertCoding(src.getEvent())); if (src.hasCategory()) tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + } if (src.hasResponseRequired()) tgt.setResponseRequired(src.getResponseRequired() ? org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS : org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + if (src.hasAllowedResponse()) { + for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageHeader30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageHeader30_40.java index d265ecaff..965aef3b6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageHeader30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/MessageHeader30_40.java @@ -40,7 +40,9 @@ public class MessageHeader30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasEventCoding()) tgt.setEvent(VersionConvertor_30_40.convertCoding(src.getEventCoding())); - for (org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + if (src.hasDestination()) { + for (org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } if (src.hasSender()) tgt.setSender(VersionConvertor_30_40.convertReference(src.getSender())); if (src.hasEnterer()) @@ -55,7 +57,9 @@ public class MessageHeader30_40 { tgt.setReason(VersionConvertor_30_40.convertCodeableConcept(src.getReason())); if (src.hasResponse()) tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_40.convertReference(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -66,7 +70,9 @@ public class MessageHeader30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasEvent()) tgt.setEvent(VersionConvertor_30_40.convertCoding(src.getEvent())); - for (org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + if (src.hasDestination()) { + for (org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } if (src.hasSender()) tgt.setSender(VersionConvertor_30_40.convertReference(src.getSender())); if (src.hasEnterer()) @@ -81,7 +87,9 @@ public class MessageHeader30_40 { tgt.setReason(VersionConvertor_30_40.convertCodeableConcept(src.getReason())); if (src.hasResponse()) tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_40.convertReference(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/NamingSystem30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/NamingSystem30_40.java index 175a529f6..8b06df20c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/NamingSystem30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/NamingSystem30_40.java @@ -20,18 +20,26 @@ public class NamingSystem30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -50,18 +58,26 @@ public class NamingSystem30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Observation30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Observation30_40.java index 60f1cd55c..dd01c0c51 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Observation30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Observation30_40.java @@ -10,11 +10,17 @@ public class Observation30_40 { return null; org.hl7.fhir.r4.model.Observation tgt = new org.hl7.fhir.r4.model.Observation(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasSubject()) @@ -25,7 +31,9 @@ public class Observation30_40 { tgt.setEffective(VersionConvertor_30_40.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssuedElement(VersionConvertor_30_40.convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_40.convertReference(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_40.convertReference(t)); + } if (src.hasValue()) tgt.setValue(VersionConvertor_30_40.convertType(src.getValue())); if (src.hasDataAbsentReason()) @@ -42,12 +50,16 @@ public class Observation30_40 { tgt.setSpecimen(VersionConvertor_30_40.convertReference(src.getSpecimen())); if (src.hasDevice()) tgt.setDevice(VersionConvertor_30_40.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } for (org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent t : src.getRelated()) if (t.getType() == org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.HASMEMBER) tgt.addHasMember(VersionConvertor_30_40.convertReference(t.getTarget())); else if (t.getType() == org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.DERIVEDFROM) tgt.addDerivedFrom(VersionConvertor_30_40.convertReference(t.getTarget())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasComponent()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -56,11 +68,17 @@ public class Observation30_40 { return null; org.hl7.fhir.dstu3.model.Observation tgt = new org.hl7.fhir.dstu3.model.Observation(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasSubject()) @@ -71,7 +89,9 @@ public class Observation30_40 { tgt.setEffective(VersionConvertor_30_40.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssuedElement(VersionConvertor_30_40.convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_40.convertReference(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_40.convertReference(t)); + } if (src.hasValue()) tgt.setValue(VersionConvertor_30_40.convertType(src.getValue())); if (src.hasDataAbsentReason()) @@ -88,10 +108,18 @@ public class Observation30_40 { tgt.setSpecimen(VersionConvertor_30_40.convertReference(src.getSpecimen())); if (src.hasDevice()) tgt.setDevice(VersionConvertor_30_40.convertReference(src.getDevice())); - for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.HASMEMBER)); - for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.DERIVEDFROM)); - for (org.hl7.fhir.r4.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasHasMember()) { + for (org.hl7.fhir.r4.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.HASMEMBER)); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.DERIVEDFROM)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r4.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -108,7 +136,9 @@ public class Observation30_40 { tgt.setDataAbsentReason(VersionConvertor_30_40.convertCodeableConcept(src.getDataAbsentReason())); if (src.hasInterpretation()) tgt.setInterpretation(VersionConvertor_30_40.convertCodeableConcept(src.getInterpretationFirstRep())); - for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -125,7 +155,9 @@ public class Observation30_40 { tgt.setDataAbsentReason(VersionConvertor_30_40.convertCodeableConcept(src.getDataAbsentReason())); if (src.hasInterpretation()) tgt.addInterpretation(VersionConvertor_30_40.convertCodeableConcept(src.getInterpretation())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -140,7 +172,9 @@ public class Observation30_40 { tgt.setHigh(VersionConvertor_30_40.convertSimpleQuantity(src.getHigh())); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAge()) tgt.setAge(VersionConvertor_30_40.convertRange(src.getAge())); if (src.hasText()) @@ -159,7 +193,9 @@ public class Observation30_40 { tgt.setHigh(VersionConvertor_30_40.convertSimpleQuantity(src.getHigh())); if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAge()) tgt.setAge(VersionConvertor_30_40.convertRange(src.getAge())); if (src.hasText()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationDefinition30_40.java index 638664656..0cee2e4c1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationDefinition30_40.java @@ -28,11 +28,17 @@ public class OperationDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasIdempotent()) @@ -43,15 +49,21 @@ public class OperationDefinition30_40 { tgt.setComment(src.getComment()); if (src.hasBase()) tgt.setBaseElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getBase())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + } if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasType()) tgt.setType(src.getType()); if (src.hasInstance()) tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } + if (src.hasOverload()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + } return tgt; } @@ -76,11 +88,17 @@ public class OperationDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasAffectsState()) @@ -91,15 +109,21 @@ public class OperationDefinition30_40 { tgt.setComment(src.getComment()); if (src.hasBase()) tgt.setBase(VersionConvertor_30_40.convertCanonicalToReference(src.getBaseElement())); - for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + } if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasType()) tgt.setType(src.getType()); if (src.hasInstance()) tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } + if (src.hasOverload()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + } return tgt; } @@ -108,7 +132,9 @@ public class OperationDefinition30_40 { return null; org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + if (src.hasParameterName()) { + for (org.hl7.fhir.r4.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + } if (src.hasComment()) tgt.setComment(src.getComment()); return tgt; @@ -119,7 +145,9 @@ public class OperationDefinition30_40 { return null; org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + if (src.hasParameterName()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + } if (src.hasComment()) tgt.setComment(src.getComment()); return tgt; @@ -179,10 +207,14 @@ public class OperationDefinition30_40 { tgt.setType(src.getType()); if (src.hasSearchType()) tgt.setSearchType(VersionConvertor_30_40.convertSearchParamType(src.getSearchType())); - for (org.hl7.fhir.r4.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r4.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + } if (src.hasBinding()) tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -209,7 +241,9 @@ public class OperationDefinition30_40 { tgt.addTargetProfile(src.getProfile().getReference()); if (src.hasBinding()) tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationOutcome30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationOutcome30_40.java index 1b6cdad99..e480014b9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationOutcome30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/OperationOutcome30_40.java @@ -178,7 +178,9 @@ public class OperationOutcome30_40 { return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome30_40 { return null; org.hl7.fhir.r4.model.OperationOutcome tgt = new org.hl7.fhir.r4.model.OperationOutcome(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -204,8 +208,12 @@ public class OperationOutcome30_40 { tgt.setDetails(VersionConvertor_30_40.convertCodeableConcept(src.getDetails())); if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.r4.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.r4.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + } return tgt; } @@ -222,8 +230,12 @@ public class OperationOutcome30_40 { tgt.setDetails(VersionConvertor_30_40.convertCodeableConcept(src.getDetails())); if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Organization30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Organization30_40.java index c1af520f9..c2f2f6cd8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Organization30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Organization30_40.java @@ -10,19 +10,33 @@ public class Organization30_40 { return null; org.hl7.fhir.dstu3.model.Organization tgt = new org.hl7.fhir.dstu3.model.Organization(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasAlias()) { + for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_40.convertReference(src.getPartOf())); - for (org.hl7.fhir.r4.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -31,19 +45,33 @@ public class Organization30_40 { return null; org.hl7.fhir.r4.model.Organization tgt = new org.hl7.fhir.r4.model.Organization(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasAlias()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_40.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -56,7 +84,9 @@ public class Organization30_40 { tgt.setPurpose(VersionConvertor_30_40.convertCodeableConcept(src.getPurpose())); if (src.hasName()) tgt.setName(VersionConvertor_30_40.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_40.convertAddress(src.getAddress())); return tgt; @@ -71,7 +101,9 @@ public class Organization30_40 { tgt.setPurpose(VersionConvertor_30_40.convertCodeableConcept(src.getPurpose())); if (src.hasName()) tgt.setName(VersionConvertor_30_40.convertHumanName(src.getName())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_40.convertAddress(src.getAddress())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Parameters30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Parameters30_40.java index e384d3bd7..0e3300d2c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Parameters30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Parameters30_40.java @@ -10,7 +10,9 @@ public class Parameters30_40 { return null; org.hl7.fhir.dstu3.model.Parameters tgt = new org.hl7.fhir.dstu3.model.Parameters(); VersionConvertor_30_40.copyResource(src, tgt); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters30_40 { return null; org.hl7.fhir.r4.model.Parameters tgt = new org.hl7.fhir.r4.model.Parameters(); VersionConvertor_30_40.copyResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -34,7 +38,9 @@ public class Parameters30_40 { tgt.setValue(VersionConvertor_30_40.convertType(src.getValue())); if (src.hasResource()) tgt.setResource(VersionConvertor_30_40.convertResource(src.getResource(), false)); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -49,7 +55,9 @@ public class Parameters30_40 { tgt.setValue(VersionConvertor_30_40.convertType(src.getValue())); if (src.hasResource()) tgt.setResource(VersionConvertor_30_40.convertResource(src.getResource(), false)); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Patient30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Patient30_40.java index c7892613f..45dbaff03 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Patient30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Patient30_40.java @@ -39,10 +39,14 @@ public class Patient30_40 { return null; org.hl7.fhir.r4.model.Patient.ContactComponent tgt = new org.hl7.fhir.r4.model.Patient.ContactComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasRelationship()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(VersionConvertor_30_40.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_40.convertAddress(src.getAddress())); if (src.hasGender()) @@ -59,10 +63,14 @@ public class Patient30_40 { return null; org.hl7.fhir.dstu3.model.Patient.ContactComponent tgt = new org.hl7.fhir.dstu3.model.Patient.ContactComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasRelationship()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(VersionConvertor_30_40.convertHumanName(src.getName())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_40.convertAddress(src.getAddress())); if (src.hasGender()) @@ -113,31 +121,49 @@ public class Patient30_40 { return null; org.hl7.fhir.dstu3.model.Patient tgt = new org.hl7.fhir.dstu3.model.Patient(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDateElement(VersionConvertor_30_40.convertDate(src.getBirthDateElement())); if (src.hasDeceased()) tgt.setDeceased(VersionConvertor_30_40.convertType(src.getDeceased())); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasMaritalStatus()) tgt.setMaritalStatus(VersionConvertor_30_40.convertCodeableConcept(src.getMaritalStatus())); if (src.hasMultipleBirth()) tgt.setMultipleBirth(VersionConvertor_30_40.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); - for (org.hl7.fhir.r4.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/patient-animal")) tgt.setAnimal(convertAnimalComponent(src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-animal"))); - for (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_40.convertReference(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.r4.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_40.convertReference(t)); + } if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r4.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -146,31 +172,49 @@ public class Patient30_40 { return null; org.hl7.fhir.r4.model.Patient tgt = new org.hl7.fhir.r4.model.Patient(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDateElement(VersionConvertor_30_40.convertDate(src.getBirthDateElement())); if (src.hasDeceased()) tgt.setDeceased(VersionConvertor_30_40.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasMaritalStatus()) tgt.setMaritalStatus(VersionConvertor_30_40.convertCodeableConcept(src.getMaritalStatus())); if (src.hasMultipleBirth()) tgt.setMultipleBirth(VersionConvertor_30_40.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); - for (org.hl7.fhir.dstu3.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasAnimal()) tgt.addExtension(convertAnimalComponent(src.getAnimal())); - for (org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_40.convertReference(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_40.convertReference(t)); + } if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PaymentNotice30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PaymentNotice30_40.java index d66feaac6..8da276467 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PaymentNotice30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PaymentNotice30_40.java @@ -10,7 +10,9 @@ public class PaymentNotice30_40 { return null; org.hl7.fhir.r4.model.PaymentNotice tgt = new org.hl7.fhir.r4.model.PaymentNotice(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); if (src.hasRequest()) @@ -35,7 +37,9 @@ public class PaymentNotice30_40 { return null; org.hl7.fhir.dstu3.model.PaymentNotice tgt = new org.hl7.fhir.dstu3.model.PaymentNotice(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); if (src.hasRequest()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Person30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Person30_40.java index 1fe7bbe88..7d17b4974 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Person30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Person30_40.java @@ -44,21 +44,31 @@ public class Person30_40 { return null; org.hl7.fhir.r4.model.Person tgt = new org.hl7.fhir.r4.model.Person(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDateElement(VersionConvertor_30_40.convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_40.convertAttachment(src.getPhoto())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -67,21 +77,31 @@ public class Person30_40 { return null; org.hl7.fhir.dstu3.model.Person tgt = new org.hl7.fhir.dstu3.model.Person(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDateElement(VersionConvertor_30_40.convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_40.convertAttachment(src.getPhoto())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_40.convertReference(src.getManagingOrganization())); if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r4.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PlanDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PlanDefinition30_40.java index bcb3b4f42..5a1e59a92 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PlanDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PlanDefinition30_40.java @@ -282,7 +282,9 @@ public class PlanDefinition30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -311,9 +313,15 @@ public class PlanDefinition30_40 { tgt.setLastReviewDateElement(VersionConvertor_30_40.convertDate(src.getLastReviewDateElement())); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_40.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + } for (org.hl7.fhir.dstu3.model.Contributor t : src.getContributor()) { if (t.getType() == ContributorType.AUTHOR) for (ContactDetail c : t.getContact()) tgt.addAuthor(VersionConvertor_30_40.convertContactDetail(c)); @@ -324,13 +332,23 @@ public class PlanDefinition30_40 { if (t.getType() == ContributorType.ENDORSER) for (ContactDetail c : t.getContact()) tgt.addEndorser(VersionConvertor_30_40.convertContactDetail(c)); } - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_40.convertReferenceToCanonical(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -341,7 +359,9 @@ public class PlanDefinition30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -370,9 +390,15 @@ public class PlanDefinition30_40 { tgt.setLastReviewDateElement(VersionConvertor_30_40.convertDate(src.getLastReviewDateElement())); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_40.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_40.convertCodeableConcept(t)); + } for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) { org.hl7.fhir.dstu3.model.Contributor c = new org.hl7.fhir.dstu3.model.Contributor(); c.setType(ContributorType.AUTHOR); @@ -397,13 +423,23 @@ public class PlanDefinition30_40 { c.addContact(VersionConvertor_30_40.convertContactDetail(t)); tgt.addContributor(c); } - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_40.convertCanonicalToReference(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_40.convertCanonicalToReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -420,18 +456,38 @@ public class PlanDefinition30_40 { tgt.setDescription(src.getDescription()); if (src.hasTextEquivalent()) tgt.setTextEquivalent(src.getTextEquivalent()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); - for (org.hl7.fhir.dstu3.model.TriggerDefinition t : src.getTriggerDefinition()) tgt.addTrigger(VersionConvertor_30_40.convertTriggerDefinition(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); - for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_40.convertDataRequirement(t)); - for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_40.convertDataRequirement(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasGoalId()) { + for (org.hl7.fhir.dstu3.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); + } + if (src.hasTriggerDefinition()) { + for (org.hl7.fhir.dstu3.model.TriggerDefinition t : src.getTriggerDefinition()) tgt.addTrigger(VersionConvertor_30_40.convertTriggerDefinition(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + } + if (src.hasInput()) { + for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_40.convertDataRequirement(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_40.convertDataRequirement(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + } if (src.hasTiming()) tgt.setTiming(VersionConvertor_30_40.convertType(src.getTiming())); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + } if (src.hasType()) tgt.getType().addCoding(VersionConvertor_30_40.convertCoding(src.getType())); if (src.hasGroupingBehavior()) @@ -448,8 +504,12 @@ public class PlanDefinition30_40 { tgt.setDefinition(VersionConvertor_30_40.convertReferenceToCanonical(src.getDefinition())); if (src.hasTransform()) tgt.setTransformElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getTransform())); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -466,18 +526,38 @@ public class PlanDefinition30_40 { tgt.setDescription(src.getDescription()); if (src.hasTextEquivalent()) tgt.setTextEquivalent(src.getTextEquivalent()); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); - for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger()) tgt.addTriggerDefinition(VersionConvertor_30_40.convertTriggerDefinition(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); - for (org.hl7.fhir.r4.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_40.convertDataRequirement(t)); - for (org.hl7.fhir.r4.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_40.convertDataRequirement(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasGoalId()) { + for (org.hl7.fhir.r4.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); + } + if (src.hasTrigger()) { + for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger()) tgt.addTriggerDefinition(VersionConvertor_30_40.convertTriggerDefinition(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + } + if (src.hasInput()) { + for (org.hl7.fhir.r4.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_40.convertDataRequirement(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.r4.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_40.convertDataRequirement(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + } if (src.hasTiming()) tgt.setTiming(VersionConvertor_30_40.convertType(src.getTiming())); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + } if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertCoding(src.getType().getCodingFirstRep())); if (src.hasGroupingBehavior()) @@ -494,8 +574,12 @@ public class PlanDefinition30_40 { tgt.setDefinition(VersionConvertor_30_40.convertCanonicalToReference(src.getDefinitionCanonicalType())); if (src.hasTransform()) tgt.setTransform(VersionConvertor_30_40.convertCanonicalToReference(src.getTransformElement())); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -628,9 +712,15 @@ public class PlanDefinition30_40 { tgt.setPriority(VersionConvertor_30_40.convertCodeableConcept(src.getPriority())); if (src.hasStart()) tgt.setStart(VersionConvertor_30_40.convertCodeableConcept(src.getStart())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + } return tgt; } @@ -647,9 +737,15 @@ public class PlanDefinition30_40 { tgt.setPriority(VersionConvertor_30_40.convertCodeableConcept(src.getPriority())); if (src.hasStart()) tgt.setStart(VersionConvertor_30_40.convertCodeableConcept(src.getStart())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_40.convertRelatedArtifact(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Practitioner30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Practitioner30_40.java index d8994d096..5f96640a8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Practitioner30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Practitioner30_40.java @@ -10,19 +10,33 @@ public class Practitioner30_40 { return null; org.hl7.fhir.r4.model.Practitioner tgt = new org.hl7.fhir.r4.model.Practitioner(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDateElement(VersionConvertor_30_40.convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); - for (org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_40.convertCodeableConcept(t)); + } return tgt; } @@ -31,19 +45,33 @@ public class Practitioner30_40 { return null; org.hl7.fhir.dstu3.model.Practitioner tgt = new org.hl7.fhir.dstu3.model.Practitioner(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_40.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_40.convertAddress(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDateElement(VersionConvertor_30_40.convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); - for (org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_40.convertCodeableConcept(t)); + } return tgt; } @@ -52,7 +80,9 @@ public class Practitioner30_40 { return null; org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasPeriod()) @@ -67,7 +97,9 @@ public class Practitioner30_40 { return null; org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasPeriod()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PractitionerRole30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PractitionerRole30_40.java index a588f942b..12b48910e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PractitionerRole30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/PractitionerRole30_40.java @@ -10,7 +10,9 @@ public class PractitionerRole30_40 { return null; org.hl7.fhir.r4.model.PractitionerRole tgt = new org.hl7.fhir.r4.model.PractitionerRole(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasPeriod()) @@ -19,16 +21,32 @@ public class PractitionerRole30_40 { tgt.setPractitioner(VersionConvertor_30_40.convertReference(src.getPractitioner())); if (src.hasOrganization()) tgt.setOrganization(VersionConvertor_30_40.convertReference(src.getOrganization())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -37,7 +55,9 @@ public class PractitionerRole30_40 { return null; org.hl7.fhir.dstu3.model.PractitionerRole tgt = new org.hl7.fhir.dstu3.model.PractitionerRole(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasPeriod()) @@ -46,16 +66,32 @@ public class PractitionerRole30_40 { tgt.setPractitioner(VersionConvertor_30_40.convertReference(src.getPractitioner())); if (src.hasOrganization()) tgt.setOrganization(VersionConvertor_30_40.convertReference(src.getOrganization())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); - for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); - for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.r4.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -64,7 +100,9 @@ public class PractitionerRole30_40 { return null; org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -79,7 +117,9 @@ public class PractitionerRole30_40 { return null; org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_40.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_40.convertDaysOfWeek(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Procedure30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Procedure30_40.java index ae41b6008..0fb4bd382 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Procedure30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Procedure30_40.java @@ -22,31 +22,47 @@ public class Procedure30_40 { if (src.getNotDone()) { tgt.setStatus(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NOTDONE); } else { - tgt.setStatus(convertProcedureStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertProcedureStatus(src.getStatus())); + } } if (src.hasNotDoneReason()) { - tgt.setStatusReason(VersionConvertor_30_40.convertCodeableConcept(src.getNotDoneReason())); + if (src.hasNotDoneReason()) { + tgt.setStatusReason(VersionConvertor_30_40.convertCodeableConcept(src.getNotDoneReason())); + } } if (src.hasCategory()) { - tgt.setCategory(VersionConvertor_30_40.convertCodeableConcept(src.getCategory())); + if (src.hasCategory()) { + tgt.setCategory(VersionConvertor_30_40.convertCodeableConcept(src.getCategory())); + } } if (src.hasCode()) { - tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); + } } if (src.hasSubject()) { - tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); + } } if (src.hasContext()) { - tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getContext())); + if (src.hasContext()) { + tgt.setEncounter(VersionConvertor_30_40.convertReference(src.getContext())); + } } if (src.hasPerformed()) { - tgt.setPerformed(VersionConvertor_30_40.convertType(src.getPerformed())); + if (src.hasPerformed()) { + tgt.setPerformed(VersionConvertor_30_40.convertType(src.getPerformed())); + } } for (org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) { tgt.addPerformer(convertProcedurePerformerComponent(t)); } if (src.hasLocation()) { - tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); + } } for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) { tgt.addReasonCode(VersionConvertor_30_40.convertCodeableConcept(t)); @@ -58,7 +74,9 @@ public class Procedure30_40 { tgt.addBodySite(VersionConvertor_30_40.convertCodeableConcept(t)); } if (src.hasOutcome()) { - tgt.setOutcome(VersionConvertor_30_40.convertCodeableConcept(src.getOutcome())); + if (src.hasOutcome()) { + tgt.setOutcome(VersionConvertor_30_40.convertCodeableConcept(src.getOutcome())); + } } for (org.hl7.fhir.dstu3.model.Reference t : src.getReport()) { tgt.addReport(VersionConvertor_30_40.convertReference(t)); @@ -178,10 +196,14 @@ public class Procedure30_40 { org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasAction()) { - tgt.setAction(VersionConvertor_30_40.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_30_40.convertCodeableConcept(src.getAction())); + } } if (src.hasManipulated()) { - tgt.setManipulated(VersionConvertor_30_40.convertReference(src.getManipulated())); + if (src.hasManipulated()) { + tgt.setManipulated(VersionConvertor_30_40.convertReference(src.getManipulated())); + } } return tgt; } @@ -192,10 +214,14 @@ public class Procedure30_40 { org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasAction()) { - tgt.setAction(VersionConvertor_30_40.convertCodeableConcept(src.getAction())); + if (src.hasAction()) { + tgt.setAction(VersionConvertor_30_40.convertCodeableConcept(src.getAction())); + } } if (src.hasManipulated()) { - tgt.setManipulated(VersionConvertor_30_40.convertReference(src.getManipulated())); + if (src.hasManipulated()) { + tgt.setManipulated(VersionConvertor_30_40.convertReference(src.getManipulated())); + } } return tgt; } @@ -206,13 +232,19 @@ public class Procedure30_40 { org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasRole()) { - tgt.setFunction(VersionConvertor_30_40.convertCodeableConcept(src.getRole())); + if (src.hasRole()) { + tgt.setFunction(VersionConvertor_30_40.convertCodeableConcept(src.getRole())); + } } if (src.hasActor()) { - tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); + if (src.hasActor()) { + tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); + } } if (src.hasOnBehalfOf()) { - tgt.setOnBehalfOf(VersionConvertor_30_40.convertReference(src.getOnBehalfOf())); + if (src.hasOnBehalfOf()) { + tgt.setOnBehalfOf(VersionConvertor_30_40.convertReference(src.getOnBehalfOf())); + } } return tgt; } @@ -223,13 +255,19 @@ public class Procedure30_40 { org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent(); VersionConvertor_30_40.copyElement(src, tgt); if (src.hasFunction()) { - tgt.setRole(VersionConvertor_30_40.convertCodeableConcept(src.getFunction())); + if (src.hasFunction()) { + tgt.setRole(VersionConvertor_30_40.convertCodeableConcept(src.getFunction())); + } } if (src.hasActor()) { - tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); + if (src.hasActor()) { + tgt.setActor(VersionConvertor_30_40.convertReference(src.getActor())); + } } if (src.hasOnBehalfOf()) { - tgt.setOnBehalfOf(VersionConvertor_30_40.convertReference(src.getOnBehalfOf())); + if (src.hasOnBehalfOf()) { + tgt.setOnBehalfOf(VersionConvertor_30_40.convertReference(src.getOnBehalfOf())); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ProcedureRequest30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ProcedureRequest30_40.java index 3d4c31d53..5c5b417a1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ProcedureRequest30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ProcedureRequest30_40.java @@ -2,7 +2,6 @@ package org.hl7.fhir.convertors.conv30_40; import org.hl7.fhir.convertors.VersionConvertor_30_40; import org.hl7.fhir.exceptions.FHIRException; - import java.util.List; public class ProcedureRequest30_40 { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Provenance30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Provenance30_40.java index 5e4c8fd3a..414979659 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Provenance30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Provenance30_40.java @@ -32,20 +32,32 @@ public class Provenance30_40 { return null; org.hl7.fhir.dstu3.model.Provenance tgt = new org.hl7.fhir.dstu3.model.Provenance(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_30_40.convertReference(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_30_40.convertReference(t)); + } if (src.hasOccurredPeriod()) tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getOccurredPeriod())); if (src.hasRecorded()) tgt.setRecordedElement(VersionConvertor_30_40.convertInstant(src.getRecordedElement())); - for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + if (src.hasPolicy()) { + for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) for (org.hl7.fhir.r4.model.Coding tc : t.getCoding()) tgt.addReason(VersionConvertor_30_40.convertCoding(tc)); + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) for (org.hl7.fhir.r4.model.Coding tc : t.getCoding()) tgt.addReason(VersionConvertor_30_40.convertCoding(tc)); + } if (src.hasActivity()) tgt.setActivity(VersionConvertor_30_40.convertCoding(src.getActivity())); - for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); - for (org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); - for (org.hl7.fhir.r4.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_30_40.convertSignature(t)); + if (src.hasAgent()) { + for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + if (src.hasEntity()) { + for (org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); + } + if (src.hasSignature()) { + for (org.hl7.fhir.r4.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_30_40.convertSignature(t)); + } return tgt; } @@ -54,20 +66,32 @@ public class Provenance30_40 { return null; org.hl7.fhir.r4.model.Provenance tgt = new org.hl7.fhir.r4.model.Provenance(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_30_40.convertReference(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getTarget()) tgt.addTarget(VersionConvertor_30_40.convertReference(t)); + } if (src.hasPeriod()) tgt.setOccurred(VersionConvertor_30_40.convertPeriod(src.getPeriod())); if (src.hasRecorded()) tgt.setRecordedElement(VersionConvertor_30_40.convertInstant(src.getRecordedElement())); - for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_40.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getReason()) tgt.addReason(convertCodingToCodeableConcept(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getReason()) tgt.addReason(convertCodingToCodeableConcept(t)); + } if (src.hasActivity()) tgt.setActivity(convertCodingToCodeableConcept(src.getActivity())); - for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); - for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); - for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_30_40.convertSignature(t)); + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + if (src.hasEntity()) { + for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); + } + if (src.hasSignature()) { + for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.addSignature(VersionConvertor_30_40.convertSignature(t)); + } return tgt; } @@ -76,7 +100,9 @@ public class Provenance30_40 { return null; org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasRole()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasWho()) tgt.setWho(VersionConvertor_30_40.convertType(src.getWho())); if (src.hasOnBehalfOf()) @@ -116,7 +142,9 @@ public class Provenance30_40 { tgt.setRole(convertProvenanceEntityRole(src.getRole())); if (src.hasWhat()) tgt.setWhat(VersionConvertor_30_40.convertType(src.getWhat())); - for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + if (src.hasAgent()) { + for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Questionnaire30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Questionnaire30_40.java index 3bae2c7f2..4ce3bad5a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Questionnaire30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Questionnaire30_40.java @@ -13,7 +13,9 @@ public class Questionnaire30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -38,14 +40,26 @@ public class Questionnaire30_40 { tgt.setLastReviewDateElement(VersionConvertor_30_40.convertDate(src.getLastReviewDateElement())); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_40.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -56,7 +70,9 @@ public class Questionnaire30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -81,14 +97,26 @@ public class Questionnaire30_40 { tgt.setLastReviewDateElement(VersionConvertor_30_40.convertDate(src.getLastReviewDateElement())); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_40.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); - for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -101,14 +129,18 @@ public class Questionnaire30_40 { tgt.setLinkId(src.getLinkId()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); if (src.hasType()) tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasEnableWhen()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -119,10 +151,14 @@ public class Questionnaire30_40 { tgt.setMaxLength(src.getMaxLength()); if (src.hasAnswerValueSet()) tgt.setOptions(VersionConvertor_30_40.convertCanonicalToReference(src.getAnswerValueSetElement())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + if (src.hasAnswerOption()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + } if (src.hasInitial()) tgt.setInitial(VersionConvertor_30_40.convertType(src.getInitialFirstRep().getValue())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -135,14 +171,18 @@ public class Questionnaire30_40 { tgt.setLinkId(src.getLinkId()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); if (src.hasType()) tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasEnableWhen()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } tgt.setEnableBehavior(Questionnaire.EnableWhenBehavior.ANY); if (src.hasRequired()) tgt.setRequired(src.getRequired()); @@ -154,10 +194,14 @@ public class Questionnaire30_40 { tgt.setMaxLength(src.getMaxLength()); if (src.hasOptions()) tgt.setAnswerValueSetElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getOptions())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); + if (src.hasOption()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); + } if (src.hasInitial()) tgt.addInitial().setValue(VersionConvertor_30_40.convertType(src.getInitial())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension()) { tgt.addModifierExtension(VersionConvertor_30_40.convertExtension(t)); } @@ -187,10 +231,14 @@ public class Questionnaire30_40 { tgt.setQuestion(src.getQuestion()); if (src.hasHasAnswer()) { tgt.setOperator(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EXISTS); - tgt.setAnswer(VersionConvertor_30_40.convertType(src.getHasAnswerElement())); + if (src.hasHasAnswerElement()) { + tgt.setAnswer(VersionConvertor_30_40.convertType(src.getHasAnswerElement())); + } } else if (src.hasAnswer()) { tgt.setOperator(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EQUAL); - tgt.setAnswer(VersionConvertor_30_40.convertType(src.getAnswer())); + if (src.hasAnswer()) { + tgt.setAnswer(VersionConvertor_30_40.convertType(src.getAnswer())); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/QuestionnaireResponse30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/QuestionnaireResponse30_40.java index c1594d534..9e2d33f2b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/QuestionnaireResponse30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/QuestionnaireResponse30_40.java @@ -12,8 +12,12 @@ public class QuestionnaireResponse30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.setIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasParent()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasQuestionnaire()) tgt.setQuestionnaireElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getQuestionnaire())); if (src.hasStatus()) @@ -28,7 +32,9 @@ public class QuestionnaireResponse30_40 { tgt.setAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); if (src.hasSource()) tgt.setSource(VersionConvertor_30_40.convertReference(src.getSource())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -39,8 +45,12 @@ public class QuestionnaireResponse30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.setIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addParent(VersionConvertor_30_40.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addParent(VersionConvertor_30_40.convertReference(t)); + } if (src.hasQuestionnaire()) tgt.setQuestionnaire(VersionConvertor_30_40.convertCanonicalToReference(src.getQuestionnaireElement())); if (src.hasStatus()) @@ -55,7 +65,9 @@ public class QuestionnaireResponse30_40 { tgt.setAuthor(VersionConvertor_30_40.convertReference(src.getAuthor())); if (src.hasSource()) tgt.setSource(VersionConvertor_30_40.convertReference(src.getSource())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -66,7 +78,9 @@ public class QuestionnaireResponse30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasValue()) tgt.setValue(VersionConvertor_30_40.convertType(src.getValue())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -77,7 +91,9 @@ public class QuestionnaireResponse30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasValue()) tgt.setValue(VersionConvertor_30_40.convertType(src.getValue())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -92,8 +108,12 @@ public class QuestionnaireResponse30_40 { tgt.setDefinition(src.getDefinition()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -108,8 +128,12 @@ public class QuestionnaireResponse30_40 { tgt.setDefinition(src.getDefinition()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RelatedPerson30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RelatedPerson30_40.java index 69c12fa5c..3e5a680fc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RelatedPerson30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RelatedPerson30_40.java @@ -2,7 +2,6 @@ package org.hl7.fhir.convertors.conv30_40; import org.hl7.fhir.convertors.VersionConvertor_30_40; import org.hl7.fhir.exceptions.FHIRException; - import java.util.List; public class RelatedPerson30_40 { @@ -60,13 +59,19 @@ public class RelatedPerson30_40 { tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); } if (src.hasActive()) { - tgt.setActive(src.getActive()); + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } } if (src.hasPatient()) { - tgt.setPatient(VersionConvertor_30_40.convertReference(src.getPatient())); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_30_40.convertReference(src.getPatient())); + } } if (src.hasRelationship()) { - tgt.addRelationship(VersionConvertor_30_40.convertCodeableConcept(src.getRelationship())); + if (src.hasRelationship()) { + tgt.addRelationship(VersionConvertor_30_40.convertCodeableConcept(src.getRelationship())); + } } for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) { tgt.addName(VersionConvertor_30_40.convertHumanName(t)); @@ -75,7 +80,9 @@ public class RelatedPerson30_40 { tgt.addTelecom(VersionConvertor_30_40.convertContactPoint(t)); } if (src.hasGender()) { - tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); + if (src.hasGender()) { + tgt.setGender(VersionConvertor_30_40.convertAdministrativeGender(src.getGender())); + } } if (src.hasBirthDate()) { tgt.setBirthDate(tgt.getBirthDate()); @@ -87,7 +94,9 @@ public class RelatedPerson30_40 { tgt.addPhoto(VersionConvertor_30_40.convertAttachment(t)); } if (src.hasPeriod()) { - tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_30_40.convertPeriod(src.getPeriod())); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RiskAssessment30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RiskAssessment30_40.java index a0a851837..fdbe6b251 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RiskAssessment30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/RiskAssessment30_40.java @@ -36,8 +36,12 @@ public class RiskAssessment30_40 { tgt.setReason(VersionConvertor_30_40.convertType(src.getReasonCodeFirstRep())); if (src.hasReasonReference()) tgt.setReason(VersionConvertor_30_40.convertType(src.getReasonReferenceFirstRep())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + if (src.hasBasis()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } if (src.hasMitigation()) tgt.setMitigation(src.getMitigation()); if (src.hasNote()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Schedule30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Schedule30_40.java index 57228a86d..23a54d425 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Schedule30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Schedule30_40.java @@ -10,14 +10,22 @@ public class Schedule30_40 { return null; org.hl7.fhir.dstu3.model.Schedule tgt = new org.hl7.fhir.dstu3.model.Schedule(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasServiceCategory()) tgt.setServiceCategory(VersionConvertor_30_40.convertCodeableConcept(src.getServiceCategoryFirstRep())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_40.convertReference(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_40.convertReference(t)); + } if (src.hasPlanningHorizon()) tgt.setPlanningHorizon(VersionConvertor_30_40.convertPeriod(src.getPlanningHorizon())); if (src.hasComment()) @@ -30,14 +38,22 @@ public class Schedule30_40 { return null; org.hl7.fhir.r4.model.Schedule tgt = new org.hl7.fhir.r4.model.Schedule(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasServiceCategory()) tgt.addServiceCategory(VersionConvertor_30_40.convertCodeableConcept(src.getServiceCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_40.convertReference(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_40.convertReference(t)); + } if (src.hasPlanningHorizon()) tgt.setPlanningHorizon(VersionConvertor_30_40.convertPeriod(src.getPlanningHorizon())); if (src.hasComment()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SearchParameter30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SearchParameter30_40.java index 94a236482..854dbf3f4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SearchParameter30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SearchParameter30_40.java @@ -136,14 +136,22 @@ public class SearchParameter30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + if (src.hasBase()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + } if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertSearchParamType(src.getType())); if (src.hasDerivedFrom()) @@ -156,11 +164,21 @@ public class SearchParameter30_40 { tgt.setXpath(src.getXpath()); if (src.hasXpathUsage()) tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); - for (org.hl7.fhir.r4.model.Enumeration t : src.getComparator()) VersionConvertor_30_40.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); - for (org.hl7.fhir.r4.model.Enumeration t : src.getModifier()) VersionConvertor_30_40.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); - for (org.hl7.fhir.r4.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); - for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } + if (src.hasComparator()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getComparator()) VersionConvertor_30_40.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); + } + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getModifier()) VersionConvertor_30_40.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); + } + if (src.hasChain()) { + for (org.hl7.fhir.r4.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + } return tgt; } @@ -183,14 +201,22 @@ public class SearchParameter30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + if (src.hasBase()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + } if (src.hasType()) tgt.setType(VersionConvertor_30_40.convertSearchParamType(src.getType())); if (src.hasDerivedFrom()) @@ -203,11 +229,21 @@ public class SearchParameter30_40 { tgt.setXpath(src.getXpath()); if (src.hasXpathUsage()) tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getComparator()) VersionConvertor_30_40.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getModifier()) VersionConvertor_30_40.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); - for (org.hl7.fhir.dstu3.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); - for (org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } + if (src.hasComparator()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getComparator()) VersionConvertor_30_40.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); + } + if (src.hasModifier()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getModifier()) VersionConvertor_30_40.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); + } + if (src.hasChain()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); + } + if (src.hasComponent()) { + for (org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Sequence30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Sequence30_40.java index fa08ce82a..718ee31db 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Sequence30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Sequence30_40.java @@ -78,7 +78,9 @@ public class Sequence30_40 { return null; org.hl7.fhir.dstu3.model.Sequence tgt = new org.hl7.fhir.dstu3.model.Sequence(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasType()) tgt.setType(convertSequenceType(src.getType())); if (src.hasCoordinateSystem()) @@ -95,14 +97,22 @@ public class Sequence30_40 { tgt.setQuantity(VersionConvertor_30_40.convertQuantity(src.getQuantity())); if (src.hasReferenceSeq()) tgt.setReferenceSeq(convertSequenceReferenceSeqComponent(src.getReferenceSeq())); - for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + if (src.hasVariant()) { + for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + } if (src.hasObservedSeq()) tgt.setObservedSeq(src.getObservedSeq()); - for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + if (src.hasQuality()) { + for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + } if (src.hasReadCoverage()) tgt.setReadCoverage(src.getReadCoverage()); - for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_40.convertReference(t)); + if (src.hasRepository()) { + for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); + } + if (src.hasPointer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -111,7 +121,9 @@ public class Sequence30_40 { return null; org.hl7.fhir.r4.model.MolecularSequence tgt = new org.hl7.fhir.r4.model.MolecularSequence(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasType()) tgt.setType(convertSequenceType(src.getType())); if (src.hasCoordinateSystem()) @@ -128,14 +140,22 @@ public class Sequence30_40 { tgt.setQuantity(VersionConvertor_30_40.convertQuantity(src.getQuantity())); if (src.hasReferenceSeq()) tgt.setReferenceSeq(convertSequenceReferenceSeqComponent(src.getReferenceSeq())); - for (org.hl7.fhir.dstu3.model.Sequence.SequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + if (src.hasVariant()) { + for (org.hl7.fhir.dstu3.model.Sequence.SequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + } if (src.hasObservedSeq()) tgt.setObservedSeq(src.getObservedSeq()); - for (org.hl7.fhir.dstu3.model.Sequence.SequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + if (src.hasQuality()) { + for (org.hl7.fhir.dstu3.model.Sequence.SequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + } if (src.hasReadCoverage()) tgt.setReadCoverage(src.getReadCoverage()); - for (org.hl7.fhir.dstu3.model.Sequence.SequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_40.convertReference(t)); + if (src.hasRepository()) { + for (org.hl7.fhir.dstu3.model.Sequence.SequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); + } + if (src.hasPointer()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Slot30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Slot30_40.java index 1acfda048..de6bc5c12 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Slot30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Slot30_40.java @@ -10,11 +10,17 @@ public class Slot30_40 { return null; org.hl7.fhir.r4.model.Slot tgt = new org.hl7.fhir.r4.model.Slot(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasServiceCategory()) tgt.addServiceCategory(VersionConvertor_30_40.convertCodeableConcept(src.getServiceCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_40.convertCodeableConcept(src.getAppointmentType())); if (src.hasSchedule()) @@ -37,11 +43,17 @@ public class Slot30_40 { return null; org.hl7.fhir.dstu3.model.Slot tgt = new org.hl7.fhir.dstu3.model.Slot(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasServiceCategory()) tgt.setServiceCategory(VersionConvertor_30_40.convertCodeableConcept(src.getServiceCategoryFirstRep())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_40.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_40.convertCodeableConcept(src.getAppointmentType())); if (src.hasSchedule()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Specimen30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Specimen30_40.java index e0bceb48a..2263d8bb6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Specimen30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Specimen30_40.java @@ -10,7 +10,9 @@ public class Specimen30_40 { return null; org.hl7.fhir.r4.model.Specimen tgt = new org.hl7.fhir.r4.model.Specimen(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasAccessionIdentifier()) tgt.setAccessionIdentifier(VersionConvertor_30_40.convertIdentifier(src.getAccessionIdentifier())); if (src.hasStatus()) @@ -21,13 +23,23 @@ public class Specimen30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasReceivedTime()) tgt.setReceivedTimeElement(VersionConvertor_30_40.convertDateTime(src.getReceivedTimeElement())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_40.convertReference(t)); + if (src.hasParent()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasRequest()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_40.convertReference(t)); + } if (src.hasCollection()) tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); - for (org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); - for (org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasProcessing()) { + for (org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); + } + if (src.hasContainer()) { + for (org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -36,7 +48,9 @@ public class Specimen30_40 { return null; org.hl7.fhir.dstu3.model.Specimen tgt = new org.hl7.fhir.dstu3.model.Specimen(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasAccessionIdentifier()) tgt.setAccessionIdentifier(VersionConvertor_30_40.convertIdentifier(src.getAccessionIdentifier())); if (src.hasStatus()) @@ -47,13 +61,23 @@ public class Specimen30_40 { tgt.setSubject(VersionConvertor_30_40.convertReference(src.getSubject())); if (src.hasReceivedTime()) tgt.setReceivedTimeElement(VersionConvertor_30_40.convertDateTime(src.getReceivedTimeElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_40.convertReference(t)); + if (src.hasParent()) { + for (org.hl7.fhir.r4.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_40.convertReference(t)); + } if (src.hasCollection()) tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); - for (org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); - for (org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + if (src.hasProcessing()) { + for (org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); + } + if (src.hasContainer()) { + for (org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_40.convertAnnotation(t)); + } return tgt; } @@ -98,7 +122,9 @@ public class Specimen30_40 { return null; org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasType()) @@ -117,7 +143,9 @@ public class Specimen30_40 { return null; org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasType()) @@ -140,7 +168,9 @@ public class Specimen30_40 { tgt.setDescription(src.getDescription()); if (src.hasProcedure()) tgt.setProcedure(VersionConvertor_30_40.convertCodeableConcept(src.getProcedure())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_40.convertReference(t)); + if (src.hasAdditive()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_40.convertReference(t)); + } if (src.hasTime()) tgt.setTime(VersionConvertor_30_40.convertType(src.getTime())); return tgt; @@ -155,7 +185,9 @@ public class Specimen30_40 { tgt.setDescription(src.getDescription()); if (src.hasProcedure()) tgt.setProcedure(VersionConvertor_30_40.convertCodeableConcept(src.getProcedure())); - for (org.hl7.fhir.r4.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_40.convertReference(t)); + if (src.hasAdditive()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_40.convertReference(t)); + } if (src.hasTime()) tgt.setTime(VersionConvertor_30_40.convertType(src.getTime())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureDefinition30_40.java index c9b982cc0..f065a7ff1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureDefinition30_40.java @@ -48,7 +48,9 @@ public class StructureDefinition30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -63,19 +65,29 @@ public class StructureDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_40.convertCoding(t)); + if (src.hasKeyword()) { + for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); - for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + if (src.hasMapping()) { + for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } if (src.hasKind()) tgt.setKind(convertStructureDefinitionKind(src.getKind())); if (src.hasAbstract()) @@ -85,7 +97,9 @@ public class StructureDefinition30_40 { tgt.setContextType(convertExtensionContext(t.getType(), t.getExpression())); tgt.addContext("Element".equals(t.getExpression()) ? "*" : t.getExpression()); } - for (org.hl7.fhir.r4.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + if (src.hasContextInvariant()) { + for (org.hl7.fhir.r4.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + } if (src.hasType()) tgt.setType(src.getType()); if (src.hasBaseDefinition()) @@ -106,7 +120,9 @@ public class StructureDefinition30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -121,29 +137,43 @@ public class StructureDefinition30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_40.convertCoding(t)); + if (src.hasKeyword()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_40.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } if (src.hasKind()) tgt.setKind(convertStructureDefinitionKind(src.getKind())); if (src.hasAbstract()) tgt.setAbstract(src.getAbstract()); for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) { org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent ec = tgt.addContext(); - ec.setType(convertExtensionContext(src.getContextType())); + if (src.hasContextType()) { + ec.setType(convertExtensionContext(src.getContextType())); + } ec.setExpression("*".equals(t.getValue()) ? "Element" : t.getValue()); } - for (org.hl7.fhir.dstu3.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + if (src.hasContextInvariant()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + } if (src.hasType()) tgt.setType(src.getType()); if (src.hasBaseDefinition()) @@ -169,7 +199,9 @@ public class StructureDefinition30_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + } return tgt; } @@ -178,7 +210,9 @@ public class StructureDefinition30_40 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + } return tgt; } @@ -253,7 +287,9 @@ public class StructureDefinition30_40 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + } return tgt; } @@ -262,7 +298,9 @@ public class StructureDefinition30_40 { return null; org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_40.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureMap30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureMap30_40.java index 2d2b748ea..39ec10314 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureMap30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/StructureMap30_40.java @@ -12,7 +12,9 @@ public class StructureMap30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -27,18 +29,30 @@ public class StructureMap30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.r4.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -49,7 +63,9 @@ public class StructureMap30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -64,18 +80,30 @@ public class StructureMap30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -118,8 +146,12 @@ public class StructureMap30_40 { tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -136,8 +168,12 @@ public class StructureMap30_40 { tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -180,10 +216,18 @@ public class StructureMap30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasSource()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -196,10 +240,18 @@ public class StructureMap30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasSource()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -212,7 +264,9 @@ public class StructureMap30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + if (src.hasVariable()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + } return tgt; } @@ -223,7 +277,9 @@ public class StructureMap30_40 { VersionConvertor_30_40.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + if (src.hasVariable()) { + for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + } return tgt; } @@ -296,12 +352,16 @@ public class StructureMap30_40 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getListMode()) VersionConvertor_30_40.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + if (src.hasListMode()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getListMode()) VersionConvertor_30_40.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } @@ -318,12 +378,16 @@ public class StructureMap30_40 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (org.hl7.fhir.r4.model.Enumeration t : src.getListMode()) VersionConvertor_30_40.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + if (src.hasListMode()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getListMode()) VersionConvertor_30_40.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Subscription30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Subscription30_40.java index ed7a45fe7..154af62e2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Subscription30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Subscription30_40.java @@ -12,7 +12,9 @@ public class Subscription30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasStatus()) tgt.setStatus(convertSubscriptionStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasEnd()) tgt.setEnd(src.getEnd()); if (src.hasReason()) @@ -33,7 +35,9 @@ public class Subscription30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasStatus()) tgt.setStatus(convertSubscriptionStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactPoint(t)); + } if (src.hasEnd()) tgt.setEnd(src.getEnd()); if (src.hasReason()) @@ -58,7 +62,9 @@ public class Subscription30_40 { tgt.setEndpoint(src.getEndpoint()); if (src.hasPayload()) tgt.setPayload(src.getPayload()); - for (org.hl7.fhir.r4.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + if (src.hasHeader()) { + for (org.hl7.fhir.r4.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + } return tgt; } @@ -73,7 +79,9 @@ public class Subscription30_40 { tgt.setEndpoint(src.getEndpoint()); if (src.hasPayload()) tgt.setPayload(src.getPayload()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + if (src.hasHeader()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Substance30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Substance30_40.java index fd87c8794..64fef25c6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Substance30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/Substance30_40.java @@ -40,16 +40,24 @@ public class Substance30_40 { return null; org.hl7.fhir.r4.model.Substance tgt = new org.hl7.fhir.r4.model.Substance(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasInstance()) { + for (org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -58,16 +66,24 @@ public class Substance30_40 { return null; org.hl7.fhir.dstu3.model.Substance tgt = new org.hl7.fhir.dstu3.model.Substance(); VersionConvertor_30_40.copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_40.convertCodeableConcept(src.getCode())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasInstance()) { + for (org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SupplyDelivery30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SupplyDelivery30_40.java index 076c5399c..23b5a1d88 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SupplyDelivery30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/SupplyDelivery30_40.java @@ -12,8 +12,12 @@ public class SupplyDelivery30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); if (src.hasPatient()) @@ -28,7 +32,9 @@ public class SupplyDelivery30_40 { tgt.setSupplier(VersionConvertor_30_40.convertReference(src.getSupplier())); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_40.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); + } return tgt; } @@ -39,8 +45,12 @@ public class SupplyDelivery30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.setIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifierFirstRep())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_40.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); if (src.hasPatient()) @@ -55,7 +65,9 @@ public class SupplyDelivery30_40 { tgt.setSupplier(VersionConvertor_30_40.convertReference(src.getSupplier())); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_40.convertReference(src.getDestination())); - for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_40.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestReport30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestReport30_40.java index 06b110beb..41e0fa78d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestReport30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestReport30_40.java @@ -26,10 +26,14 @@ public class TestReport30_40 { tgt.setTester(src.getTester()); if (src.hasIssued()) tgt.setIssuedElement(VersionConvertor_30_40.convertDateTime(src.getIssuedElement())); - for (org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); return tgt; @@ -56,10 +60,14 @@ public class TestReport30_40 { tgt.setTester(src.getTester()); if (src.hasIssued()) tgt.setIssuedElement(VersionConvertor_30_40.convertDateTime(src.getIssuedElement())); - for (org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); - for (org.hl7.fhir.r4.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.r4.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); return tgt; @@ -158,7 +166,9 @@ public class TestReport30_40 { return null; org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + } return tgt; } @@ -167,7 +177,9 @@ public class TestReport30_40 { return null; org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + } return tgt; } @@ -214,7 +226,9 @@ public class TestReport30_40 { return null; org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + } return tgt; } @@ -223,7 +237,9 @@ public class TestReport30_40 { return null; org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + } return tgt; } @@ -236,7 +252,9 @@ public class TestReport30_40 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + } return tgt; } @@ -249,7 +267,9 @@ public class TestReport30_40 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestScript30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestScript30_40.java index 803f0c935..711e27d9c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestScript30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/TestScript30_40.java @@ -28,25 +28,43 @@ public class TestScript30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } if (src.hasMetadata()) tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + if (src.hasFixture()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); return tgt; @@ -75,25 +93,43 @@ public class TestScript30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + if (src.hasOrigin()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } if (src.hasMetadata()) tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_40.convertReference(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + if (src.hasFixture()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_40.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); return tgt; @@ -162,10 +198,14 @@ public class TestScript30_40 { tgt.setValidated(src.getValidated()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } if (src.hasCapabilities()) tgt.setCapabilitiesElement(VersionConvertor_30_40.convertReferenceToCanonical(src.getCapabilities())); return tgt; @@ -182,10 +222,14 @@ public class TestScript30_40 { tgt.setValidated(src.getValidated()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + if (src.hasOrigin()) { + for (org.hl7.fhir.r4.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.r4.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } if (src.hasCapabilities()) tgt.setCapabilities(VersionConvertor_30_40.convertCanonicalToReference(src.getCapabilitiesElement())); return tgt; @@ -196,8 +240,12 @@ public class TestScript30_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -206,8 +254,12 @@ public class TestScript30_40 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -264,7 +316,9 @@ public class TestScript30_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + } return tgt; } @@ -273,7 +327,9 @@ public class TestScript30_40 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertSetupActionComponent(t)); + } return tgt; } @@ -282,7 +338,9 @@ public class TestScript30_40 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + } return tgt; } @@ -291,7 +349,9 @@ public class TestScript30_40 { return null; org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_30_40.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTeardownActionComponent(t)); + } return tgt; } @@ -304,7 +364,9 @@ public class TestScript30_40 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + } return tgt; } @@ -317,7 +379,9 @@ public class TestScript30_40 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_40.convertTestActionComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ValueSet30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ValueSet30_40.java index 90916ed3c..094bfb4f0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ValueSet30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/ValueSet30_40.java @@ -15,7 +15,9 @@ public class ValueSet30_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -28,7 +30,9 @@ public class ValueSet30_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -69,9 +73,15 @@ public class ValueSet30_40 { tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } + if (src.hasValueSet()) { + for (org.hl7.fhir.r4.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + } return tgt; } @@ -84,9 +94,15 @@ public class ValueSet30_40 { tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } + if (src.hasValueSet()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + } return tgt; } @@ -125,7 +141,9 @@ public class ValueSet30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -140,11 +158,17 @@ public class ValueSet30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasImmutable()) tgt.setImmutable(src.getImmutable()); if (src.hasPurpose()) @@ -167,7 +191,9 @@ public class ValueSet30_40 { VersionConvertor_30_40.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -182,11 +208,17 @@ public class ValueSet30_40 { tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement())); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t)); + } if (src.hasImmutable()) tgt.setImmutable(src.getImmutable()); if (src.hasPurpose()) @@ -211,8 +243,12 @@ public class ValueSet30_40 { tgt.setLockedDateElement(VersionConvertor_30_40.convertDate(src.getLockedDateElement())); if (src.hasInactive()) tgt.setInactive(src.getInactive()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasInclude()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -225,8 +261,12 @@ public class ValueSet30_40 { tgt.setLockedDateElement(VersionConvertor_30_40.convertDate(src.getLockedDateElement())); if (src.hasInactive()) tgt.setInactive(src.getInactive()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasInclude()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -243,8 +283,12 @@ public class ValueSet30_40 { tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -261,8 +305,12 @@ public class ValueSet30_40 { tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -283,8 +331,12 @@ public class ValueSet30_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -305,8 +357,12 @@ public class ValueSet30_40 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ActivityDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ActivityDefinition30_50.java index 1ad23685a..133852b8f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ActivityDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ActivityDefinition30_50.java @@ -14,7 +14,9 @@ public class ActivityDefinition30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -41,9 +43,15 @@ public class ActivityDefinition30_50 { tgt.setLastReviewDate(src.getLastReviewDate()); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_50.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + } for (org.hl7.fhir.dstu3.model.Contributor t : src.getContributor()) { if (t.getType() == ContributorType.AUTHOR) for (ContactDetail c : t.getContact()) tgt.addAuthor(VersionConvertor_30_50.convertContactDetail(c)); @@ -54,11 +62,17 @@ public class ActivityDefinition30_50 { if (t.getType() == ContributorType.ENDORSER) for (ContactDetail c : t.getContact()) tgt.addEndorser(VersionConvertor_30_50.convertContactDetail(c)); } - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); + } if (src.hasKind()) tgt.setKind(convertActivityDefinitionKind(src.getKind())); if (src.hasCode()) @@ -67,16 +81,24 @@ public class ActivityDefinition30_50 { tgt.setTiming(VersionConvertor_30_50.convertType(src.getTiming())); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_50.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + } if (src.hasProduct()) tgt.setProduct(VersionConvertor_30_50.convertType(src.getProduct())); if (src.hasQuantity()) tgt.setQuantity(VersionConvertor_30_50.convertSimpleQuantity(src.getQuantity())); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasDosage()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasTransform()) tgt.setTransformElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getTransform())); - for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + } return tgt; } @@ -87,7 +109,9 @@ public class ActivityDefinition30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -114,9 +138,15 @@ public class ActivityDefinition30_50 { tgt.setLastReviewDate(src.getLastReviewDate()); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_50.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + } for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) { org.hl7.fhir.dstu3.model.Contributor c = new org.hl7.fhir.dstu3.model.Contributor(); c.setType(ContributorType.AUTHOR); @@ -141,11 +171,17 @@ public class ActivityDefinition30_50 { c.addContact(VersionConvertor_30_50.convertContactDetail(t)); tgt.addContributor(c); } - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_50.convertCanonicalToReference(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_50.convertCanonicalToReference(t)); + } if (src.hasKind()) tgt.setKind(convertActivityDefinitionKind(src.getKind())); if (src.hasCode()) @@ -154,16 +190,24 @@ public class ActivityDefinition30_50 { tgt.setTiming(VersionConvertor_30_50.convertType(src.getTiming())); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_50.convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + } if (src.hasProduct()) tgt.setProduct(VersionConvertor_30_50.convertType(src.getProduct())); if (src.hasQuantity()) tgt.setQuantity(VersionConvertor_30_50.convertSimpleQuantity(src.getQuantity())); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasDosage()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasTransform()) tgt.setTransform(VersionConvertor_30_50.convertCanonicalToReference(src.getTransformElement())); - for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AllergyIntolerance30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AllergyIntolerance30_50.java index d1ea16962..df3f25f0d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AllergyIntolerance30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AllergyIntolerance30_50.java @@ -10,14 +10,18 @@ public class AllergyIntolerance30_50 { return null; org.hl7.fhir.dstu3.model.AllergyIntolerance tgt = new org.hl7.fhir.dstu3.model.AllergyIntolerance(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertAllergyIntoleranceClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertAllergyIntoleranceVerificationStatus(src.getVerificationStatus())); if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getCategory()) VersionConvertor_30_50.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getCategory()) VersionConvertor_30_50.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + } if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -34,8 +38,12 @@ public class AllergyIntolerance30_50 { tgt.setAsserter(VersionConvertor_30_50.convertReference(src.getAsserter())); if (src.hasLastOccurrence()) tgt.setLastOccurrence(src.getLastOccurrence()); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasReaction()) { + for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + } return tgt; } @@ -44,14 +52,18 @@ public class AllergyIntolerance30_50 { return null; org.hl7.fhir.r5.model.AllergyIntolerance tgt = new org.hl7.fhir.r5.model.AllergyIntolerance(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertAllergyIntoleranceClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertAllergyIntoleranceVerificationStatus(src.getVerificationStatus())); if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getCategory()) VersionConvertor_30_50.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getCategory()) VersionConvertor_30_50.copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + } if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -68,8 +80,12 @@ public class AllergyIntolerance30_50 { tgt.setAsserter(VersionConvertor_30_50.convertReference(src.getAsserter())); if (src.hasLastOccurrence()) tgt.setLastOccurrence(src.getLastOccurrence()); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasReaction()) { + for (org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + } return tgt; } @@ -171,7 +187,9 @@ public class AllergyIntolerance30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasSubstance()) tgt.setSubstance(VersionConvertor_30_50.convertCodeableConcept(src.getSubstance())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasManifestation()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasOnset()) @@ -180,7 +198,9 @@ public class AllergyIntolerance30_50 { tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); if (src.hasExposureRoute()) tgt.setExposureRoute(VersionConvertor_30_50.convertCodeableConcept(src.getExposureRoute())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -191,7 +211,9 @@ public class AllergyIntolerance30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasSubstance()) tgt.setSubstance(VersionConvertor_30_50.convertCodeableConcept(src.getSubstance())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasManifestation()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasOnset()) @@ -200,7 +222,9 @@ public class AllergyIntolerance30_50 { tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); if (src.hasExposureRoute()) tgt.setExposureRoute(VersionConvertor_30_50.convertCodeableConcept(src.getExposureRoute())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Appointment30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Appointment30_50.java index 206d1a34e..5776877f8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Appointment30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Appointment30_50.java @@ -11,13 +11,19 @@ public class Appointment30_50 { return null; org.hl7.fhir.dstu3.model.Appointment tgt = new org.hl7.fhir.dstu3.model.Appointment(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertAppointmentStatus(src.getStatus())); if (src.hasServiceCategory()) tgt.setServiceCategory(VersionConvertor_30_50.convertCodeableConcept(src.getServiceCategoryFirstRep())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_50.convertCodeableConcept(src.getAppointmentType())); for (CodeableReference t : src.getReason()) if (t.hasConcept()) @@ -28,21 +34,31 @@ public class Appointment30_50 { tgt.setPriority(src.getPriority()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStart()) tgt.setStart(src.getStart()); if (src.hasEnd()) tgt.setEnd(src.getEnd()); if (src.hasMinutesDuration()) tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_50.convertReference(t)); + if (src.hasSlot()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_50.convertReference(t)); + } if (src.hasCreated()) tgt.setCreated(src.getCreated()); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); - for (org.hl7.fhir.r5.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_50.convertPeriod(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } + if (src.hasRequestedPeriod()) { + for (org.hl7.fhir.r5.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_50.convertPeriod(t)); + } return tgt; } @@ -51,36 +67,56 @@ public class Appointment30_50 { return null; org.hl7.fhir.r5.model.Appointment tgt = new org.hl7.fhir.r5.model.Appointment(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertAppointmentStatus(src.getStatus())); if (src.hasServiceCategory()) tgt.addServiceCategory(VersionConvertor_30_50.convertCodeableConcept(src.getServiceCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_50.convertCodeableConcept(src.getAppointmentType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getIndication()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasIndication()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getIndication()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + } if (src.hasPriority()) tgt.setPriority(src.getPriority()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStart()) tgt.setStart(src.getStart()); if (src.hasEnd()) tgt.setEnd(src.getEnd()); if (src.hasMinutesDuration()) tgt.setMinutesDuration(src.getMinutesDuration()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_50.convertReference(t)); + if (src.hasSlot()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(VersionConvertor_30_50.convertReference(t)); + } if (src.hasCreated()) tgt.setCreated(src.getCreated()); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); - for (org.hl7.fhir.dstu3.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_50.convertPeriod(t)); + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } + if (src.hasRequestedPeriod()) { + for (org.hl7.fhir.dstu3.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(VersionConvertor_30_50.convertPeriod(t)); + } return tgt; } @@ -89,7 +125,9 @@ public class Appointment30_50 { return null; org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_50.convertReference(src.getActor())); if (src.hasRequired()) @@ -104,7 +142,9 @@ public class Appointment30_50 { return null; org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_50.convertReference(src.getActor())); if (src.hasRequired()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AppointmentResponse30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AppointmentResponse30_50.java index d18d3b1c2..0e2c0baff 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AppointmentResponse30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AppointmentResponse30_50.java @@ -10,14 +10,18 @@ public class AppointmentResponse30_50 { return null; org.hl7.fhir.r5.model.AppointmentResponse tgt = new org.hl7.fhir.r5.model.AppointmentResponse(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasAppointment()) tgt.setAppointment(VersionConvertor_30_50.convertReference(src.getAppointment())); if (src.hasStart()) tgt.setStart(src.getStart()); if (src.hasEnd()) tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasParticipantType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_50.convertReference(src.getActor())); if (src.hasParticipantStatus()) @@ -32,14 +36,18 @@ public class AppointmentResponse30_50 { return null; org.hl7.fhir.dstu3.model.AppointmentResponse tgt = new org.hl7.fhir.dstu3.model.AppointmentResponse(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasAppointment()) tgt.setAppointment(VersionConvertor_30_50.convertReference(src.getAppointment())); if (src.hasStart()) tgt.setStart(src.getStart()); if (src.hasEnd()) tgt.setEnd(src.getEnd()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasParticipantType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasActor()) tgt.setActor(VersionConvertor_30_50.convertReference(src.getActor())); if (src.hasParticipantStatus()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AuditEvent30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AuditEvent30_50.java index 5198e744f..c5f454c86 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AuditEvent30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/AuditEvent30_50.java @@ -12,7 +12,9 @@ public class AuditEvent30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCoding(src.getType())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_50.convertCoding(t)); + if (src.hasSubtype()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasAction()) tgt.setAction(convertAuditEventAction(src.getAction())); if (src.hasRecorded()) @@ -21,11 +23,17 @@ public class AuditEvent30_50 { tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); if (src.hasOutcomeDesc()) tgt.setOutcomeDesc(src.getOutcomeDesc()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } if (src.hasSource()) tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + if (src.hasEntity()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + } return tgt; } @@ -36,7 +44,9 @@ public class AuditEvent30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCoding(src.getType())); - for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_50.convertCoding(t)); + if (src.hasSubtype()) { + for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.addSubtype(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasAction()) tgt.setAction(convertAuditEventAction(src.getAction())); if (src.hasRecorded()) @@ -45,11 +55,17 @@ public class AuditEvent30_50 { tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); if (src.hasOutcomeDesc()) tgt.setOutcomeDesc(src.getOutcomeDesc()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } if (src.hasSource()) tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + if (src.hasEntity()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + } return tgt; } @@ -96,7 +112,9 @@ public class AuditEvent30_50 { return null; org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasRole()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasReference()) tgt.setWho(VersionConvertor_30_50.convertReference(src.getReference())); if (src.hasUserId()) @@ -109,12 +127,16 @@ public class AuditEvent30_50 { tgt.setRequestor(src.getRequestor()); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_50.convertReference(src.getLocation())); - for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + if (src.hasPolicy()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } if (src.hasMedia()) tgt.setMedia(VersionConvertor_30_50.convertCoding(src.getMedia())); if (src.hasNetwork()) tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_50.convertCodeableConcept(t)); + } return tgt; } @@ -123,7 +145,9 @@ public class AuditEvent30_50 { return null; org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasRole()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasWho()) { if (src.getWho().hasIdentifier()) tgt.setUserId(VersionConvertor_30_50.convertIdentifier(src.getWho().getIdentifier())); @@ -138,12 +162,16 @@ public class AuditEvent30_50 { tgt.setRequestor(src.getRequestor()); if (src.hasLocation()) tgt.setLocation(VersionConvertor_30_50.convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + if (src.hasPolicy()) { + for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); + } if (src.hasMedia()) tgt.setMedia(VersionConvertor_30_50.convertCoding(src.getMedia())); if (src.hasNetwork()) tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(VersionConvertor_30_50.convertCodeableConcept(t)); + } return tgt; } @@ -224,12 +252,16 @@ public class AuditEvent30_50 { tgt.setRole(VersionConvertor_30_50.convertCoding(src.getRole())); if (src.hasLifecycle()) tgt.setLifecycle(VersionConvertor_30_50.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCoding(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasQuery()) tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -250,12 +282,16 @@ public class AuditEvent30_50 { tgt.setRole(VersionConvertor_30_50.convertCoding(src.getRole())); if (src.hasLifecycle()) tgt.setLifecycle(VersionConvertor_30_50.convertCoding(src.getLifecycle())); - for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCoding(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasQuery()) tgt.setQuery(src.getQuery()); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } return tgt; } @@ -328,7 +364,9 @@ public class AuditEvent30_50 { tgt.setSite(src.getSite()); if (src.hasObserver()) tgt.setIdentifier(VersionConvertor_30_50.convertIdentifier(src.getObserver().getIdentifier())); - for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCoding(t)); + } return tgt; } @@ -341,7 +379,9 @@ public class AuditEvent30_50 { tgt.setSite(src.getSite()); if (src.hasIdentifier()) tgt.getObserver().setIdentifier(VersionConvertor_30_50.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCoding(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCoding(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Basic30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Basic30_50.java index d0f1c13e1..3f2b8d56a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Basic30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Basic30_50.java @@ -10,7 +10,9 @@ public class Basic30_50 { return null; org.hl7.fhir.r5.model.Basic tgt = new org.hl7.fhir.r5.model.Basic(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasSubject()) @@ -27,7 +29,9 @@ public class Basic30_50 { return null; org.hl7.fhir.dstu3.model.Basic tgt = new org.hl7.fhir.dstu3.model.Basic(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasSubject()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/BodySite30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/BodySite30_50.java index 6d32372f9..1ad48d84b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/BodySite30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/BodySite30_50.java @@ -10,12 +10,16 @@ public class BodySite30_50 { return null; org.hl7.fhir.r5.model.BodyStructure tgt = new org.hl7.fhir.r5.model.BodyStructure(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_50.convertAttachment(t)); + if (src.hasImage()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_50.convertAttachment(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_50.convertReference(src.getPatient())); return tgt; @@ -26,12 +30,16 @@ public class BodySite30_50 { return null; org.hl7.fhir.dstu3.model.BodySite tgt = new org.hl7.fhir.dstu3.model.BodySite(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_50.convertAttachment(t)); + if (src.hasImage()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) tgt.addImage(VersionConvertor_30_50.convertAttachment(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_50.convertReference(src.getPatient())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Bundle30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Bundle30_50.java index 5dbda2446..a38d1bfbc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Bundle30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Bundle30_50.java @@ -16,8 +16,12 @@ public class Bundle30_50 { tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } if (src.hasSignature()) tgt.setSignature(VersionConvertor_30_50.convertSignature(src.getSignature())); return tgt; @@ -34,8 +38,12 @@ public class Bundle30_50 { tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); - for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } if (src.hasSignature()) tgt.setSignature(VersionConvertor_30_50.convertSignature(src.getSignature())); return tgt; @@ -46,7 +54,9 @@ public class Bundle30_50 { return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); if (src.hasResource()) @@ -65,7 +75,9 @@ public class Bundle30_50 { return null; org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); if (src.hasResource()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CapabilityStatement30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CapabilityStatement30_50.java index 22e6c3d4a..48b9d21f3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CapabilityStatement30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CapabilityStatement30_50.java @@ -27,18 +27,26 @@ public class CapabilityStatement30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasKind()) tgt.setKind(convertCapabilityStatementKind(src.getKind())); - for (org.hl7.fhir.dstu3.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + if (src.hasInstantiates()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + } if (src.hasSoftware()) tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); if (src.hasImplementation()) @@ -47,13 +55,27 @@ public class CapabilityStatement30_50 { tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); if (src.hasAcceptUnknown()) tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); - for (org.hl7.fhir.dstu3.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile", VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasPatchFormat()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); + } + if (src.hasImplementationGuide()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); + } + if (src.hasRest()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile", VersionConvertor_30_50.convertReference(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + } return tgt; } @@ -78,18 +100,26 @@ public class CapabilityStatement30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasKind()) tgt.setKind(convertCapabilityStatementKind(src.getKind())); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + if (src.hasInstantiates()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue()); + } if (src.hasSoftware()) tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); if (src.hasImplementation()) @@ -98,18 +128,32 @@ public class CapabilityStatement30_50 { tgt.setFhirVersion(src.getFhirVersion().toCode()); if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown")) tgt.setAcceptUnknown(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue())); - for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); - for (org.hl7.fhir.r5.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); - for (org.hl7.fhir.r5.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent r : src.getRest()) for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r5.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_30_50.convertCanonicalToReference(t)); + if (src.hasFormat()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue()); + } + if (src.hasPatchFormat()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue()); + } + if (src.hasImplementationGuide()) { + for (org.hl7.fhir.r5.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue()); + } + if (src.hasRest()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent r : src.getRest()) for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent rr : r.getResource()) for (org.hl7.fhir.r5.model.CanonicalType t : rr.getSupportedProfile()) tgt.addProfile(VersionConvertor_30_50.convertCanonicalToReference(t)); + } for (org.hl7.fhir.r5.model.Extension ext : src.getExtension()) { if ("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile".equals(ext.getUrl())) { tgt.addProfile(VersionConvertor_30_50.convertReference((org.hl7.fhir.r5.model.Reference) ext.getValue())); } } - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + if (src.hasRest()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + } return tgt; } @@ -200,12 +244,16 @@ public class CapabilityStatement30_50 { return null; org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + if (src.hasSupportedMessage()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + } for (org.hl7.fhir.r5.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) { org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent event = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent(); tgt.addEvent(event); @@ -233,12 +281,16 @@ public class CapabilityStatement30_50 { return null; org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + } if (src.hasReliableCache()) tgt.setReliableCache(src.getReliableCache()); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + if (src.hasSupportedMessage()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + } for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) { org.hl7.fhir.r5.model.Extension e = new org.hl7.fhir.r5.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT); e.addExtension(new org.hl7.fhir.r5.model.Extension("code", VersionConvertor_30_50.convertCoding(t.getCode()))); @@ -321,11 +373,21 @@ public class CapabilityStatement30_50 { tgt.setDocumentation(src.getDocumentation()); if (src.hasSecurity()) tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r5.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -340,11 +402,21 @@ public class CapabilityStatement30_50 { tgt.setDocumentation(src.getDocumentation()); if (src.hasSecurity()) tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue()); + } return tgt; } @@ -383,7 +455,9 @@ public class CapabilityStatement30_50 { tgt.setProfile(VersionConvertor_30_50.convertCanonicalToReference(src.getProfileElement())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + if (src.hasInteraction()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } if (src.hasVersioning()) tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); if (src.hasReadHistory()) @@ -398,10 +472,18 @@ public class CapabilityStatement30_50 { tgt.setConditionalUpdate(src.getConditionalUpdate()); if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_50.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + if (src.hasReferencePolicy()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_50.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } return tgt; } @@ -416,7 +498,9 @@ public class CapabilityStatement30_50 { tgt.setProfileElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getProfile())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + if (src.hasInteraction()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } if (src.hasVersioning()) tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); if (src.hasReadHistory()) @@ -431,10 +515,18 @@ public class CapabilityStatement30_50 { tgt.setConditionalUpdate(src.getConditionalUpdate()); if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_50.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); - for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + if (src.hasReferencePolicy()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getReferencePolicy()) VersionConvertor_30_50.copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue()); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } return tgt; } @@ -477,7 +569,9 @@ public class CapabilityStatement30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; @@ -490,7 +584,9 @@ public class CapabilityStatement30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasCors()) tgt.setCors(src.getCors()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasService()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService()) tgt.addService(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CarePlan30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CarePlan30_50.java index ab58ab240..c163a4130 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CarePlan30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CarePlan30_50.java @@ -3,7 +3,6 @@ package org.hl7.fhir.convertors.conv30_50; import org.hl7.fhir.convertors.VersionConvertor_30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; - import java.util.List; public class CarePlan30_50 { @@ -81,7 +80,9 @@ public class CarePlan30_50 { return null; org.hl7.fhir.dstu3.model.CarePlan tgt = new org.hl7.fhir.dstu3.model.CarePlan(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) { tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); } @@ -92,31 +93,47 @@ public class CarePlan30_50 { tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); } if (src.hasStatus()) { - tgt.setStatus(convertCarePlanStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + } } if (src.hasIntent()) { - tgt.setIntent(convertCarePlanIntent(src.getIntent())); + if (src.hasIntent()) { + tgt.setIntent(convertCarePlanIntent(src.getIntent())); + } } for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) { tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); } if (src.hasTitle()) { - tgt.setTitle(src.getTitle()); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } if (src.hasSubject()) { - tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); + if (src.hasSubject()) { + tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); + } } if (src.hasEncounter()) { - tgt.setContext(VersionConvertor_30_50.convertReference(src.getEncounter())); + if (src.hasEncounter()) { + tgt.setContext(VersionConvertor_30_50.convertReference(src.getEncounter())); + } } if (src.hasPeriod()) { - tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); + } } if (src.hasAuthor()) { - tgt.addAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); + if (src.hasAuthor()) { + tgt.addAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); + } } for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam()) { tgt.addCareTeam(VersionConvertor_30_50.convertReference(t)); @@ -157,10 +174,14 @@ public class CarePlan30_50 { tgt.addProgress(VersionConvertor_30_50.convertAnnotation(t)); } if (src.hasReference()) { - tgt.setReference(VersionConvertor_30_50.convertReference(src.getReference())); + if (src.hasReference()) { + tgt.setReference(VersionConvertor_30_50.convertReference(src.getReference())); + } } if (src.hasDetail()) { - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } } return tgt; } @@ -180,10 +201,14 @@ public class CarePlan30_50 { tgt.addProgress(VersionConvertor_30_50.convertAnnotation(t)); } if (src.hasReference()) { - tgt.setReference(VersionConvertor_30_50.convertReference(src.getReference())); + if (src.hasReference()) { + tgt.setReference(VersionConvertor_30_50.convertReference(src.getReference())); + } } if (src.hasDetail()) { - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + if (src.hasDetail()) { + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + } } return tgt; } @@ -260,11 +285,15 @@ public class CarePlan30_50 { if (src.hasCategory()) { org.hl7.fhir.r5.model.Extension t = new org.hl7.fhir.r5.model.Extension(); t.setUrl(CarePlanActivityDetailComponentExtension); - t.setValue(VersionConvertor_30_50.convertType(src.getCategory())); + if (src.hasCategory()) { + t.setValue(VersionConvertor_30_50.convertType(src.getCategory())); + } tgt.addExtension(t); } if (src.hasCode()) { - tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); + if (src.hasCode()) { + tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); + } } for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) { tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); @@ -276,37 +305,55 @@ public class CarePlan30_50 { tgt.addGoal(VersionConvertor_30_50.convertReference(t)); } if (src.hasStatus()) { - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + if (src.hasStatus()) { + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + } } if (src.hasStatusReason()) { org.hl7.fhir.r5.model.Coding code = new org.hl7.fhir.r5.model.Coding(); - code.setCode(src.getStatusReason()); + if (src.hasStatusReason()) { + code.setCode(src.getStatusReason()); + } org.hl7.fhir.r5.model.CodeableConcept t = new org.hl7.fhir.r5.model.CodeableConcept(code); tgt.setStatusReason(t); } if (src.hasProhibited()) { - tgt.setDoNotPerform(src.getProhibited()); + if (src.hasProhibited()) { + tgt.setDoNotPerform(src.getProhibited()); + } } if (src.hasScheduled()) { - tgt.setScheduled(VersionConvertor_30_50.convertType(src.getScheduled())); + if (src.hasScheduled()) { + tgt.setScheduled(VersionConvertor_30_50.convertType(src.getScheduled())); + } } if (src.hasLocation()) { - tgt.setLocation(VersionConvertor_30_50.convertReference(src.getLocation())); + if (src.hasLocation()) { + tgt.setLocation(VersionConvertor_30_50.convertReference(src.getLocation())); + } } for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) { tgt.addPerformer(VersionConvertor_30_50.convertReference(t)); } if (src.hasProduct()) { - tgt.setProduct(VersionConvertor_30_50.convertType(src.getProduct())); + if (src.hasProduct()) { + tgt.setProduct(VersionConvertor_30_50.convertType(src.getProduct())); + } } if (src.hasDailyAmount()) { - tgt.setDailyAmount(VersionConvertor_30_50.convertSimpleQuantity(src.getDailyAmount())); + if (src.hasDailyAmount()) { + tgt.setDailyAmount(VersionConvertor_30_50.convertSimpleQuantity(src.getDailyAmount())); + } } if (src.hasQuantity()) { - tgt.setQuantity(VersionConvertor_30_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasQuantity()) { + tgt.setQuantity(VersionConvertor_30_50.convertSimpleQuantity(src.getQuantity())); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CareTeam30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CareTeam30_50.java index fa8b0c4fe..501d6c5b2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CareTeam30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CareTeam30_50.java @@ -11,21 +11,35 @@ public class CareTeam30_50 { return null; org.hl7.fhir.r5.model.CareTeam tgt = new org.hl7.fhir.r5.model.CareTeam(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertCareTeamStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + } + if (src.hasManagingOrganization()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -34,23 +48,33 @@ public class CareTeam30_50 { return null; org.hl7.fhir.dstu3.model.CareTeam tgt = new org.hl7.fhir.dstu3.model.CareTeam(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertCareTeamStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReasonCode(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); for (CodeableReference t : src.getReason()) if (t.hasReference()) tgt.addReasonReference(VersionConvertor_30_50.convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasManagingOrganization()) { + for (org.hl7.fhir.r5.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ClinicalImpression30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ClinicalImpression30_50.java index 60234f939..e0cfff415 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ClinicalImpression30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ClinicalImpression30_50.java @@ -10,7 +10,9 @@ public class ClinicalImpression30_50 { return null; org.hl7.fhir.dstu3.model.ClinicalImpression tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); if (src.hasDescription()) @@ -27,14 +29,26 @@ public class ClinicalImpression30_50 { tgt.setAssessor(VersionConvertor_30_50.convertReference(src.getPerformer())); if (src.hasPrevious()) tgt.setPrevious(VersionConvertor_30_50.convertReference(src.getPrevious())); - for (org.hl7.fhir.r5.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + if (src.hasProblem()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasProtocol()) { + for (org.hl7.fhir.r5.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + } if (src.hasSummary()) tgt.setSummary(src.getSummary()); - for (org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasFinding()) { + for (org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } + if (src.hasPrognosisCodeableConcept()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasPrognosisReference()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -43,7 +57,9 @@ public class ClinicalImpression30_50 { return null; org.hl7.fhir.r5.model.ClinicalImpression tgt = new org.hl7.fhir.r5.model.ClinicalImpression(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); if (src.hasDescription()) @@ -60,14 +76,26 @@ public class ClinicalImpression30_50 { tgt.setPerformer(VersionConvertor_30_50.convertReference(src.getAssessor())); if (src.hasPrevious()) tgt.setPrevious(VersionConvertor_30_50.convertReference(src.getPrevious())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + if (src.hasProblem()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasProtocol()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getProtocol()) tgt.addProtocol(t.getValue()); + } if (src.hasSummary()) tgt.setSummary(src.getSummary()); - for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasFinding()) { + for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } + if (src.hasPrognosisCodeableConcept()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasPrognosisReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CodeSystem30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CodeSystem30_50.java index c95daaeae..6b77acc33 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CodeSystem30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CodeSystem30_50.java @@ -28,11 +28,17 @@ public class CodeSystem30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) @@ -51,9 +57,15 @@ public class CodeSystem30_50 { tgt.setContent(convertCodeSystemContentMode(src.getContent())); if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -80,11 +92,17 @@ public class CodeSystem30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) @@ -103,9 +121,15 @@ public class CodeSystem30_50 { tgt.setContent(convertCodeSystemContentMode(src.getContent())); if (src.hasCount()) tgt.setCount(src.getCount()); - for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasFilter()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -152,7 +176,9 @@ public class CodeSystem30_50 { tgt.setCode(src.getCode()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getOperator()) VersionConvertor_30_50.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_50.convertFilterOperator(t.getValue()))); + if (src.hasOperator()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getOperator()) VersionConvertor_30_50.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_50.convertFilterOperator(t.getValue()))); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -167,7 +193,9 @@ public class CodeSystem30_50 { tgt.setCode(src.getCode()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.Enumeration t : src.getOperator()) VersionConvertor_30_50.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_50.convertFilterOperator(t.getValue()))); + if (src.hasOperator()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getOperator()) VersionConvertor_30_50.copyElement(t, tgt.addOperatorElement().setValue(VersionConvertor_30_50.convertFilterOperator(t.getValue()))); + } if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -218,9 +246,15 @@ public class CodeSystem30_50 { tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } @@ -235,9 +269,15 @@ public class CodeSystem30_50 { tgt.setDisplay(src.getDisplay()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Communication30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Communication30_50.java index c06befd26..5020b2556 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Communication30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Communication30_50.java @@ -11,10 +11,18 @@ public class Communication30_50 { return null; org.hl7.fhir.dstu3.model.Communication tgt = new org.hl7.fhir.dstu3.model.Communication(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) if (src.getStatus() == org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE) tgt.setNotDone(true); @@ -22,11 +30,17 @@ public class Communication30_50 { tgt.setStatus(convertCommunicationStatus(src.getStatus())); if (src.hasStatusReason()) tgt.setNotDoneReason(VersionConvertor_30_50.convertCodeableConcept(src.getStatusReason())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_50.convertReference(t)); + if (src.hasRecipient()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_50.convertReference(t)); + } if (src.hasEncounter()) tgt.setContext(VersionConvertor_30_50.convertReference(src.getEncounter())); if (src.hasSent()) @@ -39,8 +53,12 @@ public class Communication30_50 { tgt.addReasonCode(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); for (CodeableReference t : src.getReason()) if (t.hasReference()) tgt.addReasonReference(VersionConvertor_30_50.convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasPayload()) { + for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -49,21 +67,35 @@ public class Communication30_50 { return null; org.hl7.fhir.r5.model.Communication tgt = new org.hl7.fhir.r5.model.Communication(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasNotDone()) tgt.setStatus(org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE); else if (src.hasStatus()) tgt.setStatus(convertCommunicationStatus(src.getStatus())); if (src.hasNotDoneReason()) tgt.setStatusReason(VersionConvertor_30_50.convertCodeableConcept(src.getNotDoneReason())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasMedium()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_50.convertReference(t)); + if (src.hasRecipient()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(VersionConvertor_30_50.convertReference(t)); + } if (src.hasContext()) tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getContext())); if (src.hasSent()) @@ -72,10 +104,18 @@ public class Communication30_50 { tgt.setReceived(src.getReceived()); if (src.hasSender()) tgt.setSender(VersionConvertor_30_50.convertReference(src.getSender())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CompartmentDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CompartmentDefinition30_50.java index 00fc6a667..c6b9d9d7b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CompartmentDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/CompartmentDefinition30_50.java @@ -24,18 +24,26 @@ public class CompartmentDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(convertCompartmentType(src.getCode())); if (src.hasSearch()) tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -58,18 +66,26 @@ public class CompartmentDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(convertCompartmentType(src.getCode())); if (src.hasSearch()) tgt.setSearch(src.getSearch()); - for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } return tgt; } @@ -80,7 +96,9 @@ public class CompartmentDefinition30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasParam()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -93,7 +111,9 @@ public class CompartmentDefinition30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.r5.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + if (src.hasParam()) { + for (org.hl7.fhir.r5.model.StringType t : src.getParam()) tgt.addParam(t.getValue()); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Composition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Composition30_50.java index 45912a308..2f9549d8d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Composition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Composition30_50.java @@ -24,17 +24,27 @@ public class Composition30_50 { tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getEncounter())); if (src.hasDate()) tgt.setDate(src.getDate()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_50.convertReference(t)); + if (src.hasAuthor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_50.convertReference(t)); + } if (src.hasTitle()) tgt.setTitle(src.getTitle()); if (src.hasConfidentiality()) tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); - for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + if (src.hasAttester()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_50.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); - for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasSection()) { + for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -57,17 +67,27 @@ public class Composition30_50 { tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getEncounter())); if (src.hasDate()) tgt.setDate(src.getDate()); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_50.convertReference(t)); + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(VersionConvertor_30_50.convertReference(t)); + } if (src.hasTitle()) tgt.setTitle(src.getTitle()); if (src.hasConfidentiality()) tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); - for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + if (src.hasAttester()) { + for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_50.convertReference(src.getCustodian())); - for (org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); - for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); - for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasSection()) { + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -138,10 +158,14 @@ public class Composition30_50 { return null; org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -150,10 +174,14 @@ public class Composition30_50 { return null; org.hl7.fhir.r5.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionEventComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -272,10 +300,14 @@ public class Composition30_50 { tgt.setMode(convertSectionMode(src.getMode())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_50.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_50.convertReference(t)); + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_50.convertReference(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_50.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasSection()) { + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } @@ -294,10 +326,14 @@ public class Composition30_50 { tgt.setMode(convertSectionMode(src.getMode())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_50.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_50.convertReference(t)); + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(VersionConvertor_30_50.convertReference(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_50.convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + if (src.hasSection()) { + for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java index 9a94d4ff0..a1d2b2b62 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ConceptMap30_50.java @@ -28,11 +28,17 @@ public class ConceptMap30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) @@ -41,7 +47,9 @@ public class ConceptMap30_50 { tgt.setSource(VersionConvertor_30_50.convertType(src.getSource())); if (src.hasTarget()) tgt.setTarget(VersionConvertor_30_50.convertType(src.getTarget())); - for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) tgt.addGroup(convertConceptMapGroupComponent(t)); + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) tgt.addGroup(convertConceptMapGroupComponent(t)); + } return tgt; } @@ -121,7 +129,9 @@ public class ConceptMap30_50 { tgt.setTarget(src.getTarget()); if (src.hasTargetVersion()) tgt.setTargetVersion(src.getTargetVersion()); - for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + } if (src.hasUnmapped()) tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); return tgt; @@ -140,7 +150,9 @@ public class ConceptMap30_50 { tgt.setTarget(src.getTarget()); if (src.hasTargetVersion()) tgt.setTargetVersion(src.getTargetVersion()); - for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + } if (src.hasUnmapped()) tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); return tgt; @@ -281,7 +293,9 @@ public class ConceptMap30_50 { if (src.hasNoMap() && src.getNoMap() == true) { tgt.addTarget(new org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent().setEquivalence(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED)); } else { - for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t)); + } } return tgt; } @@ -316,8 +330,12 @@ public class ConceptMap30_50 { tgt.setRelationship(convertConceptMapRelationship(src.getEquivalence())); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } @@ -334,8 +352,12 @@ public class ConceptMap30_50 { tgt.setEquivalence(convertConceptMapEquivalence(src.getRelationship())); if (src.hasComment()) tgt.setComment(src.getComment()); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Condition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Condition30_50.java index 8127651d4..e79ac4d1c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Condition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Condition30_50.java @@ -18,17 +18,23 @@ public class Condition30_50 { return null; org.hl7.fhir.r5.model.Condition tgt = new org.hl7.fhir.r5.model.Condition(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasSeverity()) tgt.setSeverity(VersionConvertor_30_50.convertCodeableConcept(src.getSeverity())); if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasBodySite()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasContext()) @@ -43,8 +49,12 @@ public class Condition30_50 { tgt.setAsserter(VersionConvertor_30_50.convertReference(src.getAsserter())); if (src.hasStage()) tgt.addStage(convertConditionStageComponent(src.getStage())); - for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasEvidence()) { + for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -53,17 +63,23 @@ public class Condition30_50 { return null; org.hl7.fhir.dstu3.model.Condition tgt = new org.hl7.fhir.dstu3.model.Condition(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasClinicalStatus()) tgt.setClinicalStatus(convertConditionClinicalStatus(src.getClinicalStatus())); if (src.hasVerificationStatus()) tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasSeverity()) tgt.setSeverity(VersionConvertor_30_50.convertCodeableConcept(src.getSeverity())); if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasBodySite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasEncounter()) @@ -78,8 +94,12 @@ public class Condition30_50 { tgt.setAsserter(VersionConvertor_30_50.convertReference(src.getAsserter())); if (src.hasStage()) tgt.setStage(convertConditionStageComponent(src.getStageFirstRep())); - for (org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasEvidence()) { + for (org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -129,8 +149,12 @@ public class Condition30_50 { return null; org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -139,8 +163,12 @@ public class Condition30_50 { return null; org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -151,7 +179,9 @@ public class Condition30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasSummary()) tgt.setSummary(VersionConvertor_30_50.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_50.convertReference(t)); + if (src.hasAssessment()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -162,7 +192,9 @@ public class Condition30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasSummary()) tgt.setSummary(VersionConvertor_30_50.convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_50.convertReference(t)); + if (src.hasAssessment()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment()) tgt.addAssessment(VersionConvertor_30_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DataElement30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DataElement30_50.java index c0e92411a..f6907ddd2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DataElement30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DataElement30_50.java @@ -12,7 +12,9 @@ public class DataElement30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl().replace("/DataElement/", "/StructureDefinition/de-")); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasStatus()) @@ -27,13 +29,23 @@ public class DataElement30_50 { tgt.setName(src.getName()); if (src.hasTitle()) tgt.setTitle(src.getTitle()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.getSnapshot().addElement(VersionConvertor_30_50.convertElementDefinition(t)); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t)); + } + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.getSnapshot().addElement(VersionConvertor_30_50.convertElementDefinition(t)); + } tgt.setKind(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); tgt.setAbstract(false); tgt.setType(tgt.getName()); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DetectedIssue30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DetectedIssue30_50.java index db87e65f9..5175753ec 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DetectedIssue30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DetectedIssue30_50.java @@ -24,12 +24,16 @@ public class DetectedIssue30_50 { tgt.setDateElement(VersionConvertor_30_50.convertDateTime(src.getIdentifiedDateTimeType())); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); - for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_50.convertReference(t)); + if (src.hasImplicated()) { + for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_50.convertReference(t)); + } if (src.hasDetail()) tgt.setDetail(src.getDetail()); if (src.hasReference()) tgt.setReference(src.getReference()); - for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasMitigation()) { + for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } @@ -52,12 +56,16 @@ public class DetectedIssue30_50 { tgt.setIdentified(VersionConvertor_30_50.convertDateTime(src.getDateElement())); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_50.convertReference(t)); + if (src.hasImplicated()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated()) tgt.addImplicated(VersionConvertor_30_50.convertReference(t)); + } if (src.hasDetail()) tgt.setDetail(src.getDetail()); if (src.hasReference()) tgt.setReference(src.getReference()); - for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + if (src.hasMitigation()) { + for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DeviceUseStatement30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DeviceUseStatement30_50.java index 41b2d692b..5a47e08ac 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DeviceUseStatement30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DeviceUseStatement30_50.java @@ -11,7 +11,9 @@ public class DeviceUseStatement30_50 { return null; org.hl7.fhir.dstu3.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu3.model.DeviceUseStatement(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); if (src.hasSubject()) @@ -28,7 +30,9 @@ public class DeviceUseStatement30_50 { tgt.addIndication(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); if (src.hasBodySite()) tgt.setBodySite(VersionConvertor_30_50.convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -37,7 +41,9 @@ public class DeviceUseStatement30_50 { return null; org.hl7.fhir.r5.model.DeviceUseStatement tgt = new org.hl7.fhir.r5.model.DeviceUseStatement(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); if (src.hasSubject()) @@ -50,10 +56,14 @@ public class DeviceUseStatement30_50 { tgt.setSource(VersionConvertor_30_50.convertReference(src.getSource())); if (src.hasDevice()) tgt.setDevice(VersionConvertor_30_50.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + if (src.hasIndication()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } if (src.hasBodySite()) tgt.setBodySite(VersionConvertor_30_50.convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DiagnosticReport30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DiagnosticReport30_50.java index aaa4b93c6..d5c7fee8d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DiagnosticReport30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DiagnosticReport30_50.java @@ -10,8 +10,12 @@ public class DiagnosticReport30_50 { return null; org.hl7.fhir.r5.model.DiagnosticReport tgt = new org.hl7.fhir.r5.model.DiagnosticReport(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); if (src.hasCategory()) @@ -26,14 +30,26 @@ public class DiagnosticReport30_50 { tgt.setEffective(VersionConvertor_30_50.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); + if (src.hasSpecimen()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage()) tgt.addMedia(convertDiagnosticReportImageComponent(t)); + } if (src.hasConclusion()) tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_50.convertAttachment(t)); + if (src.hasCodedDiagnosis()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addConclusionCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_50.convertAttachment(t)); + } return tgt; } @@ -42,8 +58,12 @@ public class DiagnosticReport30_50 { return null; org.hl7.fhir.dstu3.model.DiagnosticReport tgt = new org.hl7.fhir.dstu3.model.DiagnosticReport(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); if (src.hasCategory()) @@ -58,14 +78,26 @@ public class DiagnosticReport30_50 { tgt.setEffective(VersionConvertor_30_50.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + if (src.hasSpecimen()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.r5.model.Reference t : src.getResult()) tgt.addResult(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasMedia()) { + for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addImage(convertDiagnosticReportImageComponent(t)); + } if (src.hasConclusion()) tgt.setConclusion(src.getConclusion()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_50.convertAttachment(t)); + if (src.hasConclusionCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode()) tgt.addCodedDiagnosis(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(VersionConvertor_30_50.convertAttachment(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DocumentReference30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DocumentReference30_50.java index 0862a30f2..b34f94e56 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DocumentReference30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/DocumentReference30_50.java @@ -12,7 +12,9 @@ public class DocumentReference30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasMasterIdentifier()) tgt.setMasterIdentifier(VersionConvertor_30_50.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); if (src.hasDocStatus()) @@ -29,11 +31,17 @@ public class DocumentReference30_50 { tgt.setAuthenticator(VersionConvertor_30_50.convertReference(src.getAuthenticator())); if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_50.convertReference(src.getCustodian())); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } if (src.hasContext()) tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); return tgt; @@ -46,7 +54,9 @@ public class DocumentReference30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasMasterIdentifier()) tgt.setMasterIdentifier(VersionConvertor_30_50.convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertDocumentReferenceStatus(src.getStatus())); if (src.hasDocStatus()) @@ -63,11 +73,17 @@ public class DocumentReference30_50 { tgt.setAuthenticator(VersionConvertor_30_50.convertReference(src.getAuthenticator())); if (src.hasCustodian()) tgt.setCustodian(VersionConvertor_30_50.convertReference(src.getCustodian())); - for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } if (src.hasContext()) tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); return tgt; @@ -104,7 +120,9 @@ public class DocumentReference30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasEncounter()) tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getEncounterFirstRep())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); if (src.hasFacilityType()) @@ -113,7 +131,9 @@ public class DocumentReference30_50 { tgt.setPracticeSetting(VersionConvertor_30_50.convertCodeableConcept(src.getPracticeSetting())); if (src.hasSourcePatientInfo()) tgt.setSourcePatientInfo(VersionConvertor_30_50.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.r5.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasRelated()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } @@ -124,7 +144,9 @@ public class DocumentReference30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasEncounter()) tgt.addEncounter(VersionConvertor_30_50.convertReference(src.getEncounter())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasEvent()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent()) tgt.addEvent(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); if (src.hasFacilityType()) @@ -133,7 +155,9 @@ public class DocumentReference30_50 { tgt.setPracticeSetting(VersionConvertor_30_50.convertCodeableConcept(src.getPracticeSetting())); if (src.hasSourcePatientInfo()) tgt.setSourcePatientInfo(VersionConvertor_30_50.convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + if (src.hasRelated()) { + for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Encounter30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Encounter30_50.java index 8303af7c5..850ef3133 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Encounter30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Encounter30_50.java @@ -35,33 +35,55 @@ public class Encounter30_50 { return null; org.hl7.fhir.r5.model.Encounter tgt = new org.hl7.fhir.r5.model.Encounter(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEncounterStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu3.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + } if (src.hasClass_()) tgt.setClass_(VersionConvertor_30_50.convertCoding(src.getClass_())); - for (org.hl7.fhir.dstu3.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasClassHistory()) { + for (org.hl7.fhir.dstu3.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_50.convertCodeableConcept(src.getPriority())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasIncomingReferral()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } if (src.hasAppointment()) tgt.addAppointment(VersionConvertor_30_50.convertReference(src.getAppointment())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); if (src.hasLength()) tgt.setLength(VersionConvertor_30_50.convertDuration(src.getLength())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.dstu3.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + } if (src.hasHospitalization()) tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } if (src.hasServiceProvider()) tgt.setServiceProvider(VersionConvertor_30_50.convertReference(src.getServiceProvider())); if (src.hasPartOf()) @@ -74,21 +96,35 @@ public class Encounter30_50 { return null; org.hl7.fhir.dstu3.model.Encounter tgt = new org.hl7.fhir.dstu3.model.Encounter(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEncounterStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + } if (src.hasClass_()) tgt.setClass_(VersionConvertor_30_50.convertCoding(src.getClass_())); - for (org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasClassHistory()) { + for (org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_50.convertCodeableConcept(src.getPriority())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addIncomingReferral(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } if (src.hasAppointment()) tgt.setAppointment(VersionConvertor_30_50.convertReference(src.getAppointmentFirstRep())); if (src.hasPeriod()) @@ -97,11 +133,17 @@ public class Encounter30_50 { tgt.setLength(VersionConvertor_30_50.convertDuration(src.getLength())); for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); - for (org.hl7.fhir.r5.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r5.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + } if (src.hasHospitalization()) tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } if (src.hasServiceProvider()) tgt.setServiceProvider(VersionConvertor_30_50.convertReference(src.getServiceProvider())); if (src.hasPartOf()) @@ -122,9 +164,15 @@ public class Encounter30_50 { tgt.setAdmitSource(VersionConvertor_30_50.convertCodeableConcept(src.getAdmitSource())); if (src.hasReAdmission()) tgt.setReAdmission(VersionConvertor_30_50.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasDietPreference()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_50.convertReference(src.getDestination())); if (src.hasDischargeDisposition()) @@ -145,9 +193,15 @@ public class Encounter30_50 { tgt.setAdmitSource(VersionConvertor_30_50.convertCodeableConcept(src.getAdmitSource())); if (src.hasReAdmission()) tgt.setReAdmission(VersionConvertor_30_50.convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasDietPreference()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_50.convertReference(src.getDestination())); if (src.hasDischargeDisposition()) @@ -222,7 +276,9 @@ public class Encounter30_50 { return null; org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); if (src.hasIndividual()) @@ -235,7 +291,9 @@ public class Encounter30_50 { return null; org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); if (src.hasIndividual()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Endpoint30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Endpoint30_50.java index 6dc92d146..fa4568891 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Endpoint30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Endpoint30_50.java @@ -10,7 +10,9 @@ public class Endpoint30_50 { return null; org.hl7.fhir.dstu3.model.Endpoint tgt = new org.hl7.fhir.dstu3.model.Endpoint(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEndpointStatus(src.getStatus())); if (src.hasConnectionType()) @@ -19,14 +21,22 @@ public class Endpoint30_50 { tgt.setName(src.getName()); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + if (src.hasPayloadType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasPayloadMimeType()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + } if (src.hasAddress()) tgt.setAddress(src.getAddress()); - for (org.hl7.fhir.r5.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + if (src.hasHeader()) { + for (org.hl7.fhir.r5.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + } return tgt; } @@ -35,7 +45,9 @@ public class Endpoint30_50 { return null; org.hl7.fhir.r5.model.Endpoint tgt = new org.hl7.fhir.r5.model.Endpoint(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEndpointStatus(src.getStatus())); if (src.hasConnectionType()) @@ -44,14 +56,22 @@ public class Endpoint30_50 { tgt.setName(src.getName()); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + if (src.hasPayloadType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasPayloadMimeType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getPayloadMimeType()) tgt.addPayloadMimeType(t.getValue()); + } if (src.hasAddress()) tgt.setAddress(src.getAddress()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + if (src.hasHeader()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getHeader()) tgt.addHeader(t.getValue()); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/EpisodeOfCare30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/EpisodeOfCare30_50.java index 22ebfe0a4..2d1f88806 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/EpisodeOfCare30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/EpisodeOfCare30_50.java @@ -10,23 +10,37 @@ public class EpisodeOfCare30_50 { return null; org.hl7.fhir.dstu3.model.EpisodeOfCare tgt = new org.hl7.fhir.dstu3.model.EpisodeOfCare(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_50.convertReference(src.getPatient())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_50.convertReference(t)); + if (src.hasReferralRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_50.convertReference(t)); + } if (src.hasCareManager()) tgt.setCareManager(VersionConvertor_30_50.convertReference(src.getCareManager())); - for (org.hl7.fhir.r5.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + if (src.hasTeam()) { + for (org.hl7.fhir.r5.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -35,23 +49,37 @@ public class EpisodeOfCare30_50 { return null; org.hl7.fhir.r5.model.EpisodeOfCare tgt = new org.hl7.fhir.r5.model.EpisodeOfCare(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.dstu3.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(VersionConvertor_30_50.convertDiagnosisComponent(t)); + } if (src.hasPatient()) tgt.setPatient(VersionConvertor_30_50.convertReference(src.getPatient())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); if (src.hasPeriod()) tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_50.convertReference(t)); + if (src.hasReferralRequest()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(VersionConvertor_30_50.convertReference(t)); + } if (src.hasCareManager()) tgt.setCareManager(VersionConvertor_30_50.convertReference(src.getCareManager())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + if (src.hasTeam()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getTeam()) tgt.addTeam(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAccount()) tgt.addAccount(VersionConvertor_30_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ExpansionProfile30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ExpansionProfile30_50.java index afa53bc27..580e76673 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ExpansionProfile30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ExpansionProfile30_50.java @@ -83,7 +83,9 @@ public class ExpansionProfile30_50 { tgt.addParameter("force-system-version", t.getSystem() + "|" + t.getVersion()); } if (src.hasExcludedSystem()) { - tgt.addParameter("exclude-system", src.getExcludedSystem().getSystem() + "|" + src.getExcludedSystem().getVersion()); + if (src.hasExcludedSystem()) { + tgt.addParameter("exclude-system", src.getExcludedSystem().getSystem() + "|" + src.getExcludedSystem().getVersion()); + } } if (src.hasIncludeDesignations()) tgt.addParameter("includeDesignations", src.getIncludeDesignations()); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/FamilyMemberHistory30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/FamilyMemberHistory30_50.java index 3f6481288..eb1c1b2fa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/FamilyMemberHistory30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/FamilyMemberHistory30_50.java @@ -45,8 +45,12 @@ public class FamilyMemberHistory30_50 { return null; org.hl7.fhir.dstu3.model.FamilyMemberHistory tgt = new org.hl7.fhir.dstu3.model.FamilyMemberHistory(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesCanonical()) tgt.addDefinition(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + } if (src.hasStatus()) tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); if (src.hasDataAbsentReason()) @@ -71,8 +75,12 @@ public class FamilyMemberHistory30_50 { tgt.addReasonCode(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); for (CodeableReference t : src.getReason()) if (t.hasReference()) tgt.addReasonReference(VersionConvertor_30_50.convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -81,8 +89,12 @@ public class FamilyMemberHistory30_50 { return null; org.hl7.fhir.r5.model.FamilyMemberHistory tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesCanonical(t.getReference()); + } if (src.hasStatus()) tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); if (src.hasNotDoneReason()) @@ -103,10 +115,18 @@ public class FamilyMemberHistory30_50 { tgt.setEstimatedAge(src.getEstimatedAge()); if (src.hasDeceased()) tgt.setDeceased(VersionConvertor_30_50.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } return tgt; } @@ -121,7 +141,9 @@ public class FamilyMemberHistory30_50 { tgt.setOutcome(VersionConvertor_30_50.convertCodeableConcept(src.getOutcome())); if (src.hasOnset()) tgt.setOnset(VersionConvertor_30_50.convertType(src.getOnset())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -136,7 +158,9 @@ public class FamilyMemberHistory30_50 { tgt.setOutcome(VersionConvertor_30_50.convertCodeableConcept(src.getOutcome())); if (src.hasOnset()) tgt.setOnset(VersionConvertor_30_50.convertType(src.getOnset())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Flag30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Flag30_50.java index 08f628269..88f0e4e9b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Flag30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Flag30_50.java @@ -10,7 +10,9 @@ public class Flag30_50 { return null; org.hl7.fhir.r5.model.Flag tgt = new org.hl7.fhir.r5.model.Flag(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFlagStatus(src.getStatus())); if (src.hasCategory()) @@ -33,7 +35,9 @@ public class Flag30_50 { return null; org.hl7.fhir.dstu3.model.Flag tgt = new org.hl7.fhir.dstu3.model.Flag(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFlagStatus(src.getStatus())); if (src.hasCategory()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Goal30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Goal30_50.java index a74583398..c42b79d52 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Goal30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Goal30_50.java @@ -11,10 +11,14 @@ public class Goal30_50 { return null; org.hl7.fhir.dstu3.model.Goal tgt = new org.hl7.fhir.dstu3.model.Goal(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasLifecycleStatus()) tgt.setStatus(convertGoalStatus(src.getLifecycleStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_50.convertCodeableConcept(src.getPriority())); if (src.hasDescription()) @@ -31,8 +35,12 @@ public class Goal30_50 { tgt.setStatusReason(src.getStatusReason()); if (src.hasExpressedBy()) tgt.setExpressedBy(VersionConvertor_30_50.convertReference(src.getExpressedBy())); - for (org.hl7.fhir.r5.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } for (CodeableReference t : src.getOutcome()) if (t.hasConcept()) tgt.addOutcomeCode(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); for (CodeableReference t : src.getOutcome()) if (t.hasReference()) @@ -45,10 +53,14 @@ public class Goal30_50 { return null; org.hl7.fhir.r5.model.Goal tgt = new org.hl7.fhir.r5.model.Goal(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setLifecycleStatus(convertGoalStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPriority()) tgt.setPriority(VersionConvertor_30_50.convertCodeableConcept(src.getPriority())); if (src.hasDescription()) @@ -65,10 +77,18 @@ public class Goal30_50 { tgt.setStatusReason(src.getStatusReason()); if (src.hasExpressedBy()) tgt.setExpressedBy(VersionConvertor_30_50.convertReference(src.getExpressedBy())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOutcomeCode()) tgt.addOutcome(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getOutcomeReference()) tgt.addOutcome(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasOutcomeCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOutcomeCode()) tgt.addOutcome(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasOutcomeReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getOutcomeReference()) tgt.addOutcome(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/GraphDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/GraphDefinition30_50.java index 7c2c29381..156b3b886 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/GraphDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/GraphDefinition30_50.java @@ -96,18 +96,26 @@ public class GraphDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasStart()) tgt.setStart(src.getStart()); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } @@ -130,18 +138,26 @@ public class GraphDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasStart()) tgt.setStart(src.getStart()); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } @@ -160,7 +176,9 @@ public class GraphDefinition30_50 { tgt.setMax(src.getMax()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + } return tgt; } @@ -179,7 +197,9 @@ public class GraphDefinition30_50 { tgt.setMax(src.getMax()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + } return tgt; } @@ -224,8 +244,12 @@ public class GraphDefinition30_50 { tgt.setType(src.getType()); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasCompartment()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + } + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } @@ -238,8 +262,12 @@ public class GraphDefinition30_50 { tgt.setType(src.getType()); if (src.hasProfile()) tgt.setProfile(src.getProfile()); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); - for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + if (src.hasCompartment()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + } + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Group30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Group30_50.java index f13a3dfb8..2cbc96fbf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Group30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Group30_50.java @@ -10,7 +10,9 @@ public class Group30_50 { return null; org.hl7.fhir.r5.model.Group tgt = new org.hl7.fhir.r5.model.Group(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasType()) @@ -23,8 +25,12 @@ public class Group30_50 { tgt.setName(src.getName()); if (src.hasQuantity()) tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.dstu3.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.dstu3.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } @@ -33,7 +39,9 @@ public class Group30_50 { return null; org.hl7.fhir.dstu3.model.Group tgt = new org.hl7.fhir.dstu3.model.Group(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasType()) @@ -46,8 +54,12 @@ public class Group30_50 { tgt.setName(src.getName()); if (src.hasQuantity()) tgt.setQuantity(src.getQuantity()); - for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/HealthcareService30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/HealthcareService30_50.java index b70b534d3..9f80cfde3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/HealthcareService30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/HealthcareService30_50.java @@ -12,16 +12,24 @@ public class HealthcareService30_50 { return null; org.hl7.fhir.r5.model.HealthcareService tgt = new org.hl7.fhir.r5.model.HealthcareService(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasProvidedBy()) tgt.setProvidedBy(VersionConvertor_30_50.convertReference(src.getProvidedBy())); if (src.hasCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(src.getCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasComment()) @@ -30,25 +38,45 @@ public class HealthcareService30_50 { tgt.setExtraDetails(src.getExtraDetails()); if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_50.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasEligibility() || src.hasEligibilityNote()) { HealthcareServiceEligibilityComponent t = tgt.addEligibility(); - t.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getEligibility())); + if (src.hasEligibility()) { + t.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getEligibility())); + } if (src.hasEligibilityNote()) t.setComment(src.getEligibilityNote()); } - for (org.hl7.fhir.dstu3.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasProgramName()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getProgramName()) tgt.addProgram().setText(t.getValue()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAppointmentRequired()) tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -57,16 +85,24 @@ public class HealthcareService30_50 { return null; org.hl7.fhir.dstu3.model.HealthcareService tgt = new org.hl7.fhir.dstu3.model.HealthcareService(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasProvidedBy()) tgt.setProvidedBy(VersionConvertor_30_50.convertReference(src.getProvidedBy())); if (src.hasCategory()) tgt.setCategory(VersionConvertor_30_50.convertCodeableConcept(src.getCategoryFirstRep())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasComment()) @@ -75,24 +111,44 @@ public class HealthcareService30_50 { tgt.setExtraDetails(src.getExtraDetails()); if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_50.convertAttachment(src.getPhoto())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasEligibility()) { - tgt.setEligibility(VersionConvertor_30_50.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); + if (src.hasEligibility()) { + tgt.setEligibility(VersionConvertor_30_50.convertCodeableConcept(src.getEligibilityFirstRep().getCode())); + } if (src.getEligibilityFirstRep().hasComment()) tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); } - for (CodeableConcept t : src.getProgram()) tgt.addProgramName(t.getText()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasProgram()) { + for (CodeableConcept t : src.getProgram()) tgt.addProgramName(t.getText()); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAppointmentRequired()) tgt.setAppointmentRequired(src.getAppointmentRequired()); - for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -101,7 +157,9 @@ public class HealthcareService30_50 { return null; org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_50.convertDaysOfWeek(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_50.convertDaysOfWeek(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -116,7 +174,9 @@ public class HealthcareService30_50 { return null; org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_50.convertDaysOfWeek(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_50.convertDaysOfWeek(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImagingStudy30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImagingStudy30_50.java index 914b1592f..488aff312 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImagingStudy30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImagingStudy30_50.java @@ -3,7 +3,6 @@ package org.hl7.fhir.convertors.conv30_50; import org.hl7.fhir.convertors.VersionConvertor_30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyProcedureComponent; - import java.util.List; public class ImagingStudy30_50 { @@ -181,31 +180,47 @@ public class ImagingStudy30_50 { org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent(); VersionConvertor_30_50.copyElement(src, tgt); if (src.hasUid()) { - tgt.setUid(src.getUid()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } } if (src.hasNumber()) { - tgt.setNumber(src.getNumber()); + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } } if (src.hasModality()) { - tgt.setModality(VersionConvertor_30_50.convertCoding(src.getModality())); + if (src.hasModality()) { + tgt.setModality(VersionConvertor_30_50.convertCoding(src.getModality())); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } if (src.hasNumberOfInstances()) { - tgt.setNumberOfInstances(src.getNumberOfInstances()); + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } } for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) { tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); } if (src.hasBodySite()) { - tgt.setBodySite(VersionConvertor_30_50.convertCoding(src.getBodySite())); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_30_50.convertCoding(src.getBodySite())); + } } if (src.hasLaterality()) { - tgt.setLaterality(VersionConvertor_30_50.convertCoding(src.getLaterality())); + if (src.hasLaterality()) { + tgt.setLaterality(VersionConvertor_30_50.convertCoding(src.getLaterality())); + } } if (src.hasStarted()) { - tgt.setStartedElement(VersionConvertor_30_50.convertDateTime(src.getStartedElement())); + if (src.hasStartedElement()) { + tgt.setStartedElement(VersionConvertor_30_50.convertDateTime(src.getStartedElement())); + } } for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) { tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); @@ -219,31 +234,47 @@ public class ImagingStudy30_50 { org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent(); VersionConvertor_30_50.copyElement(src, tgt); if (src.hasUid()) { - tgt.setUid(src.getUid()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } } if (src.hasNumber()) { - tgt.setNumber(src.getNumber()); + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } } if (src.hasModality()) { - tgt.setModality(VersionConvertor_30_50.convertCoding(src.getModality())); + if (src.hasModality()) { + tgt.setModality(VersionConvertor_30_50.convertCoding(src.getModality())); + } } if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); + if (src.hasDescription()) { + tgt.setDescription(src.getDescription()); + } } if (src.hasNumberOfInstances()) { - tgt.setNumberOfInstances(src.getNumberOfInstances()); + if (src.hasNumberOfInstances()) { + tgt.setNumberOfInstances(src.getNumberOfInstances()); + } } for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) { tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); } if (src.hasBodySite()) { - tgt.setBodySite(VersionConvertor_30_50.convertCoding(src.getBodySite())); + if (src.hasBodySite()) { + tgt.setBodySite(VersionConvertor_30_50.convertCoding(src.getBodySite())); + } } if (src.hasLaterality()) { - tgt.setLaterality(VersionConvertor_30_50.convertCoding(src.getLaterality())); + if (src.hasLaterality()) { + tgt.setLaterality(VersionConvertor_30_50.convertCoding(src.getLaterality())); + } } if (src.hasStarted()) { - tgt.setStartedElement(VersionConvertor_30_50.convertDateTime(src.getStartedElement())); + if (src.hasStartedElement()) { + tgt.setStartedElement(VersionConvertor_30_50.convertDateTime(src.getStartedElement())); + } } for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) { tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); @@ -278,19 +309,27 @@ public class ImagingStudy30_50 { org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); VersionConvertor_30_50.copyElement(src, tgt); if (src.hasUid()) { - tgt.setUid(src.getUid()); + if (src.hasUid()) { + tgt.setUid(src.getUid()); + } } if (src.hasSopClass()) { org.hl7.fhir.r5.model.Coding c = new org.hl7.fhir.r5.model.Coding(); c.setSystem(URN_IETF_RFC_3986); - c.setCode(src.getSopClass()); + if (src.hasSopClass()) { + c.setCode(src.getSopClass()); + } tgt.setSopClass(c); } if (src.hasNumber()) { - tgt.setNumber(src.getNumber()); + if (src.hasNumber()) { + tgt.setNumber(src.getNumber()); + } } if (src.hasTitle()) { - tgt.setTitle(src.getTitle()); + if (src.hasTitle()) { + tgt.setTitle(src.getTitle()); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Immunization30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Immunization30_50.java index 14567cf85..410248d17 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Immunization30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Immunization30_50.java @@ -11,7 +11,9 @@ public class Immunization30_50 { return null; org.hl7.fhir.r5.model.Immunization tgt = new org.hl7.fhir.r5.model.Immunization(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertImmunizationStatus(src.getStatus())); if (src.hasVaccineCode()) @@ -40,9 +42,15 @@ public class Immunization30_50 { tgt.setRoute(VersionConvertor_30_50.convertCodeableConcept(src.getRoute())); if (src.hasDoseQuantity()) tgt.setDoseQuantity(VersionConvertor_30_50.convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationPractitionerComponent t : src.getPractitioner()) tgt.addPerformer(convertImmunizationPractitionerComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getExplanation().getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + if (src.hasPractitioner()) { + for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationPractitionerComponent t : src.getPractitioner()) tgt.addPerformer(convertImmunizationPractitionerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasExplanation()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getExplanation().getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } return tgt; } @@ -51,7 +59,9 @@ public class Immunization30_50 { return null; org.hl7.fhir.dstu3.model.Immunization tgt = new org.hl7.fhir.dstu3.model.Immunization(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertImmunizationStatus(src.getStatus())); if (src.hasVaccineCode()) @@ -80,8 +90,12 @@ public class Immunization30_50 { tgt.setRoute(VersionConvertor_30_50.convertCodeableConcept(src.getRoute())); if (src.hasDoseQuantity()) tgt.setDoseQuantity(VersionConvertor_30_50.convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) tgt.addPractitioner(convertImmunizationPractitionerComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) tgt.addPractitioner(convertImmunizationPractitionerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.getExplanation().addReason(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImplementationGuide30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImplementationGuide30_50.java index 2ad03b927..175edaa8d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImplementationGuide30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ImplementationGuide30_50.java @@ -4,7 +4,6 @@ import org.hl7.fhir.convertors.VersionConvertorConstants; import org.hl7.fhir.convertors.VersionConvertor_30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; - import java.util.List; public class ImplementationGuide30_50 { @@ -28,11 +27,17 @@ public class ImplementationGuide30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) @@ -40,12 +45,18 @@ public class ImplementationGuide30_50 { tgt.setFhirVersion(v.asStringValue()); break; } - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getDefinition().getGrouping()) tgt.addPackage(convertImplementationGuidePackageComponent(t)); + } for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getDefinition().getResource()) { findPackage(tgt.getPackage(), t.getGroupingId()).addResource(convertImplementationGuidePackageResourceComponent(t)); } - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + if (src.hasGlobal()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } if (src.getDefinition().hasPage()) tgt.setPage(convertImplementationGuidePageComponent(src.getDefinition().getPage())); return tgt; @@ -70,18 +81,30 @@ public class ImplementationGuide30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasFhirVersion()) tgt.addFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + if (src.hasDependency()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependsOn(convertImplementationGuideDependencyComponent(t)); + } + if (src.hasPackage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) tgt.getDefinition().addGrouping(convertImplementationGuidePackageComponent(tgt.getDefinition(), t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } if (src.hasPage()) tgt.getDefinition().setPage(convertImplementationGuidePageComponent(src.getPage())); return tgt; @@ -147,7 +170,9 @@ public class ImplementationGuide30_50 { return null; org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent(); VersionConvertor_30_50.copyElement(src, tgt); - tgt.setId(src.getId()); + if (src.hasId()) { + tgt.setId(src.getId()); + } if (src.hasName()) tgt.setName(src.getName()); if (src.hasDescription()) @@ -179,7 +204,9 @@ public class ImplementationGuide30_50 { org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); VersionConvertor_30_50.copyElement(src, tgt); if (src.hasExampleCanonicalType()) { - tgt.setExampleFor(VersionConvertor_30_50.convertCanonicalToReference(src.getExampleCanonicalType())); + if (src.hasExampleCanonicalType()) { + tgt.setExampleFor(VersionConvertor_30_50.convertCanonicalToReference(src.getExampleCanonicalType())); + } tgt.setExample(true); } else if (src.hasExampleBooleanType()) tgt.setExample(src.getExampleBooleanType().getValue()); @@ -226,7 +253,9 @@ public class ImplementationGuide30_50 { tgt.setTitle(src.getTitle()); if (src.hasGeneration()) tgt.setKind(convertPageGeneration(src.getGeneration())); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } @@ -241,7 +270,9 @@ public class ImplementationGuide30_50 { tgt.setTitle(src.getTitle()); if (src.hasKind()) tgt.setGeneration(convertPageGeneration(src.getKind())); - for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + if (src.hasPage()) { + for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Library30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Library30_50.java index 6b00e6aea..24bd8c272 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Library30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Library30_50.java @@ -14,7 +14,9 @@ public class Library30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -31,11 +33,17 @@ public class Library30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasUsage()) @@ -48,7 +56,9 @@ public class Library30_50 { tgt.setLastReviewDate(src.getLastReviewDate()); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_50.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + } for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) { org.hl7.fhir.dstu3.model.Contributor c = new org.hl7.fhir.dstu3.model.Contributor(); c.setType(ContributorType.AUTHOR); @@ -73,10 +83,18 @@ public class Library30_50 { c.addContact(VersionConvertor_30_50.convertContactDetail(t)); tgt.addContributor(c); } - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_50.convertParameterDefinition(t)); - for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_50.convertDataRequirement(t)); - for (org.hl7.fhir.r5.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_50.convertAttachment(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_50.convertParameterDefinition(t)); + } + if (src.hasDataRequirement()) { + for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_50.convertDataRequirement(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_50.convertAttachment(t)); + } return tgt; } @@ -87,7 +105,9 @@ public class Library30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -104,11 +124,17 @@ public class Library30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasUsage()) @@ -131,10 +157,18 @@ public class Library30_50 { if (t.getType() == ContributorType.ENDORSER) for (ContactDetail c : t.getContact()) tgt.addEndorser(VersionConvertor_30_50.convertContactDetail(c)); } - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_50.convertParameterDefinition(t)); - for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_50.convertDataRequirement(t)); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_50.convertAttachment(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(VersionConvertor_30_50.convertParameterDefinition(t)); + } + if (src.hasDataRequirement()) { + for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(VersionConvertor_30_50.convertDataRequirement(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getContent()) tgt.addContent(VersionConvertor_30_50.convertAttachment(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Linkage30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Linkage30_50.java index 0467ca5aa..dfc6fb9f6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Linkage30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Linkage30_50.java @@ -14,7 +14,9 @@ public class Linkage30_50 { tgt.setActive(src.getActive()); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); - for (org.hl7.fhir.dstu3.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + } return tgt; } @@ -27,7 +29,9 @@ public class Linkage30_50 { tgt.setActive(src.getActive()); if (src.hasAuthor()) tgt.setAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); - for (org.hl7.fhir.r5.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/List30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/List30_50.java index e4290cba0..f3eb43754 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/List30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/List30_50.java @@ -10,7 +10,9 @@ public class List30_50 { return null; org.hl7.fhir.r5.model.ListResource tgt = new org.hl7.fhir.r5.model.ListResource(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertListStatus(src.getStatus())); if (src.hasMode()) @@ -29,8 +31,12 @@ public class List30_50 { tgt.setSource(VersionConvertor_30_50.convertReference(src.getSource())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_50.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_50.convertCodeableConcept(src.getEmptyReason())); return tgt; @@ -41,7 +47,9 @@ public class List30_50 { return null; org.hl7.fhir.dstu3.model.ListResource tgt = new org.hl7.fhir.dstu3.model.ListResource(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertListStatus(src.getStatus())); if (src.hasMode()) @@ -60,8 +68,12 @@ public class List30_50 { tgt.setSource(VersionConvertor_30_50.convertReference(src.getSource())); if (src.hasOrderedBy()) tgt.setOrderedBy(VersionConvertor_30_50.convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + } if (src.hasEmptyReason()) tgt.setEmptyReason(VersionConvertor_30_50.convertCodeableConcept(src.getEmptyReason())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Location30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Location30_50.java index 1c7cc6917..f92e526e9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Location30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Location30_50.java @@ -10,21 +10,27 @@ public class Location30_50 { return null; org.hl7.fhir.r5.model.Location tgt = new org.hl7.fhir.r5.model.Location(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertLocationStatus(src.getStatus())); if (src.hasOperationalStatus()) tgt.setOperationalStatus(VersionConvertor_30_50.convertCoding(src.getOperationalStatus())); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + if (src.hasAlias()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasMode()) tgt.setMode(convertLocationMode(src.getMode())); if (src.hasType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_50.convertAddress(src.getAddress())); if (src.hasPhysicalType()) @@ -35,7 +41,9 @@ public class Location30_50 { tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_50.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -44,21 +52,27 @@ public class Location30_50 { return null; org.hl7.fhir.dstu3.model.Location tgt = new org.hl7.fhir.dstu3.model.Location(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertLocationStatus(src.getStatus())); if (src.hasOperationalStatus()) tgt.setOperationalStatus(VersionConvertor_30_50.convertCoding(src.getOperationalStatus())); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + if (src.hasAlias()) { + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasMode()) tgt.setMode(convertLocationMode(src.getMode())); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getTypeFirstRep())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_50.convertAddress(src.getAddress())); if (src.hasPhysicalType()) @@ -69,7 +83,9 @@ public class Location30_50 { tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_50.convertReference(src.getPartOf())); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Measure30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Measure30_50.java index 6f1c07803..b698d9620 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Measure30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Measure30_50.java @@ -15,7 +15,9 @@ public class Measure30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -27,16 +29,24 @@ public class Measure30_50 { if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasType()) - for (org.hl7.fhir.dstu3.model.CodeableConcept concept : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(concept)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept concept : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(concept)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasUsage()) @@ -71,8 +81,12 @@ public class Measure30_50 { else tgt.addAuthor(new org.hl7.fhir.r5.model.ContactDetail().setName(t.getName())); } - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.Reference r : src.getLibrary()) tgt.addLibrary(r.getReference()); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.dstu3.model.Reference r : src.getLibrary()) tgt.addLibrary(r.getReference()); + } if (src.hasDisclaimer()) tgt.setDisclaimer(src.getDisclaimer()); if (src.hasScoring()) @@ -95,10 +109,14 @@ public class Measure30_50 { else tgt.setImprovementNotation(new org.hl7.fhir.r5.model.CodeableConcept().setText(src.getImprovementNotation())); } - for (org.hl7.fhir.dstu3.model.MarkdownType m : src.getDefinition()) tgt.addDefinition(m.getValue()); + if (src.hasDefinition()) { + for (org.hl7.fhir.dstu3.model.MarkdownType m : src.getDefinition()) tgt.addDefinition(m.getValue()); + } if (src.hasGuidance()) tgt.setGuidance(src.getGuidance()); - for (org.hl7.fhir.dstu3.model.Measure.MeasureGroupComponent g : src.getGroup()) tgt.addGroup(convertMeasureGroup(g)); + if (src.hasGroup()) { + for (org.hl7.fhir.dstu3.model.Measure.MeasureGroupComponent g : src.getGroup()) tgt.addGroup(convertMeasureGroup(g)); + } return tgt; } @@ -109,7 +127,9 @@ public class Measure30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -121,16 +141,24 @@ public class Measure30_50 { if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasType()) - for (org.hl7.fhir.r5.model.CodeableConcept concept : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(concept)); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept concept : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(concept)); + } if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasUsage()) @@ -175,8 +203,12 @@ public class Measure30_50 { con.setName(cd.getName()); tgt.addContributor(con); } - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.CanonicalType r : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_50.convertCanonicalToReference(r)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r5.model.CanonicalType r : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_50.convertCanonicalToReference(r)); + } if (src.hasDisclaimer()) tgt.setDisclaimer(src.getDisclaimer()); if (src.hasScoring()) @@ -198,10 +230,14 @@ public class Measure30_50 { else if (cc.hasCode() && cc.getCode().equals("decrease")) tgt.setImprovementNotation(cc.getCode()); } - for (org.hl7.fhir.r5.model.MarkdownType m : src.getDefinition()) tgt.addDefinition(m.getValue()); + if (src.hasDefinition()) { + for (org.hl7.fhir.r5.model.MarkdownType m : src.getDefinition()) tgt.addDefinition(m.getValue()); + } if (src.hasGuidance()) tgt.setGuidance(src.getGuidance()); - for (org.hl7.fhir.r5.model.Measure.MeasureGroupComponent g : src.getGroup()) tgt.addGroup(convertMeasureGroup(g)); + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.Measure.MeasureGroupComponent g : src.getGroup()) tgt.addGroup(convertMeasureGroup(g)); + } return tgt; } @@ -213,8 +249,12 @@ public class Measure30_50 { tgt.setIdentifier(new org.hl7.fhir.dstu3.model.Identifier().setValue(src.getCode().getCodingFirstRep().getCode())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent p : src.getPopulation()) tgt.addPopulation(convertMeasureGroupPopulation(p)); - for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent s : src.getStratifier()) tgt.addStratifier(convertMeasureGroupStratifier(s)); + if (src.hasPopulation()) { + for (org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent p : src.getPopulation()) tgt.addPopulation(convertMeasureGroupPopulation(p)); + } + if (src.hasStratifier()) { + for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent s : src.getStratifier()) tgt.addStratifier(convertMeasureGroupStratifier(s)); + } return tgt; } @@ -226,8 +266,12 @@ public class Measure30_50 { tgt.setCode(new org.hl7.fhir.r5.model.CodeableConcept().addCoding(new org.hl7.fhir.r5.model.Coding().setCode(src.getIdentifier().getValue()))); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Measure.MeasureGroupPopulationComponent p : src.getPopulation()) tgt.addPopulation(convertMeasureGroupPopulation(p)); - for (org.hl7.fhir.dstu3.model.Measure.MeasureGroupStratifierComponent s : src.getStratifier()) tgt.addStratifier(convertMeasureGroupStratifier(s)); + if (src.hasPopulation()) { + for (org.hl7.fhir.dstu3.model.Measure.MeasureGroupPopulationComponent p : src.getPopulation()) tgt.addPopulation(convertMeasureGroupPopulation(p)); + } + if (src.hasStratifier()) { + for (org.hl7.fhir.dstu3.model.Measure.MeasureGroupStratifierComponent s : src.getStratifier()) tgt.addStratifier(convertMeasureGroupStratifier(s)); + } return tgt; } @@ -242,7 +286,9 @@ public class Measure30_50 { if (src.hasCriteria() && src.getCriteria().hasExpression()) tgt.setCriteria(src.getCriteria().getExpression()); if (src.hasCriteria() && src.getCriteria().hasName()) { - tgt.setName(src.getCriteria().getName()); + if (src.hasCriteria()) { + tgt.setName(src.getCriteria().getName()); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Medication30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Medication30_50.java index 26ee8b301..a5092c6ba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Medication30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Medication30_50.java @@ -18,7 +18,9 @@ public class Medication30_50 { tgt.setManufacturer(VersionConvertor_30_50.convertReference(src.getManufacturer())); if (src.hasForm()) tgt.setDoseForm(VersionConvertor_30_50.convertCodeableConcept(src.getForm())); - for (org.hl7.fhir.dstu3.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu3.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + } if (src.hasPackage()) tgt.setBatch(convertMedicationPackageBatchComponent(src.getPackage().getBatchFirstRep())); return tgt; @@ -37,7 +39,9 @@ public class Medication30_50 { tgt.setManufacturer(VersionConvertor_30_50.convertReference(src.getManufacturer())); if (src.hasDoseForm()) tgt.setForm(VersionConvertor_30_50.convertCodeableConcept(src.getDoseForm())); - for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + if (src.hasIngredient()) { + for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + } if (src.hasBatch()) tgt.getPackage().addBatch(convertMedicationPackageBatchComponent(src.getBatch())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationAdministration30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationAdministration30_50.java index 4c7d3215b..ea24eef0a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationAdministration30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationAdministration30_50.java @@ -11,9 +11,15 @@ public class MedicationAdministration30_50 { return null; org.hl7.fhir.dstu3.model.MedicationAdministration tgt = new org.hl7.fhir.dstu3.model.MedicationAdministration(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.addDefinition().setReference(t.getValue()); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.addDefinition().setReference(t.getValue()); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); if (src.hasCategory()) @@ -24,21 +30,31 @@ public class MedicationAdministration30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasEncounter()) tgt.setContext(VersionConvertor_30_50.convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasOccurence()) tgt.setEffective(VersionConvertor_30_50.convertType(src.getOccurence())); - for (org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReasonCode(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); for (CodeableReference t : src.getReason()) if (t.hasReference()) tgt.addReasonReference(VersionConvertor_30_50.convertReference(t.getReference())); if (src.hasRequest()) tgt.setPrescription(VersionConvertor_30_50.convertReference(src.getRequest())); - for (org.hl7.fhir.r5.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasDevice()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } if (src.hasDosage()) tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); - for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + if (src.hasEventHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -47,9 +63,15 @@ public class MedicationAdministration30_50 { return null; org.hl7.fhir.r5.model.MedicationAdministration tgt = new org.hl7.fhir.r5.model.MedicationAdministration(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesUri(t.getReference()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasDefinition()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDefinition()) tgt.addInstantiatesUri(t.getReference()); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); if (src.hasCategory()) @@ -60,19 +82,33 @@ public class MedicationAdministration30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasContext()) tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getContext())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasEffective()) tgt.setOccurence(VersionConvertor_30_50.convertType(src.getEffective())); - for (org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + } if (src.hasPrescription()) tgt.setRequest(VersionConvertor_30_50.convertReference(src.getPrescription())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasDevice()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDevice()) tgt.addDevice(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } if (src.hasDosage()) tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + if (src.hasEventHistory()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -141,7 +177,9 @@ public class MedicationAdministration30_50 { return null; org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration(); VersionConvertor_30_50.copyElement(src, tgt); - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.fromCode(src.getValueAsString())); + if (src.hasValue()) { + tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.fromCode(src.getValueAsString())); + } return tgt; } @@ -150,7 +188,9 @@ public class MedicationAdministration30_50 { return null; org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration(); VersionConvertor_30_50.copyElement(src, tgt); - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.fromCode(src.getValueAsString())); + if (src.hasValue()) { + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.fromCode(src.getValueAsString())); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationDispense30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationDispense30_50.java index fb5a557ab..cf8b65118 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationDispense30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationDispense30_50.java @@ -10,8 +10,12 @@ public class MedicationDispense30_50 { return null; org.hl7.fhir.dstu3.model.MedicationDispense tgt = new org.hl7.fhir.dstu3.model.MedicationDispense(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatusElement(convertMedicationDispenseStatus(src.getStatusElement())); if (src.hasCategory()) @@ -22,9 +26,15 @@ public class MedicationDispense30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasEncounter()) tgt.setContext(VersionConvertor_30_50.convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_50.convertReference(t)); + } if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); if (src.hasQuantity()) @@ -37,13 +47,23 @@ public class MedicationDispense30_50 { tgt.setWhenHandedOver(src.getWhenHandedOver()); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_50.convertReference(src.getDestination())); - for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + } if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); - for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -52,8 +72,12 @@ public class MedicationDispense30_50 { return null; org.hl7.fhir.r5.model.MedicationDispense tgt = new org.hl7.fhir.r5.model.MedicationDispense(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatusElement(convertMedicationDispenseStatus(src.getStatusElement())); if (src.hasCategory()) @@ -64,9 +88,15 @@ public class MedicationDispense30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasContext()) tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getContext())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + } + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(VersionConvertor_30_50.convertReference(t)); + } if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); if (src.hasQuantity()) @@ -79,13 +109,23 @@ public class MedicationDispense30_50 { tgt.setWhenHandedOver(src.getWhenHandedOver()); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_50.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + } if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -183,8 +223,12 @@ public class MedicationDispense30_50 { tgt.setWasSubstituted(src.getWasSubstituted()); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.setResponsibleParty(VersionConvertor_30_50.convertReference(t)); + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.setResponsibleParty(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -197,7 +241,9 @@ public class MedicationDispense30_50 { tgt.setWasSubstituted(src.getWasSubstituted()); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasResponsibleParty()) tgt.addResponsibleParty(VersionConvertor_30_50.convertReference(src.getResponsibleParty())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationRequest30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationRequest30_50.java index e86519273..1152166e8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationRequest30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationRequest30_50.java @@ -11,8 +11,12 @@ public class MedicationRequest30_50 { return null; org.hl7.fhir.dstu3.model.MedicationRequest tgt = new org.hl7.fhir.dstu3.model.MedicationRequest(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } if (src.hasGroupIdentifier()) tgt.setGroupIdentifier(VersionConvertor_30_50.convertIdentifier(src.getGroupIdentifier())); if (src.hasStatus()) @@ -27,7 +31,9 @@ public class MedicationRequest30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasEncounter()) tgt.setContext(VersionConvertor_30_50.convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasAuthoredOn()) tgt.setAuthoredOn(src.getAuthoredOn()); if (src.hasRecorder()) @@ -40,16 +46,24 @@ public class MedicationRequest30_50 { tgt.addReasonReference(VersionConvertor_30_50.convertReference(t.getReference())); } } - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + } if (src.hasDispenseRequest()) tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); if (src.hasPriorPrescription()) tgt.setPriorPrescription(VersionConvertor_30_50.convertReference(src.getPriorPrescription())); - for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -58,8 +72,12 @@ public class MedicationRequest30_50 { return null; org.hl7.fhir.r5.model.MedicationRequest tgt = new org.hl7.fhir.r5.model.MedicationRequest(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } if (src.hasGroupIdentifier()) tgt.setGroupIdentifier(VersionConvertor_30_50.convertIdentifier(src.getGroupIdentifier())); if (src.hasStatus()) @@ -74,23 +92,37 @@ public class MedicationRequest30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasContext()) tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getContext())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(VersionConvertor_30_50.convertReference(t)); + } if (src.hasAuthoredOn()) tgt.setAuthoredOn(src.getAuthoredOn()); if (src.hasRecorder()) tgt.setRecorder(VersionConvertor_30_50.convertReference(src.getRecorder())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(new CodeableReference().setConcept(VersionConvertor_30_50.convertCodeableConcept(t))); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(new CodeableReference().setReference(VersionConvertor_30_50.convertReference(t))); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(new CodeableReference().setConcept(VersionConvertor_30_50.convertCodeableConcept(t))); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(new CodeableReference().setReference(VersionConvertor_30_50.convertReference(t))); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(VersionConvertor_30_50.convertDosage(t)); + } if (src.hasDispenseRequest()) tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); if (src.hasSubstitution()) tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); if (src.hasPriorPrescription()) tgt.setPriorPrescription(VersionConvertor_30_50.convertReference(src.getPriorPrescription())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEventHistory()) tgt.addEventHistory(VersionConvertor_30_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationStatement30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationStatement30_50.java index cd9593ef6..941f15e0e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationStatement30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MedicationStatement30_50.java @@ -11,9 +11,15 @@ public class MedicationStatement30_50 { return null; org.hl7.fhir.r5.model.MedicationUsage tgt = new org.hl7.fhir.r5.model.MedicationUsage(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasContext()) tgt.setEncounter(VersionConvertor_30_50.convertReference(src.getContext())); if (src.hasStatus()) @@ -30,11 +36,21 @@ public class MedicationStatement30_50 { tgt.setInformationSource(VersionConvertor_30_50.convertReference(src.getInformationSource())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_30_50.convertCodeableConceptToCodableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasDosage()) { + for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); + } return tgt; } @@ -43,9 +59,15 @@ public class MedicationStatement30_50 { return null; org.hl7.fhir.dstu3.model.MedicationStatement tgt = new org.hl7.fhir.dstu3.model.MedicationStatement(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasEncounter()) tgt.setContext(VersionConvertor_30_50.convertReference(src.getEncounter())); if (src.hasStatus()) @@ -62,13 +84,19 @@ public class MedicationStatement30_50 { tgt.setInformationSource(VersionConvertor_30_50.convertReference(src.getInformationSource())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_50.convertReference(t)); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(VersionConvertor_30_50.convertReference(t)); + } for (CodeableReference t : src.getReason()) if (t.hasConcept()) tgt.addReasonCode(VersionConvertor_30_50.convertCodeableConcept(t.getConcept())); for (CodeableReference t : src.getReason()) if (t.hasReference()) tgt.addReasonReference(VersionConvertor_30_50.convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } + if (src.hasDosage()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(VersionConvertor_30_50.convertDosage(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageDefinition30_50.java index 07ee48fa5..befeca5c7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageDefinition30_50.java @@ -28,27 +28,41 @@ public class MessageDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasBase()) tgt.setBase(VersionConvertor_30_50.convertCanonicalToReference(src.getBaseElement())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getParent()) tgt.addParent(VersionConvertor_30_50.convertCanonicalToReference(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) tgt.addReplaces(VersionConvertor_30_50.convertCanonicalToReference(t)); + if (src.hasParent()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getParent()) tgt.addParent(VersionConvertor_30_50.convertCanonicalToReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) tgt.addReplaces(VersionConvertor_30_50.convertCanonicalToReference(t)); + } if (src.hasEventCoding()) tgt.setEvent(VersionConvertor_30_50.convertCoding(src.getEventCoding())); if (src.hasCategory()) tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + } if (src.hasResponseRequired()) tgt.setResponseRequired(src.getResponseRequired() != org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + if (src.hasAllowedResponse()) { + for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + } return tgt; } @@ -75,27 +89,41 @@ public class MessageDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); if (src.hasBase()) tgt.setBaseElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getBase())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.getParent().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReplaces()) tgt.getReplaces().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); + if (src.hasParent()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.getParent().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReplaces()) tgt.getReplaces().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); + } if (src.hasEvent()) tgt.setEvent(VersionConvertor_30_50.convertCoding(src.getEvent())); if (src.hasCategory()) tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + } if (src.hasResponseRequired()) tgt.setResponseRequired(src.getResponseRequired() ? org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS : org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + if (src.hasAllowedResponse()) { + for (org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageHeader30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageHeader30_50.java index 612e0ecde..c3dcddcef 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageHeader30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/MessageHeader30_50.java @@ -40,7 +40,9 @@ public class MessageHeader30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasEvent()) tgt.setEvent(VersionConvertor_30_50.convertCoding(src.getEvent())); - for (org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + if (src.hasDestination()) { + for (org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } if (src.hasSender()) tgt.setSender(VersionConvertor_30_50.convertReference(src.getSender())); if (src.hasEnterer()) @@ -55,7 +57,9 @@ public class MessageHeader30_50 { tgt.setReason(VersionConvertor_30_50.convertCodeableConcept(src.getReason())); if (src.hasResponse()) tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_50.convertReference(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -66,7 +70,9 @@ public class MessageHeader30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasEventCoding()) tgt.setEvent(VersionConvertor_30_50.convertCoding(src.getEventCoding())); - for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + if (src.hasDestination()) { + for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } if (src.hasSender()) tgt.setSender(VersionConvertor_30_50.convertReference(src.getSender())); if (src.hasEnterer()) @@ -81,7 +87,9 @@ public class MessageHeader30_50 { tgt.setReason(VersionConvertor_30_50.convertCodeableConcept(src.getReason())); if (src.hasResponse()) tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_50.convertReference(t)); + if (src.hasFocus()) { + for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addFocus(VersionConvertor_30_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/NamingSystem30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/NamingSystem30_50.java index bd2c51b62..0607be788 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/NamingSystem30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/NamingSystem30_50.java @@ -20,18 +20,26 @@ public class NamingSystem30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } @@ -50,18 +58,26 @@ public class NamingSystem30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasResponsible()) tgt.setResponsible(src.getResponsible()); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasUsage()) tgt.setUsage(src.getUsage()); - for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + if (src.hasUniqueId()) { + for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Observation30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Observation30_50.java index 8999bb2a0..e8505e201 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Observation30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Observation30_50.java @@ -10,11 +10,17 @@ public class Observation30_50 { return null; org.hl7.fhir.dstu3.model.Observation tgt = new org.hl7.fhir.dstu3.model.Observation(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasSubject()) @@ -25,7 +31,9 @@ public class Observation30_50 { tgt.setEffective(VersionConvertor_30_50.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_50.convertReference(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_50.convertReference(t)); + } if (src.hasValue()) tgt.setValue(VersionConvertor_30_50.convertType(src.getValue())); if (src.hasDataAbsentReason()) @@ -42,10 +50,18 @@ public class Observation30_50 { tgt.setSpecimen(VersionConvertor_30_50.convertReference(src.getSpecimen())); if (src.hasDevice()) tgt.setDevice(VersionConvertor_30_50.convertReference(src.getDevice())); - for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.HASMEMBER)); - for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.DERIVEDFROM)); - for (org.hl7.fhir.r5.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasHasMember()) { + for (org.hl7.fhir.r5.model.Reference t : src.getHasMember()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.HASMEMBER)); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addRelated(convertObservationRelatedComponent(t, org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.DERIVEDFROM)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r5.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -54,11 +70,17 @@ public class Observation30_50 { return null; org.hl7.fhir.r5.model.Observation tgt = new org.hl7.fhir.r5.model.Observation(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasSubject()) @@ -69,7 +91,9 @@ public class Observation30_50 { tgt.setEffective(VersionConvertor_30_50.convertType(src.getEffective())); if (src.hasIssued()) tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_50.convertReference(t)); + if (src.hasPerformer()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_30_50.convertReference(t)); + } if (src.hasValue()) tgt.setValue(VersionConvertor_30_50.convertType(src.getValue())); if (src.hasDataAbsentReason()) @@ -86,12 +110,16 @@ public class Observation30_50 { tgt.setSpecimen(VersionConvertor_30_50.convertReference(src.getSpecimen())); if (src.hasDevice()) tgt.setDevice(VersionConvertor_30_50.convertReference(src.getDevice())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } for (org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent t : src.getRelated()) if (t.getType() == org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.HASMEMBER) tgt.addHasMember(VersionConvertor_30_50.convertReference(t.getTarget())); else if (t.getType() == org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.DERIVEDFROM) tgt.addDerivedFrom(VersionConvertor_30_50.convertReference(t.getTarget())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + if (src.hasComponent()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } return tgt; } @@ -108,7 +136,9 @@ public class Observation30_50 { tgt.setDataAbsentReason(VersionConvertor_30_50.convertCodeableConcept(src.getDataAbsentReason())); if (src.hasInterpretation()) tgt.addInterpretation(VersionConvertor_30_50.convertCodeableConcept(src.getInterpretation())); - for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -125,7 +155,9 @@ public class Observation30_50 { tgt.setDataAbsentReason(VersionConvertor_30_50.convertCodeableConcept(src.getDataAbsentReason())); if (src.hasInterpretation()) tgt.setInterpretation(VersionConvertor_30_50.convertCodeableConcept(src.getInterpretationFirstRep())); - for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } return tgt; } @@ -140,7 +172,9 @@ public class Observation30_50 { tgt.setHigh(VersionConvertor_30_50.convertSimpleQuantity(src.getHigh())); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAge()) tgt.setAge(VersionConvertor_30_50.convertRange(src.getAge())); if (src.hasText()) @@ -159,7 +193,9 @@ public class Observation30_50 { tgt.setHigh(VersionConvertor_30_50.convertSimpleQuantity(src.getHigh())); if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAge()) tgt.setAge(VersionConvertor_30_50.convertRange(src.getAge())); if (src.hasText()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationDefinition30_50.java index e20134154..a37f5828c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationDefinition30_50.java @@ -29,11 +29,17 @@ public class OperationDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasIdempotent()) @@ -44,15 +50,21 @@ public class OperationDefinition30_50 { tgt.setComment(src.getComment()); if (src.hasBase()) tgt.setBaseElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getBase())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + } if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasType()) tgt.setType(src.getType()); if (src.hasInstance()) tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } + if (src.hasOverload()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + } return tgt; } @@ -77,11 +89,17 @@ public class OperationDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasAffectsState()) @@ -92,15 +110,21 @@ public class OperationDefinition30_50 { tgt.setComment(src.getComment()); if (src.hasBase()) tgt.setBase(VersionConvertor_30_50.convertCanonicalToReference(src.getBaseElement())); - for (org.hl7.fhir.r5.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getResource()) tgt.addResource(t.getValue()); + } if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasType()) tgt.setType(src.getType()); if (src.hasInstance()) tgt.setInstance(src.getInstance()); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } + if (src.hasOverload()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + } return tgt; } @@ -109,7 +133,9 @@ public class OperationDefinition30_50 { return null; org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionOverloadComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + if (src.hasParameterName()) { + for (org.hl7.fhir.r5.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + } if (src.hasComment()) tgt.setComment(src.getComment()); return tgt; @@ -120,7 +146,9 @@ public class OperationDefinition30_50 { return null; org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + if (src.hasParameterName()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getParameterName()) tgt.addParameterName(t.getValue()); + } if (src.hasComment()) tgt.setComment(src.getComment()); return tgt; @@ -184,7 +212,9 @@ public class OperationDefinition30_50 { tgt.addTargetProfile(src.getProfile().getReference()); if (src.hasBinding()) tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } @@ -207,10 +237,14 @@ public class OperationDefinition30_50 { tgt.setType(src.getType().toCode()); if (src.hasSearchType()) tgt.setSearchType(VersionConvertor_30_50.convertSearchParamType(src.getSearchType())); - for (org.hl7.fhir.r5.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r5.model.UriType t : src.getTargetProfile()) tgt.setProfile(new org.hl7.fhir.dstu3.model.Reference(t.getValue())); + } if (src.hasBinding()) tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationOutcome30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationOutcome30_50.java index f1752dda4..63c65bd39 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationOutcome30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/OperationOutcome30_50.java @@ -178,7 +178,9 @@ public class OperationOutcome30_50 { return null; org.hl7.fhir.r5.model.OperationOutcome tgt = new org.hl7.fhir.r5.model.OperationOutcome(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -187,7 +189,9 @@ public class OperationOutcome30_50 { return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + if (src.hasIssue()) { + for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } return tgt; } @@ -204,8 +208,12 @@ public class OperationOutcome30_50 { tgt.setDetails(VersionConvertor_30_50.convertCodeableConcept(src.getDetails())); if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + } return tgt; } @@ -222,8 +230,12 @@ public class OperationOutcome30_50 { tgt.setDetails(VersionConvertor_30_50.convertCodeableConcept(src.getDetails())); if (src.hasDiagnostics()) tgt.setDiagnostics(src.getDiagnostics()); - for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); - for (org.hl7.fhir.r5.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); + } + if (src.hasExpression()) { + for (org.hl7.fhir.r5.model.StringType t : src.getExpression()) tgt.addExpression(t.getValue()); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Organization30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Organization30_50.java index 25a9121f4..ede2cca75 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Organization30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Organization30_50.java @@ -10,19 +10,33 @@ public class Organization30_50 { return null; org.hl7.fhir.r5.model.Organization tgt = new org.hl7.fhir.r5.model.Organization(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasAlias()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_50.convertReference(src.getPartOf())); - for (org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -31,19 +45,33 @@ public class Organization30_50 { return null; org.hl7.fhir.dstu3.model.Organization tgt = new org.hl7.fhir.dstu3.model.Organization(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasAlias()) { + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue()); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasPartOf()) tgt.setPartOf(VersionConvertor_30_50.convertReference(src.getPartOf())); - for (org.hl7.fhir.r5.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -56,7 +84,9 @@ public class Organization30_50 { tgt.setPurpose(VersionConvertor_30_50.convertCodeableConcept(src.getPurpose())); if (src.hasName()) tgt.setName(VersionConvertor_30_50.convertHumanName(src.getName())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_50.convertAddress(src.getAddress())); return tgt; @@ -71,7 +101,9 @@ public class Organization30_50 { tgt.setPurpose(VersionConvertor_30_50.convertCodeableConcept(src.getPurpose())); if (src.hasName()) tgt.setName(VersionConvertor_30_50.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_50.convertAddress(src.getAddress())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Parameters30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Parameters30_50.java index aa60ebe82..60a16958f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Parameters30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Parameters30_50.java @@ -10,7 +10,9 @@ public class Parameters30_50 { return null; org.hl7.fhir.r5.model.Parameters tgt = new org.hl7.fhir.r5.model.Parameters(); VersionConvertor_30_50.copyResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -19,7 +21,9 @@ public class Parameters30_50 { return null; org.hl7.fhir.dstu3.model.Parameters tgt = new org.hl7.fhir.dstu3.model.Parameters(); VersionConvertor_30_50.copyResource(src, tgt); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } return tgt; } @@ -34,7 +38,9 @@ public class Parameters30_50 { tgt.setValue(VersionConvertor_30_50.convertType(src.getValue())); if (src.hasResource()) tgt.setResource(VersionConvertor_30_50.convertResource(src.getResource(), false)); - for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } @@ -49,7 +55,9 @@ public class Parameters30_50 { tgt.setValue(VersionConvertor_30_50.convertType(src.getValue())); if (src.hasResource()) tgt.setResource(VersionConvertor_30_50.convertResource(src.getResource(), false)); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Patient30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Patient30_50.java index 6c6d688b1..6cfa0950d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Patient30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Patient30_50.java @@ -39,10 +39,14 @@ public class Patient30_50 { return null; org.hl7.fhir.r5.model.Patient.ContactComponent tgt = new org.hl7.fhir.r5.model.Patient.ContactComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasRelationship()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(VersionConvertor_30_50.convertHumanName(src.getName())); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_50.convertAddress(src.getAddress())); if (src.hasGender()) @@ -59,10 +63,14 @@ public class Patient30_50 { return null; org.hl7.fhir.dstu3.model.Patient.ContactComponent tgt = new org.hl7.fhir.dstu3.model.Patient.ContactComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasRelationship()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasName()) tgt.setName(VersionConvertor_30_50.convertHumanName(src.getName())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasAddress()) tgt.setAddress(VersionConvertor_30_50.convertAddress(src.getAddress())); if (src.hasGender()) @@ -113,31 +121,49 @@ public class Patient30_50 { return null; org.hl7.fhir.r5.model.Patient tgt = new org.hl7.fhir.r5.model.Patient(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDate(src.getBirthDate()); if (src.hasDeceased()) tgt.setDeceased(VersionConvertor_30_50.convertType(src.getDeceased())); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasMaritalStatus()) tgt.setMaritalStatus(VersionConvertor_30_50.convertCodeableConcept(src.getMaritalStatus())); if (src.hasMultipleBirth()) tgt.setMultipleBirth(VersionConvertor_30_50.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); - for (org.hl7.fhir.dstu3.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasAnimal()) tgt.addExtension(convertAnimalComponent(src.getAnimal())); - for (org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_50.convertReference(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_50.convertReference(t)); + } if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } @@ -146,31 +172,49 @@ public class Patient30_50 { return null; org.hl7.fhir.dstu3.model.Patient tgt = new org.hl7.fhir.dstu3.model.Patient(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDate(src.getBirthDate()); if (src.hasDeceased()) tgt.setDeceased(VersionConvertor_30_50.convertType(src.getDeceased())); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasMaritalStatus()) tgt.setMaritalStatus(VersionConvertor_30_50.convertCodeableConcept(src.getMaritalStatus())); if (src.hasMultipleBirth()) tgt.setMultipleBirth(VersionConvertor_30_50.convertType(src.getMultipleBirth())); - for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); - for (org.hl7.fhir.r5.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/patient-animal")) tgt.setAnimal(convertAnimalComponent(src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-animal"))); - for (org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_50.convertReference(t)); + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.r5.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(VersionConvertor_30_50.convertReference(t)); + } if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r5.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PaymentNotice30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PaymentNotice30_50.java index 0d116e0c8..4a3844ffb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PaymentNotice30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PaymentNotice30_50.java @@ -10,7 +10,9 @@ public class PaymentNotice30_50 { return null; org.hl7.fhir.dstu3.model.PaymentNotice tgt = new org.hl7.fhir.dstu3.model.PaymentNotice(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); if (src.hasRequest()) @@ -35,7 +37,9 @@ public class PaymentNotice30_50 { return null; org.hl7.fhir.r5.model.PaymentNotice tgt = new org.hl7.fhir.r5.model.PaymentNotice(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); if (src.hasRequest()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Person30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Person30_50.java index 95cfe80c0..286aa3dd8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Person30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Person30_50.java @@ -44,21 +44,31 @@ public class Person30_50 { return null; org.hl7.fhir.dstu3.model.Person tgt = new org.hl7.fhir.dstu3.model.Person(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_50.convertAttachment(src.getPhoto())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r5.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } @@ -67,21 +77,31 @@ public class Person30_50 { return null; org.hl7.fhir.r5.model.Person tgt = new org.hl7.fhir.r5.model.Person(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasPhoto()) tgt.setPhoto(VersionConvertor_30_50.convertAttachment(src.getPhoto())); if (src.hasManagingOrganization()) tgt.setManagingOrganization(VersionConvertor_30_50.convertReference(src.getManagingOrganization())); if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PlanDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PlanDefinition30_50.java index 1e4e3ee11..e4a492296 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PlanDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PlanDefinition30_50.java @@ -282,7 +282,9 @@ public class PlanDefinition30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -311,9 +313,15 @@ public class PlanDefinition30_50 { tgt.setLastReviewDate(src.getLastReviewDate()); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_50.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + } for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) { org.hl7.fhir.dstu3.model.Contributor c = new org.hl7.fhir.dstu3.model.Contributor(); c.setType(ContributorType.AUTHOR); @@ -338,13 +346,23 @@ public class PlanDefinition30_50 { c.addContact(VersionConvertor_30_50.convertContactDetail(t)); tgt.addContributor(c); } - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_50.convertCanonicalToReference(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.addLibrary(VersionConvertor_30_50.convertCanonicalToReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -355,7 +373,9 @@ public class PlanDefinition30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -384,9 +404,15 @@ public class PlanDefinition30_50 { tgt.setLastReviewDate(src.getLastReviewDate()); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_50.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasTopic()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTopic()) tgt.addTopic(VersionConvertor_30_50.convertCodeableConcept(t)); + } for (org.hl7.fhir.dstu3.model.Contributor t : src.getContributor()) { if (t.getType() == ContributorType.AUTHOR) for (ContactDetail c : t.getContact()) tgt.addAuthor(VersionConvertor_30_50.convertContactDetail(c)); @@ -397,13 +423,23 @@ public class PlanDefinition30_50 { if (t.getType() == ContributorType.ENDORSER) for (ContactDetail c : t.getContact()) tgt.addEndorser(VersionConvertor_30_50.convertContactDetail(c)); } - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLibrary()) tgt.getLibrary().add(VersionConvertor_30_50.convertReferenceToCanonical(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -420,18 +456,38 @@ public class PlanDefinition30_50 { tgt.setDescription(src.getDescription()); if (src.hasTextEquivalent()) tgt.setTextEquivalent(src.getTextEquivalent()); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); - for (org.hl7.fhir.dstu3.model.TriggerDefinition t : src.getTriggerDefinition()) tgt.addTrigger(VersionConvertor_30_50.convertTriggerDefinition(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); - for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_50.convertDataRequirement(t)); - for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_50.convertDataRequirement(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasReason()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasGoalId()) { + for (org.hl7.fhir.dstu3.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); + } + if (src.hasTriggerDefinition()) { + for (org.hl7.fhir.dstu3.model.TriggerDefinition t : src.getTriggerDefinition()) tgt.addTrigger(VersionConvertor_30_50.convertTriggerDefinition(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + } + if (src.hasInput()) { + for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_50.convertDataRequirement(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.dstu3.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_50.convertDataRequirement(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + } if (src.hasTiming()) tgt.setTiming(VersionConvertor_30_50.convertType(src.getTiming())); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + } if (src.hasType()) tgt.getType().addCoding(VersionConvertor_30_50.convertCoding(src.getType())); if (src.hasGroupingBehavior()) @@ -448,8 +504,12 @@ public class PlanDefinition30_50 { tgt.setDefinition(VersionConvertor_30_50.convertReferenceToCanonical(src.getDefinition())); if (src.hasTransform()) tgt.setTransformElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getTransform())); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -466,18 +526,38 @@ public class PlanDefinition30_50 { tgt.setDescription(src.getDescription()); if (src.hasTextEquivalent()) tgt.setTextEquivalent(src.getTextEquivalent()); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); - for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) tgt.addTriggerDefinition(VersionConvertor_30_50.convertTriggerDefinition(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); - for (org.hl7.fhir.r5.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_50.convertDataRequirement(t)); - for (org.hl7.fhir.r5.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_50.convertDataRequirement(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasGoalId()) { + for (org.hl7.fhir.r5.model.IdType t : src.getGoalId()) tgt.addGoalId(t.getValue()); + } + if (src.hasTrigger()) { + for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) tgt.addTriggerDefinition(VersionConvertor_30_50.convertTriggerDefinition(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + } + if (src.hasInput()) { + for (org.hl7.fhir.r5.model.DataRequirement t : src.getInput()) tgt.addInput(VersionConvertor_30_50.convertDataRequirement(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.r5.model.DataRequirement t : src.getOutput()) tgt.addOutput(VersionConvertor_30_50.convertDataRequirement(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + } if (src.hasTiming()) tgt.setTiming(VersionConvertor_30_50.convertType(src.getTiming())); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + } if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertCoding(src.getType().getCodingFirstRep())); if (src.hasGroupingBehavior()) @@ -494,8 +574,12 @@ public class PlanDefinition30_50 { tgt.setDefinition(VersionConvertor_30_50.convertCanonicalToReference(src.getDefinitionCanonicalType())); if (src.hasTransform()) tgt.setTransform(VersionConvertor_30_50.convertCanonicalToReference(src.getTransformElement())); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } return tgt; } @@ -628,9 +712,15 @@ public class PlanDefinition30_50 { tgt.setPriority(VersionConvertor_30_50.convertCodeableConcept(src.getPriority())); if (src.hasStart()) tgt.setStart(VersionConvertor_30_50.convertCodeableConcept(src.getStart())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.dstu3.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + } return tgt; } @@ -647,9 +737,15 @@ public class PlanDefinition30_50 { tgt.setPriority(VersionConvertor_30_50.convertCodeableConcept(src.getPriority())); if (src.hasStart()) tgt.setStart(VersionConvertor_30_50.convertCodeableConcept(src.getStart())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + if (src.hasAddresses()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(VersionConvertor_30_50.convertRelatedArtifact(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Practitioner30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Practitioner30_50.java index f3e963ecd..f020e55eb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Practitioner30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Practitioner30_50.java @@ -10,19 +10,33 @@ public class Practitioner30_50 { return null; org.hl7.fhir.r5.model.Practitioner tgt = new org.hl7.fhir.r5.model.Practitioner(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasName()) { + for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); - for (org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_50.convertCodeableConcept(t)); + } return tgt; } @@ -31,19 +45,33 @@ public class Practitioner30_50 { return null; org.hl7.fhir.dstu3.model.Practitioner tgt = new org.hl7.fhir.dstu3.model.Practitioner(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(VersionConvertor_30_50.convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_30_50.convertAddress(t)); + } if (src.hasGender()) tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); if (src.hasBirthDate()) tgt.setBirthDate(src.getBirthDate()); - for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); - for (org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasPhoto()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(VersionConvertor_30_50.convertCodeableConcept(t)); + } return tgt; } @@ -52,7 +80,9 @@ public class Practitioner30_50 { return null; org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasPeriod()) @@ -67,7 +97,9 @@ public class Practitioner30_50 { return null; org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasPeriod()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PractitionerRole30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PractitionerRole30_50.java index de9690872..8e52842c5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PractitionerRole30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/PractitionerRole30_50.java @@ -33,7 +33,9 @@ public class PractitionerRole30_50 { return null; org.hl7.fhir.dstu3.model.PractitionerRole tgt = new org.hl7.fhir.dstu3.model.PractitionerRole(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasPeriod()) @@ -42,16 +44,32 @@ public class PractitionerRole30_50 { tgt.setPractitioner(VersionConvertor_30_50.convertReference(src.getPractitioner())); if (src.hasOrganization()) tgt.setOrganization(VersionConvertor_30_50.convertReference(src.getOrganization())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); - for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -60,7 +78,9 @@ public class PractitionerRole30_50 { return null; org.hl7.fhir.r5.model.PractitionerRole tgt = new org.hl7.fhir.r5.model.PractitionerRole(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasPeriod()) @@ -69,16 +89,32 @@ public class PractitionerRole30_50 { tgt.setPractitioner(VersionConvertor_30_50.convertReference(src.getPractitioner())); if (src.hasOrganization()) tgt.setOrganization(VersionConvertor_30_50.convertReference(src.getOrganization())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); - for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); - for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getLocation()) tgt.addLocation(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + } if (src.hasAvailabilityExceptions()) tgt.setAvailabilityExceptions(src.getAvailabilityExceptions()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + if (src.hasEndpoint()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getEndpoint()) tgt.addEndpoint(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -87,7 +123,9 @@ public class PractitionerRole30_50 { return null; org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek2(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek2(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -102,7 +140,9 @@ public class PractitionerRole30_50 { return null; org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_50.convertDaysOfWeek(t.getValue()))); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) VersionConvertor_30_50.copyElement(t, tgt.addDaysOfWeekElement().setValue(VersionConvertor_30_50.convertDaysOfWeek(t.getValue()))); + } if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Questionnaire30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Questionnaire30_50.java index 0c02e44aa..cad6c5685 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Questionnaire30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Questionnaire30_50.java @@ -13,7 +13,9 @@ public class Questionnaire30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -38,14 +40,26 @@ public class Questionnaire30_50 { tgt.setLastReviewDate(src.getLastReviewDate()); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_50.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -56,7 +70,9 @@ public class Questionnaire30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -81,14 +97,26 @@ public class Questionnaire30_50 { tgt.setLastReviewDate(src.getLastReviewDate()); if (src.hasEffectivePeriod()) tgt.setEffectivePeriod(VersionConvertor_30_50.convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); - for (org.hl7.fhir.r5.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); + } + if (src.hasSubjectType()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -101,14 +129,18 @@ public class Questionnaire30_50 { tgt.setLinkId(src.getLinkId()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); if (src.hasType()) tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasEnableWhen()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) @@ -119,10 +151,14 @@ public class Questionnaire30_50 { tgt.setMaxLength(src.getMaxLength()); if (src.hasAnswerValueSet()) tgt.setOptions(VersionConvertor_30_50.convertCanonicalToReference(src.getAnswerValueSetElement())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + if (src.hasAnswerOption()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addOption(convertQuestionnaireItemOptionComponent(t)); + } if (src.hasInitial()) tgt.setInitial(VersionConvertor_30_50.convertType(src.getInitialFirstRep().getValue())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } return tgt; } @@ -135,14 +171,18 @@ public class Questionnaire30_50 { tgt.setLinkId(src.getLinkId()); if (src.hasDefinition()) tgt.setDefinition(src.getDefinition()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); + if (src.hasCode()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasPrefix()) tgt.setPrefix(src.getPrefix()); if (src.hasText()) tgt.setText(src.getText()); if (src.hasType()) tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasEnableWhen()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } tgt.setEnableBehavior(Questionnaire.EnableWhenBehavior.ANY); if (src.hasRequired()) tgt.setRequired(src.getRequired()); @@ -154,10 +194,14 @@ public class Questionnaire30_50 { tgt.setMaxLength(src.getMaxLength()); if (src.hasOptions()) tgt.setAnswerValueSetElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getOptions())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); + if (src.hasOption()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption()) tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t)); + } if (src.hasInitial()) tgt.addInitial().setValue(VersionConvertor_30_50.convertType(src.getInitial())); - for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension()) { tgt.addModifierExtension(VersionConvertor_30_50.convertExtension(t)); } @@ -187,10 +231,14 @@ public class Questionnaire30_50 { tgt.setQuestion(src.getQuestion()); if (src.hasHasAnswer()) { tgt.setOperator(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EXISTS); - tgt.setAnswer(VersionConvertor_30_50.convertType(src.getHasAnswerElement())); + if (src.hasHasAnswerElement()) { + tgt.setAnswer(VersionConvertor_30_50.convertType(src.getHasAnswerElement())); + } } else if (src.hasAnswer()) { tgt.setOperator(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EQUAL); - tgt.setAnswer(VersionConvertor_30_50.convertType(src.getAnswer())); + if (src.hasAnswer()) { + tgt.setAnswer(VersionConvertor_30_50.convertType(src.getAnswer())); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/QuestionnaireResponse30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/QuestionnaireResponse30_50.java index c3e4588db..c3d56a30d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/QuestionnaireResponse30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/QuestionnaireResponse30_50.java @@ -12,8 +12,12 @@ public class QuestionnaireResponse30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.setIdentifier(VersionConvertor_30_50.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasParent()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasQuestionnaire()) tgt.setQuestionnaireElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getQuestionnaire())); if (src.hasStatus()) @@ -28,7 +32,9 @@ public class QuestionnaireResponse30_50 { tgt.setAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); if (src.hasSource()) tgt.setSource(VersionConvertor_30_50.convertReference(src.getSource())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -39,8 +45,12 @@ public class QuestionnaireResponse30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.setIdentifier(VersionConvertor_30_50.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addParent(VersionConvertor_30_50.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addParent(VersionConvertor_30_50.convertReference(t)); + } if (src.hasQuestionnaire()) tgt.setQuestionnaire(VersionConvertor_30_50.convertCanonicalToReference(src.getQuestionnaireElement())); if (src.hasStatus()) @@ -55,7 +65,9 @@ public class QuestionnaireResponse30_50 { tgt.setAuthor(VersionConvertor_30_50.convertReference(src.getAuthor())); if (src.hasSource()) tgt.setSource(VersionConvertor_30_50.convertReference(src.getSource())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -66,7 +78,9 @@ public class QuestionnaireResponse30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasValue()) tgt.setValue(VersionConvertor_30_50.convertType(src.getValue())); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -77,7 +91,9 @@ public class QuestionnaireResponse30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasValue()) tgt.setValue(VersionConvertor_30_50.convertType(src.getValue())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -92,8 +108,12 @@ public class QuestionnaireResponse30_50 { tgt.setDefinition(src.getDefinition()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } @@ -108,8 +128,12 @@ public class QuestionnaireResponse30_50 { tgt.setDefinition(src.getDefinition()); if (src.hasText()) tgt.setText(src.getText()); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + if (src.hasAnswer()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RelatedPerson30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RelatedPerson30_50.java index ea7e51013..a086688d9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RelatedPerson30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RelatedPerson30_50.java @@ -2,7 +2,6 @@ package org.hl7.fhir.convertors.conv30_50; import org.hl7.fhir.convertors.VersionConvertor_30_50; import org.hl7.fhir.exceptions.FHIRException; - import java.util.List; public class RelatedPerson30_50 { @@ -60,13 +59,19 @@ public class RelatedPerson30_50 { tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); } if (src.hasActive()) { - tgt.setActive(src.getActive()); + if (src.hasActive()) { + tgt.setActive(src.getActive()); + } } if (src.hasPatient()) { - tgt.setPatient(VersionConvertor_30_50.convertReference(src.getPatient())); + if (src.hasPatient()) { + tgt.setPatient(VersionConvertor_30_50.convertReference(src.getPatient())); + } } if (src.hasRelationship()) { - tgt.addRelationship(VersionConvertor_30_50.convertCodeableConcept(src.getRelationship())); + if (src.hasRelationship()) { + tgt.addRelationship(VersionConvertor_30_50.convertCodeableConcept(src.getRelationship())); + } } for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) { tgt.addName(VersionConvertor_30_50.convertHumanName(t)); @@ -75,7 +80,9 @@ public class RelatedPerson30_50 { tgt.addTelecom(VersionConvertor_30_50.convertContactPoint(t)); } if (src.hasGender()) { - tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); + if (src.hasGender()) { + tgt.setGender(VersionConvertor_30_50.convertAdministrativeGender(src.getGender())); + } } if (src.hasBirthDate()) { tgt.setBirthDate(tgt.getBirthDate()); @@ -87,7 +94,9 @@ public class RelatedPerson30_50 { tgt.addPhoto(VersionConvertor_30_50.convertAttachment(t)); } if (src.hasPeriod()) { - tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); + if (src.hasPeriod()) { + tgt.setPeriod(VersionConvertor_30_50.convertPeriod(src.getPeriod())); + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RiskAssessment30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RiskAssessment30_50.java index 269a48749..0306cd14e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RiskAssessment30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/RiskAssessment30_50.java @@ -38,8 +38,12 @@ public class RiskAssessment30_50 { else if (src.getReason() instanceof org.hl7.fhir.dstu3.model.Reference) tgt.addReason(VersionConvertor_30_50.convertReferenceToCodableReference((org.hl7.fhir.dstu3.model.Reference) src.getReason())); } - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + if (src.hasBasis()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } if (src.hasMitigation()) tgt.setMitigation(src.getMitigation()); if (src.hasComment()) @@ -78,8 +82,12 @@ public class RiskAssessment30_50 { tgt.setReason(VersionConvertor_30_50.convertType(src.getReasonFirstRep().getConcept())); if (src.hasReason() && src.getReasonFirstRep().hasReference()) tgt.setReason(VersionConvertor_30_50.convertType(src.getReasonFirstRep().getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + if (src.hasBasis()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasis()) tgt.addBasis(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } if (src.hasMitigation()) tgt.setMitigation(src.getMitigation()); if (src.hasNote()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Schedule30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Schedule30_50.java index 652c4c8be..c3f52e6b4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Schedule30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Schedule30_50.java @@ -10,14 +10,22 @@ public class Schedule30_50 { return null; org.hl7.fhir.dstu3.model.Schedule tgt = new org.hl7.fhir.dstu3.model.Schedule(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasServiceCategory()) tgt.setServiceCategory(VersionConvertor_30_50.convertCodeableConcept(src.getServiceCategoryFirstRep())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_50.convertReference(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_50.convertReference(t)); + } if (src.hasPlanningHorizon()) tgt.setPlanningHorizon(VersionConvertor_30_50.convertPeriod(src.getPlanningHorizon())); if (src.hasComment()) @@ -30,14 +38,22 @@ public class Schedule30_50 { return null; org.hl7.fhir.r5.model.Schedule tgt = new org.hl7.fhir.r5.model.Schedule(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasActive()) tgt.setActive(src.getActive()); if (src.hasServiceCategory()) tgt.addServiceCategory(VersionConvertor_30_50.convertCodeableConcept(src.getServiceCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_50.convertReference(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getActor()) tgt.addActor(VersionConvertor_30_50.convertReference(t)); + } if (src.hasPlanningHorizon()) tgt.setPlanningHorizon(VersionConvertor_30_50.convertPeriod(src.getPlanningHorizon())); if (src.hasComment()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SearchParameter30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SearchParameter30_50.java index 628df2da4..dcdee763b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SearchParameter30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SearchParameter30_50.java @@ -136,14 +136,22 @@ public class SearchParameter30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + if (src.hasBase()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + } if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertSearchParamType(src.getType())); if (src.hasDerivedFrom()) @@ -156,11 +164,21 @@ public class SearchParameter30_50 { tgt.setXpath(src.getXpath()); if (src.hasXpathUsage()) tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getComparator()) VersionConvertor_30_50.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getModifier()) VersionConvertor_30_50.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); - for (org.hl7.fhir.dstu3.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); - for (org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } + if (src.hasComparator()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getComparator()) VersionConvertor_30_50.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); + } + if (src.hasModifier()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getModifier()) VersionConvertor_30_50.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); + } + if (src.hasChain()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); + } + if (src.hasComponent()) { + for (org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + } return tgt; } @@ -183,14 +201,22 @@ public class SearchParameter30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCode()) tgt.setCode(src.getCode()); - for (org.hl7.fhir.r5.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + if (src.hasBase()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getBase()) tgt.addBase(t.getValue()); + } if (src.hasType()) tgt.setType(VersionConvertor_30_50.convertSearchParamType(src.getType())); if (src.hasDerivedFrom()) @@ -203,11 +229,21 @@ public class SearchParameter30_50 { tgt.setXpath(src.getXpath()); if (src.hasXpathUsage()) tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.r5.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); - for (org.hl7.fhir.r5.model.Enumeration t : src.getComparator()) VersionConvertor_30_50.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); - for (org.hl7.fhir.r5.model.Enumeration t : src.getModifier()) VersionConvertor_30_50.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); - for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); - for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); + } + if (src.hasComparator()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getComparator()) VersionConvertor_30_50.copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); + } + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getModifier()) VersionConvertor_30_50.copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); + } + if (src.hasChain()) { + for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Sequence30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Sequence30_50.java index 6adc12db3..1bb80be78 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Sequence30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Sequence30_50.java @@ -78,7 +78,9 @@ public class Sequence30_50 { return null; org.hl7.fhir.r5.model.MolecularSequence tgt = new org.hl7.fhir.r5.model.MolecularSequence(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasType()) tgt.setType(convertSequenceType(src.getType())); if (src.hasCoordinateSystem()) @@ -95,14 +97,22 @@ public class Sequence30_50 { tgt.setQuantity(VersionConvertor_30_50.convertQuantity(src.getQuantity())); if (src.hasReferenceSeq()) tgt.setReferenceSeq(convertSequenceReferenceSeqComponent(src.getReferenceSeq())); - for (org.hl7.fhir.dstu3.model.Sequence.SequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + if (src.hasVariant()) { + for (org.hl7.fhir.dstu3.model.Sequence.SequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + } if (src.hasObservedSeq()) tgt.setObservedSeq(src.getObservedSeq()); - for (org.hl7.fhir.dstu3.model.Sequence.SequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + if (src.hasQuality()) { + for (org.hl7.fhir.dstu3.model.Sequence.SequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + } if (src.hasReadCoverage()) tgt.setReadCoverage(src.getReadCoverage()); - for (org.hl7.fhir.dstu3.model.Sequence.SequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_50.convertReference(t)); + if (src.hasRepository()) { + for (org.hl7.fhir.dstu3.model.Sequence.SequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); + } + if (src.hasPointer()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -111,7 +121,9 @@ public class Sequence30_50 { return null; org.hl7.fhir.dstu3.model.Sequence tgt = new org.hl7.fhir.dstu3.model.Sequence(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasType()) tgt.setType(convertSequenceType(src.getType())); if (src.hasCoordinateSystem()) @@ -128,14 +140,22 @@ public class Sequence30_50 { tgt.setQuantity(VersionConvertor_30_50.convertQuantity(src.getQuantity())); if (src.hasReferenceSeq()) tgt.setReferenceSeq(convertSequenceReferenceSeqComponent(src.getReferenceSeq())); - for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + if (src.hasVariant()) { + for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertSequenceVariantComponent(t)); + } if (src.hasObservedSeq()) tgt.setObservedSeq(src.getObservedSeq()); - for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + if (src.hasQuality()) { + for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertSequenceQualityComponent(t)); + } if (src.hasReadCoverage()) tgt.setReadCoverage(src.getReadCoverage()); - for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_50.convertReference(t)); + if (src.hasRepository()) { + for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertSequenceRepositoryComponent(t)); + } + if (src.hasPointer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPointer()) tgt.addPointer(VersionConvertor_30_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Slot30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Slot30_50.java index 5c2846688..c28f09651 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Slot30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Slot30_50.java @@ -10,11 +10,17 @@ public class Slot30_50 { return null; org.hl7.fhir.r5.model.Slot tgt = new org.hl7.fhir.r5.model.Slot(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasServiceCategory()) tgt.addServiceCategory(VersionConvertor_30_50.convertCodeableConcept(src.getServiceCategory())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_50.convertCodeableConcept(src.getAppointmentType())); if (src.hasSchedule()) @@ -37,11 +43,17 @@ public class Slot30_50 { return null; org.hl7.fhir.dstu3.model.Slot tgt = new org.hl7.fhir.dstu3.model.Slot(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasServiceCategory()) tgt.setServiceCategory(VersionConvertor_30_50.convertCodeableConcept(src.getServiceCategoryFirstRep())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(VersionConvertor_30_50.convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasAppointmentType()) tgt.setAppointmentType(VersionConvertor_30_50.convertCodeableConcept(src.getAppointmentType())); if (src.hasSchedule()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Specimen30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Specimen30_50.java index fb4563e19..87a537aef 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Specimen30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Specimen30_50.java @@ -10,7 +10,9 @@ public class Specimen30_50 { return null; org.hl7.fhir.dstu3.model.Specimen tgt = new org.hl7.fhir.dstu3.model.Specimen(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasAccessionIdentifier()) tgt.setAccessionIdentifier(VersionConvertor_30_50.convertIdentifier(src.getAccessionIdentifier())); if (src.hasStatus()) @@ -21,13 +23,23 @@ public class Specimen30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasReceivedTime()) tgt.setReceivedTime(src.getReceivedTime()); - for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_50.convertReference(t)); + if (src.hasParent()) { + for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_50.convertReference(t)); + } if (src.hasCollection()) tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); - for (org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); - for (org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasProcessing()) { + for (org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); + } + if (src.hasContainer()) { + for (org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -36,7 +48,9 @@ public class Specimen30_50 { return null; org.hl7.fhir.r5.model.Specimen tgt = new org.hl7.fhir.r5.model.Specimen(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasAccessionIdentifier()) tgt.setAccessionIdentifier(VersionConvertor_30_50.convertIdentifier(src.getAccessionIdentifier())); if (src.hasStatus()) @@ -47,13 +61,23 @@ public class Specimen30_50 { tgt.setSubject(VersionConvertor_30_50.convertReference(src.getSubject())); if (src.hasReceivedTime()) tgt.setReceivedTime(src.getReceivedTime()); - for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_50.convertReference(t)); + if (src.hasParent()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasRequest()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getRequest()) tgt.addRequest(VersionConvertor_30_50.convertReference(t)); + } if (src.hasCollection()) tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); - for (org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); - for (org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); - for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + if (src.hasProcessing()) { + for (org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); + } + if (src.hasContainer()) { + for (org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_30_50.convertAnnotation(t)); + } return tgt; } @@ -98,7 +122,9 @@ public class Specimen30_50 { return null; org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.dstu3.model.Specimen.SpecimenContainerComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasType()) @@ -117,7 +143,9 @@ public class Specimen30_50 { return null; org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); if (src.hasType()) @@ -140,7 +168,9 @@ public class Specimen30_50 { tgt.setDescription(src.getDescription()); if (src.hasProcedure()) tgt.setProcedure(VersionConvertor_30_50.convertCodeableConcept(src.getProcedure())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_50.convertReference(t)); + if (src.hasAdditive()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_50.convertReference(t)); + } if (src.hasTime()) tgt.setTime(VersionConvertor_30_50.convertType(src.getTime())); return tgt; @@ -155,7 +185,9 @@ public class Specimen30_50 { tgt.setDescription(src.getDescription()); if (src.hasProcedure()) tgt.setProcedure(VersionConvertor_30_50.convertCodeableConcept(src.getProcedure())); - for (org.hl7.fhir.r5.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_50.convertReference(t)); + if (src.hasAdditive()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAdditive()) tgt.addAdditive(VersionConvertor_30_50.convertReference(t)); + } if (src.hasTime()) tgt.setTime(VersionConvertor_30_50.convertType(src.getTime())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureDefinition30_50.java index 5c2a08939..e247e9451 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureDefinition30_50.java @@ -48,7 +48,9 @@ public class StructureDefinition30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -63,29 +65,43 @@ public class StructureDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_50.convertCoding(t)); + if (src.hasKeyword()) { + for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion())); - for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + if (src.hasMapping()) { + for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } if (src.hasKind()) tgt.setKind(convertStructureDefinitionKind(src.getKind())); if (src.hasAbstract()) tgt.setAbstract(src.getAbstract()); for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) { org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent ec = tgt.addContext(); - ec.setType(convertExtensionContext(src.getContextType())); + if (src.hasContextType()) { + ec.setType(convertExtensionContext(src.getContextType())); + } ec.setExpression("*".equals(t.getValue()) ? "Element" : t.getValue()); } - for (org.hl7.fhir.dstu3.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + if (src.hasContextInvariant()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + } if (src.hasType()) tgt.setType(src.getType()); if (src.hasBaseDefinition()) @@ -113,7 +129,9 @@ public class StructureDefinition30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -128,19 +146,29 @@ public class StructureDefinition30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_50.convertCoding(t)); + if (src.hasKeyword()) { + for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addKeyword(VersionConvertor_30_50.convertCoding(t)); + } if (src.hasFhirVersion()) tgt.setFhirVersion(src.getFhirVersion().toCode()); - for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + if (src.hasMapping()) { + for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } if (src.hasKind()) tgt.setKind(convertStructureDefinitionKind(src.getKind())); if (src.hasAbstract()) @@ -150,7 +178,9 @@ public class StructureDefinition30_50 { tgt.setContextType(convertExtensionContext(t.getType(), t.getExpression())); tgt.addContext("Element".equals(t.getExpression()) ? "*" : t.getExpression()); } - for (org.hl7.fhir.r5.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + if (src.hasContextInvariant()) { + for (org.hl7.fhir.r5.model.StringType t : src.getContextInvariant()) tgt.addContextInvariant(t.getValue()); + } if (src.hasType()) tgt.setType(src.getType()); if (src.hasBaseDefinition()) @@ -169,7 +199,9 @@ public class StructureDefinition30_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + } return tgt; } @@ -178,7 +210,9 @@ public class StructureDefinition30_50 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + } return tgt; } @@ -253,7 +287,9 @@ public class StructureDefinition30_50 { return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + } return tgt; } @@ -262,7 +298,9 @@ public class StructureDefinition30_50 { return null; org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + if (src.hasElement()) { + for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(VersionConvertor_30_50.convertElementDefinition(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureMap30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureMap30_50.java index c64831714..ea753a4b2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureMap30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/StructureMap30_50.java @@ -12,7 +12,9 @@ public class StructureMap30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -27,18 +29,30 @@ public class StructureMap30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -49,7 +63,9 @@ public class StructureMap30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -64,18 +80,30 @@ public class StructureMap30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + if (src.hasStructure()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.r5.model.UriType t : src.getImport()) tgt.addImport(t.getValue()); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } return tgt; } @@ -118,8 +146,12 @@ public class StructureMap30_50 { tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -136,8 +168,12 @@ public class StructureMap30_50 { tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + if (src.hasInput()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } return tgt; } @@ -180,10 +216,18 @@ public class StructureMap30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasSource()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -196,10 +240,18 @@ public class StructureMap30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasSource()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } if (src.hasDocumentation()) tgt.setDocumentation(src.getDocumentation()); return tgt; @@ -212,7 +264,9 @@ public class StructureMap30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.dstu3.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + if (src.hasVariable()) { + for (org.hl7.fhir.dstu3.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + } return tgt; } @@ -223,7 +277,9 @@ public class StructureMap30_50 { VersionConvertor_30_50.copyElement(src, tgt); if (src.hasName()) tgt.setName(src.getName()); - for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + if (src.hasVariable()) { + for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue()); + } return tgt; } @@ -296,12 +352,16 @@ public class StructureMap30_50 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (org.hl7.fhir.dstu3.model.Enumeration t : src.getListMode()) VersionConvertor_30_50.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + if (src.hasListMode()) { + for (org.hl7.fhir.dstu3.model.Enumeration t : src.getListMode()) VersionConvertor_30_50.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } @@ -318,12 +378,16 @@ public class StructureMap30_50 { tgt.setElement(src.getElement()); if (src.hasVariable()) tgt.setVariable(src.getVariable()); - for (org.hl7.fhir.r5.model.Enumeration t : src.getListMode()) VersionConvertor_30_50.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + if (src.hasListMode()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getListMode()) VersionConvertor_30_50.copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Substance30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Substance30_50.java index 26a314976..de54cb3c8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Substance30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/Substance30_50.java @@ -40,16 +40,24 @@ public class Substance30_50 { return null; org.hl7.fhir.r5.model.Substance tgt = new org.hl7.fhir.r5.model.Substance(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasInstance()) { + for (org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } @@ -58,16 +66,24 @@ public class Substance30_50 { return null; org.hl7.fhir.dstu3.model.Substance tgt = new org.hl7.fhir.dstu3.model.Substance(); VersionConvertor_30_50.copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasStatus()) tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasCode()) tgt.setCode(VersionConvertor_30_50.convertCodeableConcept(src.getCode())); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + if (src.hasInstance()) { + for (org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SupplyDelivery30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SupplyDelivery30_50.java index 5d82421db..cdd38ff27 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SupplyDelivery30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/SupplyDelivery30_50.java @@ -12,8 +12,12 @@ public class SupplyDelivery30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); if (src.hasPatient()) @@ -28,7 +32,9 @@ public class SupplyDelivery30_50 { tgt.setSupplier(VersionConvertor_30_50.convertReference(src.getSupplier())); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_50.convertReference(src.getDestination())); - for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); + } return tgt; } @@ -39,8 +45,12 @@ public class SupplyDelivery30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt); if (src.hasIdentifier()) tgt.setIdentifier(VersionConvertor_30_50.convertIdentifier(src.getIdentifierFirstRep())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(VersionConvertor_30_50.convertReference(t)); + } if (src.hasStatus()) tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); if (src.hasPatient()) @@ -55,7 +65,9 @@ public class SupplyDelivery30_50 { tgt.setSupplier(VersionConvertor_30_50.convertReference(src.getSupplier())); if (src.hasDestination()) tgt.setDestination(VersionConvertor_30_50.convertReference(src.getDestination())); - for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); + if (src.hasReceiver()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(VersionConvertor_30_50.convertReference(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestReport30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestReport30_50.java index 646a92a14..681517841 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestReport30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestReport30_50.java @@ -26,10 +26,14 @@ public class TestReport30_50 { tgt.setTester(src.getTester()); if (src.hasIssued()) tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); - for (org.hl7.fhir.r5.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.r5.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); return tgt; @@ -56,10 +60,14 @@ public class TestReport30_50 { tgt.setTester(src.getTester()); if (src.hasIssued()) tgt.setIssued(src.getIssued()); - for (org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + if (src.hasParticipant()) { + for (org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); return tgt; @@ -158,7 +166,9 @@ public class TestReport30_50 { return null; org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + } return tgt; } @@ -167,7 +177,9 @@ public class TestReport30_50 { return null; org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + } return tgt; } @@ -214,7 +226,9 @@ public class TestReport30_50 { return null; org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + } return tgt; } @@ -223,7 +237,9 @@ public class TestReport30_50 { return null; org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + } return tgt; } @@ -236,7 +252,9 @@ public class TestReport30_50 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + } return tgt; } @@ -249,7 +267,9 @@ public class TestReport30_50 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + } return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestScript30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestScript30_50.java index dc777f04f..8b64d0c44 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestScript30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/TestScript30_50.java @@ -28,25 +28,43 @@ public class TestScript30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } if (src.hasMetadata()) tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + if (src.hasFixture()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); return tgt; @@ -75,25 +93,43 @@ public class TestScript30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasPurpose()) tgt.setPurpose(src.getPurpose()); if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); - for (org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + if (src.hasOrigin()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } if (src.hasMetadata()) tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_50.convertReference(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + if (src.hasFixture()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProfile()) tgt.addProfile(VersionConvertor_30_50.convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } if (src.hasSetup()) tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + if (src.hasTest()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } if (src.hasTeardown()) tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); return tgt; @@ -162,10 +198,14 @@ public class TestScript30_50 { tgt.setValidated(src.getValidated()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + if (src.hasOrigin()) { + for (org.hl7.fhir.r5.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.r5.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } if (src.hasCapabilities()) tgt.setCapabilities(VersionConvertor_30_50.convertCanonicalToReference(src.getCapabilitiesElement())); return tgt; @@ -182,10 +222,14 @@ public class TestScript30_50 { tgt.setValidated(src.getValidated()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + if (src.hasOrigin()) { + for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); + } if (src.hasDestination()) tgt.setDestination(src.getDestination()); - for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); + } if (src.hasCapabilities()) tgt.setCapabilitiesElement(VersionConvertor_30_50.convertReferenceToCanonical(src.getCapabilities())); return tgt; @@ -196,8 +240,12 @@ public class TestScript30_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -206,8 +254,12 @@ public class TestScript30_50 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } return tgt; } @@ -264,7 +316,9 @@ public class TestScript30_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + } return tgt; } @@ -273,7 +327,9 @@ public class TestScript30_50 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertSetupActionComponent(t)); + } return tgt; } @@ -282,7 +338,9 @@ public class TestScript30_50 { return null; org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + } return tgt; } @@ -291,7 +349,9 @@ public class TestScript30_50 { return null; org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent(); VersionConvertor_30_50.copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTeardownActionComponent(t)); + } return tgt; } @@ -304,7 +364,9 @@ public class TestScript30_50 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + } return tgt; } @@ -317,7 +379,9 @@ public class TestScript30_50 { tgt.setName(src.getName()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + if (src.hasAction()) { + for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(VersionConvertor_30_50.convertTestActionComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ValueSet30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ValueSet30_50.java index 85959aa17..c048a2682 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ValueSet30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/ValueSet30_50.java @@ -15,7 +15,9 @@ public class ValueSet30_50 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -28,7 +30,9 @@ public class ValueSet30_50 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } return tgt; } @@ -69,9 +73,15 @@ public class ValueSet30_50 { tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); - for (org.hl7.fhir.dstu3.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + if (src.hasConcept()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } + if (src.hasValueSet()) { + for (org.hl7.fhir.dstu3.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + } return tgt; } @@ -84,9 +94,15 @@ public class ValueSet30_50 { tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } + if (src.hasValueSet()) { + for (org.hl7.fhir.r5.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); + } return tgt; } @@ -152,7 +168,9 @@ public class ValueSet30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt, "http://hl7.org/fhir/StructureDefinition/valueset-extensible"); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -167,11 +185,17 @@ public class ValueSet30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasImmutable()) tgt.setImmutable(src.getImmutable()); if (src.hasPurpose()) @@ -194,7 +218,9 @@ public class ValueSet30_50 { VersionConvertor_30_50.copyDomainResource(src, tgt, "http://hl7.org/fhir/StructureDefinition/valueset-extensible"); if (src.hasUrl()) tgt.setUrl(src.getUrl()); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_30_50.convertIdentifier(t)); + } if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasName()) @@ -209,11 +235,17 @@ public class ValueSet30_50 { tgt.setDate(src.getDate()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_50.convertContactDetail(t)); + } if (src.hasDescription()) tgt.setDescription(src.getDescription()); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_50.convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_50.convertCodeableConcept(t)); + } if (src.hasImmutable()) tgt.setImmutable(src.getImmutable()); if (src.hasPurpose()) @@ -238,8 +270,12 @@ public class ValueSet30_50 { tgt.setLockedDate(src.getLockedDate()); if (src.hasInactive()) tgt.setInactive(src.getInactive()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasInclude()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -252,8 +288,12 @@ public class ValueSet30_50 { tgt.setLockedDate(src.getLockedDate()); if (src.hasInactive()) tgt.setInactive(src.getInactive()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + if (src.hasInclude()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } return tgt; } @@ -270,8 +310,12 @@ public class ValueSet30_50 { tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -288,8 +332,12 @@ public class ValueSet30_50 { tgt.setTotal(src.getTotal()); if (src.hasOffset()) tgt.setOffset(src.getOffset()); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -310,8 +358,12 @@ public class ValueSet30_50 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } @@ -332,8 +384,12 @@ public class ValueSet30_50 { tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Account.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Account.java index 7b612b009..11cf33612 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Account.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Account.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,149 +50,164 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Account extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Account convertAccount(org.hl7.fhir.r4.model.Account src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Account tgt = new org.hl7.fhir.r5.model.Account(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertAccountStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getSubject()) - tgt.addSubject(convertReference(t)); - if (src.hasServicePeriod()) - tgt.setServicePeriod(convertPeriod(src.getServicePeriod())); - for (org.hl7.fhir.r4.model.Account.CoverageComponent t : src.getCoverage()) - tgt.addCoverage(convertCoverageComponent(t)); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Account.GuarantorComponent t : src.getGuarantor()) - tgt.addGuarantor(convertGuarantorComponent(t)); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Account convertAccount(org.hl7.fhir.r5.model.Account src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Account tgt = new org.hl7.fhir.r4.model.Account(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertAccountStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) - tgt.addSubject(convertReference(t)); - if (src.hasServicePeriod()) - tgt.setServicePeriod(convertPeriod(src.getServicePeriod())); - for (org.hl7.fhir.r5.model.Account.CoverageComponent t : src.getCoverage()) - tgt.addCoverage(convertCoverageComponent(t)); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Account.GuarantorComponent t : src.getGuarantor()) - tgt.addGuarantor(convertGuarantorComponent(t)); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Account.AccountStatus convertAccountStatus(org.hl7.fhir.r4.model.Account.AccountStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Account.AccountStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r5.model.Account.AccountStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Account.AccountStatus.ENTEREDINERROR; - case ONHOLD: return org.hl7.fhir.r5.model.Account.AccountStatus.ONHOLD; - case UNKNOWN: return org.hl7.fhir.r5.model.Account.AccountStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Account.AccountStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Account.AccountStatus convertAccountStatus(org.hl7.fhir.r5.model.Account.AccountStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Account.AccountStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r4.model.Account.AccountStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Account.AccountStatus.ENTEREDINERROR; - case ONHOLD: return org.hl7.fhir.r4.model.Account.AccountStatus.ONHOLD; - case UNKNOWN: return org.hl7.fhir.r4.model.Account.AccountStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.Account.AccountStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r4.model.Account.CoverageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Account.CoverageComponent tgt = new org.hl7.fhir.r5.model.Account.CoverageComponent(); - copyElement(src, tgt); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasPriority()) - tgt.setPriorityElement(convertPositiveInt(src.getPriorityElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r5.model.Account.CoverageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Account.CoverageComponent tgt = new org.hl7.fhir.r4.model.Account.CoverageComponent(); - copyElement(src, tgt); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasPriority()) - tgt.setPriorityElement(convertPositiveInt(src.getPriorityElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r4.model.Account.GuarantorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r5.model.Account.GuarantorComponent(); - copyElement(src, tgt); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - if (src.hasOnHold()) - tgt.setOnHoldElement(convertBoolean(src.getOnHoldElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r5.model.Account.GuarantorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r4.model.Account.GuarantorComponent(); - copyElement(src, tgt); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - if (src.hasOnHold()) - tgt.setOnHoldElement(convertBoolean(src.getOnHoldElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } + public static org.hl7.fhir.r5.model.Account convertAccount(org.hl7.fhir.r4.model.Account src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Account tgt = new org.hl7.fhir.r5.model.Account(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertAccountStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasSubject()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSubject()) tgt.addSubject(convertReference(t)); + } + if (src.hasServicePeriod()) + tgt.setServicePeriod(convertPeriod(src.getServicePeriod())); + if (src.hasCoverage()) { + for (org.hl7.fhir.r4.model.Account.CoverageComponent t : src.getCoverage()) tgt.addCoverage(convertCoverageComponent(t)); + } + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasGuarantor()) { + for (org.hl7.fhir.r4.model.Account.GuarantorComponent t : src.getGuarantor()) tgt.addGuarantor(convertGuarantorComponent(t)); + } + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + return tgt; + } + public static org.hl7.fhir.r4.model.Account convertAccount(org.hl7.fhir.r5.model.Account src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Account tgt = new org.hl7.fhir.r4.model.Account(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertAccountStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasSubject()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) tgt.addSubject(convertReference(t)); + } + if (src.hasServicePeriod()) + tgt.setServicePeriod(convertPeriod(src.getServicePeriod())); + if (src.hasCoverage()) { + for (org.hl7.fhir.r5.model.Account.CoverageComponent t : src.getCoverage()) tgt.addCoverage(convertCoverageComponent(t)); + } + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasGuarantor()) { + for (org.hl7.fhir.r5.model.Account.GuarantorComponent t : src.getGuarantor()) tgt.addGuarantor(convertGuarantorComponent(t)); + } + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + return tgt; + } + public static org.hl7.fhir.r5.model.Account.AccountStatus convertAccountStatus(org.hl7.fhir.r4.model.Account.AccountStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Account.AccountStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r5.model.Account.AccountStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Account.AccountStatus.ENTEREDINERROR; + case ONHOLD: + return org.hl7.fhir.r5.model.Account.AccountStatus.ONHOLD; + case UNKNOWN: + return org.hl7.fhir.r5.model.Account.AccountStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Account.AccountStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Account.AccountStatus convertAccountStatus(org.hl7.fhir.r5.model.Account.AccountStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Account.AccountStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r4.model.Account.AccountStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Account.AccountStatus.ENTEREDINERROR; + case ONHOLD: + return org.hl7.fhir.r4.model.Account.AccountStatus.ONHOLD; + case UNKNOWN: + return org.hl7.fhir.r4.model.Account.AccountStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Account.AccountStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r4.model.Account.CoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Account.CoverageComponent tgt = new org.hl7.fhir.r5.model.Account.CoverageComponent(); + copyElement(src, tgt); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasPriority()) + tgt.setPriorityElement(convertPositiveInt(src.getPriorityElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r5.model.Account.CoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Account.CoverageComponent tgt = new org.hl7.fhir.r4.model.Account.CoverageComponent(); + copyElement(src, tgt); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasPriority()) + tgt.setPriorityElement(convertPositiveInt(src.getPriorityElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r4.model.Account.GuarantorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r5.model.Account.GuarantorComponent(); + copyElement(src, tgt); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + if (src.hasOnHold()) + tgt.setOnHoldElement(convertBoolean(src.getOnHoldElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r5.model.Account.GuarantorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r4.model.Account.GuarantorComponent(); + copyElement(src, tgt); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + if (src.hasOnHold()) + tgt.setOnHoldElement(convertBoolean(src.getOnHoldElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ActivityDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ActivityDefinition.java index 53891fb35..96e7e6500 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ActivityDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ActivityDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,387 +50,490 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ActivityDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r4.model.ActivityDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ActivityDefinition tgt = new org.hl7.fhir.r5.model.ActivityDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) - tgt.getLibrary().add(convertCanonical(t)); - if (src.hasKind()) - tgt.setKind(convertActivityDefinitionKind(src.getKind())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasIntent()) - tgt.setIntent(convertRequestIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); - if (src.hasProduct()) - tgt.setProduct(convertType(src.getProduct())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) - tgt.addDosage(convertDosage(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSpecimenRequirement()) - tgt.addSpecimenRequirement(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getObservationRequirement()) - tgt.addObservationRequirement(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getObservationResultRequirement()) - tgt.addObservationResultRequirement(convertReference(t)); - if (src.hasTransform()) - tgt.setTransformElement(convertCanonical(src.getTransformElement())); - for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) - tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r5.model.ActivityDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ActivityDefinition tgt = new org.hl7.fhir.r4.model.ActivityDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) - tgt.getLibrary().add(convertCanonical(t)); - if (src.hasKind()) - tgt.setKind(convertActivityDefinitionKind(src.getKind())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasIntent()) - tgt.setIntent(convertRequestIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); - if (src.hasProduct()) - tgt.setProduct(convertType(src.getProduct())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) - tgt.addDosage(convertDosage(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSpecimenRequirement()) - tgt.addSpecimenRequirement(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getObservationRequirement()) - tgt.addObservationRequirement(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getObservationResultRequirement()) - tgt.addObservationResultRequirement(convertReference(t)); - if (src.hasTransform()) - tgt.setTransformElement(convertCanonical(src.getTransformElement())); - for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) - tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType convertActivityDefinitionKind(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPOINTMENT: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENT; - case APPOINTMENTRESPONSE: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENTRESPONSE; - case CAREPLAN: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CAREPLAN; - case CLAIM: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CLAIM; - case COMMUNICATIONREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.COMMUNICATIONREQUEST; - case CONTRACT: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CONTRACT; - case DEVICEREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.DEVICEREQUEST; - case ENROLLMENTREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.ENROLLMENTREQUEST; - case IMMUNIZATIONRECOMMENDATION: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.IMMUNIZATIONRECOMMENDATION; - case MEDICATIONREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.MEDICATIONREQUEST; - case NUTRITIONORDER: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NUTRITIONORDER; - case SERVICEREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SERVICEREQUEST; - case SUPPLYREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SUPPLYREQUEST; - case TASK: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.TASK; - case VISIONPRESCRIPTION: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.VISIONPRESCRIPTION; - default: return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NULL; - } -} - - public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind convertActivityDefinitionKind(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPOINTMENT: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT; - case APPOINTMENTRESPONSE: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE; - case CAREPLAN: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN; - case CLAIM: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CLAIM; - case COMMUNICATIONREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST; - case CONTRACT: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CONTRACT; - case DEVICEREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST; - case ENROLLMENTREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST; - case IMMUNIZATIONRECOMMENDATION: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION; - case MEDICATIONREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST; - case NUTRITIONORDER: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER; - case SERVICEREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST; - case SUPPLYREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST; - case TASK: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.TASK; - case VISIONPRESCRIPTION: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION; - default: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; - default: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.OPTION; - default: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.STAT; - default: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertActivityParticipantType(src.getType())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertActivityParticipantType(src.getType())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ActionParticipantType convertActivityParticipantType(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT; - case PRACTITIONER: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER; - case RELATEDPERSON: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON; - case DEVICE: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE; - default: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL; - } -} - - public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType convertActivityParticipantType(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PATIENT; - case PRACTITIONER: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER; - case RELATEDPERSON: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON; - case DEVICE: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.DEVICE; - default: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.NULL; - } -} - - public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent(); - copyElement(src, tgt); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent(); - copyElement(src, tgt); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } + public static org.hl7.fhir.r5.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r4.model.ActivityDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ActivityDefinition tgt = new org.hl7.fhir.r5.model.ActivityDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t)); + } + if (src.hasKind()) + tgt.setKind(convertActivityDefinitionKind(src.getKind())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasIntent()) + tgt.setIntent(convertRequestIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + } + if (src.hasProduct()) + tgt.setProduct(convertType(src.getProduct())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDosage()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(convertDosage(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasSpecimenRequirement()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSpecimenRequirement()) tgt.addSpecimenRequirement(convertReference(t)); + } + if (src.hasObservationRequirement()) { + for (org.hl7.fhir.r4.model.Reference t : src.getObservationRequirement()) tgt.addObservationRequirement(convertReference(t)); + } + if (src.hasObservationResultRequirement()) { + for (org.hl7.fhir.r4.model.Reference t : src.getObservationResultRequirement()) tgt.addObservationResultRequirement(convertReference(t)); + } + if (src.hasTransform()) + tgt.setTransformElement(convertCanonical(src.getTransformElement())); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r5.model.ActivityDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ActivityDefinition tgt = new org.hl7.fhir.r4.model.ActivityDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t)); + } + if (src.hasKind()) + tgt.setKind(convertActivityDefinitionKind(src.getKind())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasIntent()) + tgt.setIntent(convertRequestIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + } + if (src.hasProduct()) + tgt.setProduct(convertType(src.getProduct())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDosage()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(convertDosage(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasSpecimenRequirement()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimenRequirement()) tgt.addSpecimenRequirement(convertReference(t)); + } + if (src.hasObservationRequirement()) { + for (org.hl7.fhir.r5.model.Reference t : src.getObservationRequirement()) tgt.addObservationRequirement(convertReference(t)); + } + if (src.hasObservationResultRequirement()) { + for (org.hl7.fhir.r5.model.Reference t : src.getObservationResultRequirement()) tgt.addObservationResultRequirement(convertReference(t)); + } + if (src.hasTransform()) + tgt.setTransformElement(convertCanonical(src.getTransformElement())); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType convertActivityDefinitionKind(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPOINTMENT: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENT; + case APPOINTMENTRESPONSE: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENTRESPONSE; + case CAREPLAN: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CAREPLAN; + case CLAIM: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CLAIM; + case COMMUNICATIONREQUEST: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.COMMUNICATIONREQUEST; + case CONTRACT: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CONTRACT; + case DEVICEREQUEST: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.DEVICEREQUEST; + case ENROLLMENTREQUEST: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.ENROLLMENTREQUEST; + case IMMUNIZATIONRECOMMENDATION: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.IMMUNIZATIONRECOMMENDATION; + case MEDICATIONREQUEST: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.MEDICATIONREQUEST; + case NUTRITIONORDER: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NUTRITIONORDER; + case SERVICEREQUEST: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SERVICEREQUEST; + case SUPPLYREQUEST: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SUPPLYREQUEST; + case TASK: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.TASK; + case VISIONPRESCRIPTION: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.VISIONPRESCRIPTION; + default: + return org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NULL; + } + } + + public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind convertActivityDefinitionKind(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPOINTMENT: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT; + case APPOINTMENTRESPONSE: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE; + case CAREPLAN: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN; + case CLAIM: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CLAIM; + case COMMUNICATIONREQUEST: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST; + case CONTRACT: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CONTRACT; + case DEVICEREQUEST: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST; + case ENROLLMENTREQUEST: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST; + case IMMUNIZATIONRECOMMENDATION: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION; + case MEDICATIONREQUEST: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST; + case NUTRITIONORDER: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER; + case SERVICEREQUEST: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST; + case SUPPLYREQUEST: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST; + case TASK: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.TASK; + case VISIONPRESCRIPTION: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION; + default: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.OPTION; + default: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.STAT; + default: + return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertActivityParticipantType(src.getType())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertActivityParticipantType(src.getType())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionParticipantType convertActivityParticipantType(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT; + case PRACTITIONER: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER; + case RELATEDPERSON: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON; + case DEVICE: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL; + } + } + + public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType convertActivityParticipantType(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PATIENT; + case PRACTITIONER: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER; + case RELATEDPERSON: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON; + case DEVICE: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.DEVICE; + default: + return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.NULL; + } + } + + public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent(); + copyElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent(); + copyElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java index 24642acfb..02595a457 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,223 +50,262 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class AllergyIntolerance extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r4.model.AllergyIntolerance src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AllergyIntolerance tgt = new org.hl7.fhir.r5.model.AllergyIntolerance(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasClinicalStatus()) - tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); - if (src.hasVerificationStatus()) - tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); - if (src.hasType()) - tgt.setType(convertAllergyIntoleranceType(src.getType())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getCategory()) - copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); - if (src.hasCriticality()) - tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOnset()) - tgt.setOnset(convertType(src.getOnset())); - if (src.hasRecordedDate()) - tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - if (src.hasAsserter()) - tgt.setAsserter(convertReference(src.getAsserter())); - if (src.hasLastOccurrence()) - tgt.setLastOccurrenceElement(convertDateTime(src.getLastOccurrenceElement())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) - tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r5.model.AllergyIntolerance src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AllergyIntolerance tgt = new org.hl7.fhir.r4.model.AllergyIntolerance(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasClinicalStatus()) - tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); - if (src.hasVerificationStatus()) - tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); - if (src.hasType()) - tgt.setType(convertAllergyIntoleranceType(src.getType())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getCategory()) - copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); - if (src.hasCriticality()) - tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOnset()) - tgt.setOnset(convertType(src.getOnset())); - if (src.hasRecordedDate()) - tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - if (src.hasAsserter()) - tgt.setAsserter(convertReference(src.getAsserter())); - if (src.hasLastOccurrence()) - tgt.setLastOccurrenceElement(convertDateTime(src.getLastOccurrenceElement())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) - tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType convertAllergyIntoleranceType(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ALLERGY: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY; - case INTOLERANCE: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE; - default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.NULL; - } -} - - public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType convertAllergyIntoleranceType(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ALLERGY: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY; - case INTOLERANCE: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE; - default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.NULL; - } -} - - public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory convertAllergyIntoleranceCategory(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FOOD: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD; - case MEDICATION: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION; - case ENVIRONMENT: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT; - case BIOLOGIC: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC; - default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL; - } -} - - public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory convertAllergyIntoleranceCategory(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FOOD: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD; - case MEDICATION: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION; - case ENVIRONMENT: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT; - case BIOLOGIC: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC; - default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL; - } -} - - public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality convertAllergyIntoleranceCriticality(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case LOW: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW; - case HIGH: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH; - case UNABLETOASSESS: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS; - default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL; - } -} - - public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality convertAllergyIntoleranceCriticality(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case LOW: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW; - case HIGH: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH; - case UNABLETOASSESS: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS; - default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL; - } -} - - public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent(); - copyElement(src, tgt); - if (src.hasSubstance()) - tgt.setSubstance(convertCodeableConcept(src.getSubstance())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getManifestation()) - tgt.addManifestation(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasOnset()) - tgt.setOnsetElement(convertDateTime(src.getOnsetElement())); - if (src.hasSeverity()) - tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); - if (src.hasExposureRoute()) - tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent(); - copyElement(src, tgt); - if (src.hasSubstance()) - tgt.setSubstance(convertCodeableConcept(src.getSubstance())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getManifestation()) - tgt.addManifestation(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasOnset()) - tgt.setOnsetElement(convertDateTime(src.getOnsetElement())); - if (src.hasSeverity()) - tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); - if (src.hasExposureRoute()) - tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity convertAllergyIntoleranceSeverity(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MILD: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD; - case MODERATE: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE; - case SEVERE: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE; - default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL; - } -} - - public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity convertAllergyIntoleranceSeverity(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MILD: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD; - case MODERATE: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE; - case SEVERE: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE; - default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL; - } -} + public static org.hl7.fhir.r5.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r4.model.AllergyIntolerance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AllergyIntolerance tgt = new org.hl7.fhir.r5.model.AllergyIntolerance(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); + if (src.hasType()) + tgt.setType(convertAllergyIntoleranceType(src.getType())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getCategory()) copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + } + if (src.hasCriticality()) + tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(convertType(src.getOnset())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + if (src.hasAsserter()) + tgt.setAsserter(convertReference(src.getAsserter())); + if (src.hasLastOccurrence()) + tgt.setLastOccurrenceElement(convertDateTime(src.getLastOccurrenceElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasReaction()) { + for (org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r5.model.AllergyIntolerance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AllergyIntolerance tgt = new org.hl7.fhir.r4.model.AllergyIntolerance(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); + if (src.hasType()) + tgt.setType(convertAllergyIntoleranceType(src.getType())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getCategory()) copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); + } + if (src.hasCriticality()) + tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(convertType(src.getOnset())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + if (src.hasAsserter()) + tgt.setAsserter(convertReference(src.getAsserter())); + if (src.hasLastOccurrence()) + tgt.setLastOccurrenceElement(convertDateTime(src.getLastOccurrenceElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasReaction()) { + for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType convertAllergyIntoleranceType(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ALLERGY: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY; + case INTOLERANCE: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE; + default: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.NULL; + } + } + + public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType convertAllergyIntoleranceType(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ALLERGY: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY; + case INTOLERANCE: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE; + default: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.NULL; + } + } + + public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory convertAllergyIntoleranceCategory(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FOOD: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD; + case MEDICATION: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION; + case ENVIRONMENT: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT; + case BIOLOGIC: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC; + default: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL; + } + } + + public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory convertAllergyIntoleranceCategory(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FOOD: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD; + case MEDICATION: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION; + case ENVIRONMENT: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT; + case BIOLOGIC: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC; + default: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL; + } + } + + public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality convertAllergyIntoleranceCriticality(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case LOW: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW; + case HIGH: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH; + case UNABLETOASSESS: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS; + default: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL; + } + } + + public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality convertAllergyIntoleranceCriticality(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case LOW: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW; + case HIGH: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH; + case UNABLETOASSESS: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS; + default: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL; + } + } + + public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent(); + copyElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(convertCodeableConcept(src.getSubstance())); + if (src.hasManifestation()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasOnset()) + tgt.setOnsetElement(convertDateTime(src.getOnsetElement())); + if (src.hasSeverity()) + tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); + if (src.hasExposureRoute()) + tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent(); + copyElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(convertCodeableConcept(src.getSubstance())); + if (src.hasManifestation()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getManifestation()) tgt.addManifestation(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasOnset()) + tgt.setOnsetElement(convertDateTime(src.getOnsetElement())); + if (src.hasSeverity()) + tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity())); + if (src.hasExposureRoute()) + tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity convertAllergyIntoleranceSeverity(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MILD: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD; + case MODERATE: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE; + case SEVERE: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE; + default: + return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL; + } + } + + public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity convertAllergyIntoleranceSeverity(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MILD: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD; + case MODERATE: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE; + case SEVERE: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE; + default: + return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Appointment.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Appointment.java index 191d2be0a..8908b163f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Appointment.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Appointment.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,235 +51,290 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Appointment extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Appointment convertAppointment(org.hl7.fhir.r4.model.Appointment src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Appointment tgt = new org.hl7.fhir.r5.model.Appointment(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertAppointmentStatus(src.getStatus())); - if (src.hasCancelationReason()) - tgt.setCancelationReason(convertCodeableConcept(src.getCancelationReason())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory()) - tgt.addServiceCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) - tgt.addServiceType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - if (src.hasAppointmentType()) - tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - if (src.hasPriority()) - tgt.setPriorityElement(convertUnsignedInt(src.getPriorityElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - if (src.hasStart()) - tgt.setStartElement(convertInstant(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInstant(src.getEndElement())); - if (src.hasMinutesDuration()) - tgt.setMinutesDurationElement(convertPositiveInt(src.getMinutesDurationElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getSlot()) - tgt.addSlot(convertReference(t)); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasPatientInstruction()) - tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertAppointmentParticipantComponent(t)); - for (org.hl7.fhir.r4.model.Period t : src.getRequestedPeriod()) - tgt.addRequestedPeriod(convertPeriod(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Appointment convertAppointment(org.hl7.fhir.r5.model.Appointment src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Appointment tgt = new org.hl7.fhir.r4.model.Appointment(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertAppointmentStatus(src.getStatus())); - if (src.hasCancelationReason()) - tgt.setCancelationReason(convertCodeableConcept(src.getCancelationReason())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) - tgt.addServiceCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) - tgt.addServiceType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - if (src.hasAppointmentType()) - tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - if (src.hasPriority()) - tgt.setPriorityElement(convertUnsignedInt(src.getPriorityElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - if (src.hasStart()) - tgt.setStartElement(convertInstant(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInstant(src.getEndElement())); - if (src.hasMinutesDuration()) - tgt.setMinutesDurationElement(convertPositiveInt(src.getMinutesDurationElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) - tgt.addSlot(convertReference(t)); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasPatientInstruction()) - tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertAppointmentParticipantComponent(t)); - for (org.hl7.fhir.r5.model.Period t : src.getRequestedPeriod()) - tgt.addRequestedPeriod(convertPeriod(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Appointment.AppointmentStatus convertAppointmentStatus(org.hl7.fhir.r4.model.Appointment.AppointmentStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED; - case PENDING: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING; - case BOOKED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED; - case ARRIVED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED; - case FULFILLED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED; - case CANCELLED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED; - case NOSHOW: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR; - case CHECKEDIN: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CHECKEDIN; - case WAITLIST: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.WAITLIST; - default: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Appointment.AppointmentStatus convertAppointmentStatus(org.hl7.fhir.r5.model.Appointment.AppointmentStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED; - case PENDING: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING; - case BOOKED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED; - case ARRIVED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED; - case FULFILLED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED; - case CANCELLED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED; - case NOSHOW: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ENTEREDINERROR; - case CHECKEDIN: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CHECKEDIN; - case WAITLIST: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.WAITLIST; - default: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - if (src.hasRequired()) - tgt.setRequired(convertParticipantRequired(src.getRequired())); - if (src.hasStatus()) - tgt.setStatus(convertParticipationStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - if (src.hasRequired()) - tgt.setRequired(convertParticipantRequired(src.getRequired())); - if (src.hasStatus()) - tgt.setStatus(convertParticipationStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Appointment.ParticipantRequired convertParticipantRequired(org.hl7.fhir.r4.model.Appointment.ParticipantRequired src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REQUIRED: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.REQUIRED; - case OPTIONAL: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.OPTIONAL; - case INFORMATIONONLY: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.INFORMATIONONLY; - default: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.NULL; - } -} - - public static org.hl7.fhir.r4.model.Appointment.ParticipantRequired convertParticipantRequired(org.hl7.fhir.r5.model.Appointment.ParticipantRequired src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REQUIRED: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED; - case OPTIONAL: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL; - case INFORMATIONONLY: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY; - default: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ParticipationStatus convertParticipationStatus(org.hl7.fhir.r4.model.Appointment.ParticipationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACCEPTED: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED; - case DECLINED: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED; - case TENTATIVE: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE; - case NEEDSACTION: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION; - default: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Appointment.ParticipationStatus convertParticipationStatus(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACCEPTED: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED; - case DECLINED: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED; - case TENTATIVE: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE; - case NEEDSACTION: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION; - default: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.Appointment convertAppointment(org.hl7.fhir.r4.model.Appointment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Appointment tgt = new org.hl7.fhir.r5.model.Appointment(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + if (src.hasCancelationReason()) + tgt.setCancelationReason(convertCodeableConcept(src.getCancelationReason())); + if (src.hasServiceCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory()) tgt.addServiceCategory(convertCodeableConcept(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasAppointmentType()) + tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasPriority()) + tgt.setPriorityElement(convertUnsignedInt(src.getPriorityElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasStart()) + tgt.setStartElement(convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInstant(src.getEndElement())); + if (src.hasMinutesDuration()) + tgt.setMinutesDurationElement(convertPositiveInt(src.getMinutesDurationElement())); + if (src.hasSlot()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSlot()) tgt.addSlot(convertReference(t)); + } + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } + if (src.hasRequestedPeriod()) { + for (org.hl7.fhir.r4.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(convertPeriod(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Appointment convertAppointment(org.hl7.fhir.r5.model.Appointment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Appointment tgt = new org.hl7.fhir.r4.model.Appointment(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertAppointmentStatus(src.getStatus())); + if (src.hasCancelationReason()) + tgt.setCancelationReason(convertCodeableConcept(src.getCancelationReason())); + if (src.hasServiceCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) tgt.addServiceCategory(convertCodeableConcept(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasAppointmentType()) + tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasPriority()) + tgt.setPriorityElement(convertUnsignedInt(src.getPriorityElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasStart()) + tgt.setStartElement(convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInstant(src.getEndElement())); + if (src.hasMinutesDuration()) + tgt.setMinutesDurationElement(convertPositiveInt(src.getMinutesDurationElement())); + if (src.hasSlot()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(convertReference(t)); + } + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); + } + if (src.hasRequestedPeriod()) { + for (org.hl7.fhir.r5.model.Period t : src.getRequestedPeriod()) tgt.addRequestedPeriod(convertPeriod(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Appointment.AppointmentStatus convertAppointmentStatus(org.hl7.fhir.r4.model.Appointment.AppointmentStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSED: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED; + case PENDING: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING; + case BOOKED: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED; + case ARRIVED: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED; + case FULFILLED: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED; + case CANCELLED: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED; + case NOSHOW: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR; + case CHECKEDIN: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CHECKEDIN; + case WAITLIST: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.WAITLIST; + default: + return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Appointment.AppointmentStatus convertAppointmentStatus(org.hl7.fhir.r5.model.Appointment.AppointmentStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSED: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED; + case PENDING: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING; + case BOOKED: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED; + case ARRIVED: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED; + case FULFILLED: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED; + case CANCELLED: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED; + case NOSHOW: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ENTEREDINERROR; + case CHECKEDIN: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CHECKEDIN; + case WAITLIST: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.WAITLIST; + default: + return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + if (src.hasRequired()) + tgt.setRequired(convertParticipantRequired(src.getRequired())); + if (src.hasStatus()) + tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + if (src.hasRequired()) + tgt.setRequired(convertParticipantRequired(src.getRequired())); + if (src.hasStatus()) + tgt.setStatus(convertParticipationStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Appointment.ParticipantRequired convertParticipantRequired(org.hl7.fhir.r4.model.Appointment.ParticipantRequired src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REQUIRED: + return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.REQUIRED; + case OPTIONAL: + return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.OPTIONAL; + case INFORMATIONONLY: + return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.INFORMATIONONLY; + default: + return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.NULL; + } + } + + public static org.hl7.fhir.r4.model.Appointment.ParticipantRequired convertParticipantRequired(org.hl7.fhir.r5.model.Appointment.ParticipantRequired src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REQUIRED: + return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED; + case OPTIONAL: + return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL; + case INFORMATIONONLY: + return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY; + default: + return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ParticipationStatus convertParticipationStatus(org.hl7.fhir.r4.model.Appointment.ParticipationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACCEPTED: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED; + case DECLINED: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED; + case TENTATIVE: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE; + case NEEDSACTION: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION; + default: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Appointment.ParticipationStatus convertParticipationStatus(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACCEPTED: + return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED; + case DECLINED: + return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED; + case TENTATIVE: + return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE; + case NEEDSACTION: + return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION; + default: + return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AppointmentResponse.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AppointmentResponse.java index c25f92006..130937ff9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AppointmentResponse.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AppointmentResponse.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,83 +50,92 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class AppointmentResponse extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r4.model.AppointmentResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AppointmentResponse tgt = new org.hl7.fhir.r5.model.AppointmentResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasAppointment()) - tgt.setAppointment(convertReference(src.getAppointment())); - if (src.hasStart()) - tgt.setStartElement(convertInstant(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInstant(src.getEndElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getParticipantType()) - tgt.addParticipantType(convertCodeableConcept(t)); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - if (src.hasParticipantStatus()) - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r5.model.AppointmentResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AppointmentResponse tgt = new org.hl7.fhir.r4.model.AppointmentResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasAppointment()) - tgt.setAppointment(convertReference(src.getAppointment())); - if (src.hasStart()) - tgt.setStartElement(convertInstant(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInstant(src.getEndElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType()) - tgt.addParticipantType(convertCodeableConcept(t)); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - if (src.hasParticipantStatus()) - tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ParticipationStatus convertParticipantStatus(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACCEPTED: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED; - case DECLINED: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED; - case TENTATIVE: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE; - case NEEDSACTION: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION; - default: return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus convertParticipantStatus(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACCEPTED: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED; - case DECLINED: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED; - case TENTATIVE: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE; - case NEEDSACTION: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION; - default: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r4.model.AppointmentResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AppointmentResponse tgt = new org.hl7.fhir.r5.model.AppointmentResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasAppointment()) + tgt.setAppointment(convertReference(src.getAppointment())); + if (src.hasStart()) + tgt.setStartElement(convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInstant(src.getEndElement())); + if (src.hasParticipantType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(convertCodeableConcept(t)); + } + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + if (src.hasParticipantStatus()) + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r5.model.AppointmentResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AppointmentResponse tgt = new org.hl7.fhir.r4.model.AppointmentResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasAppointment()) + tgt.setAppointment(convertReference(src.getAppointment())); + if (src.hasStart()) + tgt.setStartElement(convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInstant(src.getEndElement())); + if (src.hasParticipantType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(convertCodeableConcept(t)); + } + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + if (src.hasParticipantStatus()) + tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.ParticipationStatus convertParticipantStatus(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACCEPTED: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED; + case DECLINED: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED; + case TENTATIVE: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE; + case NEEDSACTION: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION; + default: + return org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus convertParticipantStatus(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACCEPTED: + return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED; + case DECLINED: + return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED; + case TENTATIVE: + return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE; + case NEEDSACTION: + return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION; + default: + return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AuditEvent.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AuditEvent.java index c6c0fa890..ad352e707 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AuditEvent.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AuditEvent.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,335 +50,384 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class AuditEvent extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.AuditEvent convertAuditEvent(org.hl7.fhir.r4.model.AuditEvent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent(); - copyDomainResource(src, tgt); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) - tgt.addSubtype(convertCoding(t)); - if (src.hasAction()) - tgt.setAction(convertAuditEventAction(src.getAction())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasRecorded()) - tgt.setRecordedElement(convertInstant(src.getRecordedElement())); - if (src.hasOutcome()) - tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); - if (src.hasOutcomeDesc()) - tgt.setOutcomeDescElement(convertString(src.getOutcomeDescElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent()) - tgt.addPurposeOfEvent(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) - tgt.addAgent(convertAuditEventAgentComponent(t)); - if (src.hasSource()) - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) - tgt.addEntity(convertAuditEventEntityComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.AuditEvent convertAuditEvent(org.hl7.fhir.r5.model.AuditEvent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AuditEvent tgt = new org.hl7.fhir.r4.model.AuditEvent(); - copyDomainResource(src, tgt); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) - tgt.addSubtype(convertCoding(t)); - if (src.hasAction()) - tgt.setAction(convertAuditEventAction(src.getAction())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasRecorded()) - tgt.setRecordedElement(convertInstant(src.getRecordedElement())); - if (src.hasOutcome()) - tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); - if (src.hasOutcomeDesc()) - tgt.setOutcomeDescElement(convertString(src.getOutcomeDescElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent()) - tgt.addPurposeOfEvent(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) - tgt.addAgent(convertAuditEventAgentComponent(t)); - if (src.hasSource()) - tgt.setSource(convertAuditEventSourceComponent(src.getSource())); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) - tgt.addEntity(convertAuditEventEntityComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAction convertAuditEventAction(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case C: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C; - case R: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R; - case U: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U; - case D: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D; - case E: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E; - default: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL; - } -} - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAction convertAuditEventAction(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case C: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C; - case R: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R; - case U: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U; - case D: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D; - case E: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E; - default: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL; - } -} - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome convertAuditEventOutcome(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case _0: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._0; - case _4: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._4; - case _8: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._8; - case _12: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._12; - default: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome.NULL; - } -} - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome convertAuditEventOutcome(org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case _0: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._0; - case _4: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._4; - case _8: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._8; - case _12: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._12; - default: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome.NULL; - } -} - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) - tgt.addRole(convertCodeableConcept(t)); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - if (src.hasAltId()) - tgt.setAltIdElement(convertString(src.getAltIdElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasRequestor()) - tgt.setRequestorElement(convertBoolean(src.getRequestorElement())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) - tgt.getPolicy().add(convertUri(t)); - if (src.hasMedia()) - tgt.setMedia(convertCoding(src.getMedia())); - if (src.hasNetwork()) - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse()) - tgt.addPurposeOfUse(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) - tgt.addRole(convertCodeableConcept(t)); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - if (src.hasAltId()) - tgt.setAltIdElement(convertString(src.getAltIdElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasRequestor()) - tgt.setRequestorElement(convertBoolean(src.getRequestorElement())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) - tgt.getPolicy().add(convertUri(t)); - if (src.hasMedia()) - tgt.setMedia(convertCoding(src.getMedia())); - if (src.hasNetwork()) - tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse()) - tgt.addPurposeOfUse(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent(); - copyElement(src, tgt); - if (src.hasAddress()) - tgt.setAddressElement(convertString(src.getAddressElement())); - if (src.hasType()) - tgt.setType(convertAuditEventAgentNetworkType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent(); - copyElement(src, tgt); - if (src.hasAddress()) - tgt.setAddressElement(convertString(src.getAddressElement())); - if (src.hasType()) - tgt.setType(convertAuditEventAgentNetworkType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType convertAuditEventAgentNetworkType(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case _1: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1; - case _2: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2; - case _3: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3; - case _4: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4; - case _5: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5; - default: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL; - } -} - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case _1: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1; - case _2: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2; - case _3: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3; - case _4: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4; - case _5: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5; - default: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL; - } -} - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent(); - copyElement(src, tgt); - if (src.hasSite()) - tgt.setSiteElement(convertString(src.getSiteElement())); - if (src.hasObserver()) - tgt.setObserver(convertReference(src.getObserver())); - for (org.hl7.fhir.r4.model.Coding t : src.getType()) - tgt.addType(convertCoding(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent(); - copyElement(src, tgt); - if (src.hasSite()) - tgt.setSiteElement(convertString(src.getSiteElement())); - if (src.hasObserver()) - tgt.setObserver(convertReference(src.getObserver())); - for (org.hl7.fhir.r5.model.Coding t : src.getType()) - tgt.addType(convertCoding(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent(); - copyElement(src, tgt); - if (src.hasWhat()) - tgt.setWhat(convertReference(src.getWhat())); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - if (src.hasRole()) - tgt.setRole(convertCoding(src.getRole())); - if (src.hasLifecycle()) - tgt.setLifecycle(convertCoding(src.getLifecycle())); - for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertCoding(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); -// if (src.hasDescription()) -// tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasQuery()) - tgt.setQueryElement(convertBase64Binary(src.getQueryElement())); - for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) - tgt.addDetail(convertAuditEventEntityDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent(); - copyElement(src, tgt); - if (src.hasWhat()) - tgt.setWhat(convertReference(src.getWhat())); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - if (src.hasRole()) - tgt.setRole(convertCoding(src.getRole())); - if (src.hasLifecycle()) - tgt.setLifecycle(convertCoding(src.getLifecycle())); - for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertCoding(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); -// if (src.hasDescription()) -// tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasQuery()) - tgt.setQueryElement(convertBase64Binary(src.getQueryElement())); - for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) - tgt.addDetail(convertAuditEventEntityDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r5.model.AuditEvent convertAuditEvent(org.hl7.fhir.r4.model.AuditEvent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent(); + copyDomainResource(src, tgt); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasSubtype()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) tgt.addSubtype(convertCoding(t)); + } + if (src.hasAction()) + tgt.setAction(convertAuditEventAction(src.getAction())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasRecorded()) + tgt.setRecordedElement(convertInstant(src.getRecordedElement())); + if (src.hasOutcome()) + tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); + if (src.hasOutcomeDesc()) + tgt.setOutcomeDescElement(convertString(src.getOutcomeDescElement())); + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + if (src.hasEntity()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.AuditEvent convertAuditEvent(org.hl7.fhir.r5.model.AuditEvent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AuditEvent tgt = new org.hl7.fhir.r4.model.AuditEvent(); + copyDomainResource(src, tgt); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasSubtype()) { + for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.addSubtype(convertCoding(t)); + } + if (src.hasAction()) + tgt.setAction(convertAuditEventAction(src.getAction())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasRecorded()) + tgt.setRecordedElement(convertInstant(src.getRecordedElement())); + if (src.hasOutcome()) + tgt.setOutcome(convertAuditEventOutcome(src.getOutcome())); + if (src.hasOutcomeDesc()) + tgt.setOutcomeDescElement(convertString(src.getOutcomeDescElement())); + if (src.hasPurposeOfEvent()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent()) tgt.addPurposeOfEvent(convertCodeableConcept(t)); + } + if (src.hasAgent()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addAgent(convertAuditEventAgentComponent(t)); + } + if (src.hasSource()) + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + if (src.hasEntity()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addEntity(convertAuditEventEntityComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAction convertAuditEventAction(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case C: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C; + case R: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R; + case U: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U; + case D: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D; + case E: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E; + default: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL; + } + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAction convertAuditEventAction(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case C: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C; + case R: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R; + case U: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U; + case D: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D; + case E: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E; + default: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL; + } + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome convertAuditEventOutcome(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case _0: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._0; + case _4: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._4; + case _8: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._8; + case _12: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._12; + default: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome.NULL; + } + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome convertAuditEventOutcome(org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case _0: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._0; + case _4: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._4; + case _8: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._8; + case _12: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._12; + default: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome.NULL; + } + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRole()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(convertCodeableConcept(t)); + } + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasAltId()) + tgt.setAltIdElement(convertString(src.getAltIdElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasRequestor()) + tgt.setRequestorElement(convertBoolean(src.getRequestorElement())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasPolicy()) { + for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.getPolicy().add(convertUri(t)); + } + if (src.hasMedia()) + tgt.setMedia(convertCoding(src.getMedia())); + if (src.hasNetwork()) + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRole()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) tgt.addRole(convertCodeableConcept(t)); + } + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasAltId()) + tgt.setAltIdElement(convertString(src.getAltIdElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasRequestor()) + tgt.setRequestorElement(convertBoolean(src.getRequestorElement())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasPolicy()) { + for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(convertUri(t)); + } + if (src.hasMedia()) + tgt.setMedia(convertCoding(src.getMedia())); + if (src.hasNetwork()) + tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + if (src.hasPurposeOfUse()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse()) tgt.addPurposeOfUse(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent(); + copyElement(src, tgt); + if (src.hasAddress()) + tgt.setAddressElement(convertString(src.getAddressElement())); + if (src.hasType()) + tgt.setType(convertAuditEventAgentNetworkType(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent(); + copyElement(src, tgt); + if (src.hasAddress()) + tgt.setAddressElement(convertString(src.getAddressElement())); + if (src.hasType()) + tgt.setType(convertAuditEventAgentNetworkType(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType convertAuditEventAgentNetworkType(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case _1: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1; + case _2: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2; + case _3: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3; + case _4: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4; + case _5: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5; + default: + return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL; + } + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case _1: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1; + case _2: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2; + case _3: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3; + case _4: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4; + case _5: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5; + default: + return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL; + } + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent(); + copyElement(src, tgt); + if (src.hasSite()) + tgt.setSiteElement(convertString(src.getSiteElement())); + if (src.hasObserver()) + tgt.setObserver(convertReference(src.getObserver())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType(convertCoding(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent(); + copyElement(src, tgt); + if (src.hasSite()) + tgt.setSiteElement(convertString(src.getSiteElement())); + if (src.hasObserver()) + tgt.setObserver(convertReference(src.getObserver())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(convertCoding(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent(); + copyElement(src, tgt); + if (src.hasWhat()) + tgt.setWhat(convertReference(src.getWhat())); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasRole()) + tgt.setRole(convertCoding(src.getRole())); + if (src.hasLifecycle()) + tgt.setLifecycle(convertCoding(src.getLifecycle())); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(convertCoding(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + // if (src.hasDescription()) + // tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasQuery()) + tgt.setQueryElement(convertBase64Binary(src.getQueryElement())); + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent(); + copyElement(src, tgt); + if (src.hasWhat()) + tgt.setWhat(convertReference(src.getWhat())); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasRole()) + tgt.setRole(convertCoding(src.getRole())); + if (src.hasLifecycle()) + tgt.setLifecycle(convertCoding(src.getLifecycle())); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(convertCoding(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + // if (src.hasDescription()) + // tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasQuery()) + tgt.setQueryElement(convertBase64Binary(src.getQueryElement())); + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Basic.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Basic.java index 5f0dbe763..082551c3f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Basic.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Basic.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,47 +50,44 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Basic extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Basic convertBasic(org.hl7.fhir.r4.model.Basic src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Basic tgt = new org.hl7.fhir.r5.model.Basic(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDate(src.getCreatedElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Basic convertBasic(org.hl7.fhir.r5.model.Basic src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Basic tgt = new org.hl7.fhir.r4.model.Basic(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDate(src.getCreatedElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - return tgt; - } - + public static org.hl7.fhir.r5.model.Basic convertBasic(org.hl7.fhir.r4.model.Basic src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Basic tgt = new org.hl7.fhir.r5.model.Basic(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDate(src.getCreatedElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + return tgt; + } + public static org.hl7.fhir.r4.model.Basic convertBasic(org.hl7.fhir.r5.model.Basic src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Basic tgt = new org.hl7.fhir.r4.model.Basic(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDate(src.getCreatedElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Binary.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Binary.java index 876bf2364..309e5584c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Binary.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Binary.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,39 +50,34 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Binary extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Binary convertBinary(org.hl7.fhir.r4.model.Binary src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Binary tgt = new org.hl7.fhir.r5.model.Binary(); - copyResource(src, tgt); - if (src.hasContentType()) - tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); - if (src.hasSecurityContext()) - tgt.setSecurityContext(convertReference(src.getSecurityContext())); - if (src.hasData()) - tgt.setDataElement(convertBase64Binary(src.getDataElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Binary convertBinary(org.hl7.fhir.r5.model.Binary src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Binary tgt = new org.hl7.fhir.r4.model.Binary(); - copyResource(src, tgt); - if (src.hasContentType()) - tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); - if (src.hasSecurityContext()) - tgt.setSecurityContext(convertReference(src.getSecurityContext())); - if (src.hasData()) - tgt.setDataElement(convertBase64Binary(src.getDataElement())); - return tgt; - } - + public static org.hl7.fhir.r5.model.Binary convertBinary(org.hl7.fhir.r4.model.Binary src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Binary tgt = new org.hl7.fhir.r5.model.Binary(); + copyResource(src, tgt); + if (src.hasContentType()) + tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); + if (src.hasSecurityContext()) + tgt.setSecurityContext(convertReference(src.getSecurityContext())); + if (src.hasData()) + tgt.setDataElement(convertBase64Binary(src.getDataElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.Binary convertBinary(org.hl7.fhir.r5.model.Binary src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Binary tgt = new org.hl7.fhir.r4.model.Binary(); + copyResource(src, tgt); + if (src.hasContentType()) + tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); + if (src.hasSecurityContext()) + tgt.setSecurityContext(convertReference(src.getSecurityContext())); + if (src.hasData()) + tgt.setDataElement(convertBase64Binary(src.getDataElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BiologicallyDerivedProduct.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BiologicallyDerivedProduct.java index 9b4edabc7..d0a81d72c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BiologicallyDerivedProduct.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BiologicallyDerivedProduct.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,255 +50,286 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class BiologicallyDerivedProduct extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r4.model.BiologicallyDerivedProduct src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasProductCategory()) - tgt.setProductCategory(convertBiologicallyDerivedProductCategory(src.getProductCategory())); - if (src.hasProductCode()) - tgt.setProductCode(convertCodeableConcept(src.getProductCode())); - if (src.hasStatus()) - tgt.setStatus(convertBiologicallyDerivedProductStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.Reference t : src.getRequest()) - tgt.addRequest(convertReference(t)); - if (src.hasQuantity()) - tgt.setQuantityElement(convertInteger(src.getQuantityElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getParent()) - tgt.addParent(convertReference(t)); - if (src.hasCollection()) - tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection())); - for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing()) - tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t)); - if (src.hasManipulation()) - tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation())); - for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage()) - tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r5.model.BiologicallyDerivedProduct src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasProductCategory()) - tgt.setProductCategory(convertBiologicallyDerivedProductCategory(src.getProductCategory())); - if (src.hasProductCode()) - tgt.setProductCode(convertCodeableConcept(src.getProductCode())); - if (src.hasStatus()) - tgt.setStatus(convertBiologicallyDerivedProductStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) - tgt.addRequest(convertReference(t)); - if (src.hasQuantity()) - tgt.setQuantityElement(convertInteger(src.getQuantityElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getParent()) - tgt.addParent(convertReference(t)); - if (src.hasCollection()) - tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection())); - for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing()) - tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t)); - if (src.hasManipulation()) - tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation())); - for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage()) - tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory convertBiologicallyDerivedProductCategory(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ORGAN: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN; - case TISSUE: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE; - case FLUID: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID; - case CELLS: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS; - case BIOLOGICALAGENT: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT; - default: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL; - } -} - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory convertBiologicallyDerivedProductCategory(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ORGAN: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN; - case TISSUE: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE; - case FLUID: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID; - case CELLS: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS; - case BIOLOGICALAGENT: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT; - default: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL; - } -} - - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus convertBiologicallyDerivedProductStatus(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AVAILABLE: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE; - case UNAVAILABLE: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE; - default: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus convertBiologicallyDerivedProductStatus(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AVAILABLE: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE; - case UNAVAILABLE: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE; - default: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent(); - copyElement(src, tgt); - if (src.hasCollector()) - tgt.setCollector(convertReference(src.getCollector())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasCollected()) - tgt.setCollected(convertType(src.getCollected())); - return tgt; - } - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent(); - copyElement(src, tgt); - if (src.hasCollector()) - tgt.setCollector(convertReference(src.getCollector())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasCollected()) - tgt.setCollected(convertType(src.getCollected())); - return tgt; - } - - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertCodeableConcept(src.getProcedure())); - if (src.hasAdditive()) - tgt.setAdditive(convertReference(src.getAdditive())); - if (src.hasTime()) - tgt.setTime(convertType(src.getTime())); - return tgt; - } - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertCodeableConcept(src.getProcedure())); - if (src.hasAdditive()) - tgt.setAdditive(convertReference(src.getAdditive())); - if (src.hasTime()) - tgt.setTime(convertType(src.getTime())); - return tgt; - } - - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTime()) - tgt.setTime(convertType(src.getTime())); - return tgt; - } - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTime()) - tgt.setTime(convertType(src.getTime())); - return tgt; - } - - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTemperature()) - tgt.setTemperatureElement(convertDecimal(src.getTemperatureElement())); - if (src.hasScale()) - tgt.setScale(convertBiologicallyDerivedProductStorageScale(src.getScale())); - if (src.hasDuration()) - tgt.setDuration(convertPeriod(src.getDuration())); - return tgt; - } - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTemperature()) - tgt.setTemperatureElement(convertDecimal(src.getTemperatureElement())); - if (src.hasScale()) - tgt.setScale(convertBiologicallyDerivedProductStorageScale(src.getScale())); - if (src.hasDuration()) - tgt.setDuration(convertPeriod(src.getDuration())); - return tgt; - } - - public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FARENHEIT: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT; - case CELSIUS: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS; - case KELVIN: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN; - default: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL; - } -} - - public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FARENHEIT: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT; - case CELSIUS: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS; - case KELVIN: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN; - default: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL; - } -} + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r4.model.BiologicallyDerivedProduct src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasProductCategory()) + tgt.setProductCategory(convertBiologicallyDerivedProductCategory(src.getProductCategory())); + if (src.hasProductCode()) + tgt.setProductCode(convertCodeableConcept(src.getProductCode())); + if (src.hasStatus()) + tgt.setStatus(convertBiologicallyDerivedProductStatus(src.getStatus())); + if (src.hasRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRequest()) tgt.addRequest(convertReference(t)); + } + if (src.hasQuantity()) + tgt.setQuantityElement(convertInteger(src.getQuantityElement())); + if (src.hasParent()) { + for (org.hl7.fhir.r4.model.Reference t : src.getParent()) tgt.addParent(convertReference(t)); + } + if (src.hasCollection()) + tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection())); + if (src.hasProcessing()) { + for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t)); + } + if (src.hasManipulation()) + tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation())); + if (src.hasStorage()) { + for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage()) tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r5.model.BiologicallyDerivedProduct src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasProductCategory()) + tgt.setProductCategory(convertBiologicallyDerivedProductCategory(src.getProductCategory())); + if (src.hasProductCode()) + tgt.setProductCode(convertCodeableConcept(src.getProductCode())); + if (src.hasStatus()) + tgt.setStatus(convertBiologicallyDerivedProductStatus(src.getStatus())); + if (src.hasRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(convertReference(t)); + } + if (src.hasQuantity()) + tgt.setQuantityElement(convertInteger(src.getQuantityElement())); + if (src.hasParent()) { + for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(convertReference(t)); + } + if (src.hasCollection()) + tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection())); + if (src.hasProcessing()) { + for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t)); + } + if (src.hasManipulation()) + tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation())); + if (src.hasStorage()) { + for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage()) tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory convertBiologicallyDerivedProductCategory(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ORGAN: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN; + case TISSUE: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE; + case FLUID: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID; + case CELLS: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS; + case BIOLOGICALAGENT: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT; + default: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL; + } + } + + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory convertBiologicallyDerivedProductCategory(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ORGAN: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN; + case TISSUE: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE; + case FLUID: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID; + case CELLS: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS; + case BIOLOGICALAGENT: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT; + default: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL; + } + } + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus convertBiologicallyDerivedProductStatus(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AVAILABLE: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE; + case UNAVAILABLE: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE; + default: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus convertBiologicallyDerivedProductStatus(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AVAILABLE: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE; + case UNAVAILABLE: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE; + default: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent(); + copyElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(convertReference(src.getCollector())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasCollected()) + tgt.setCollected(convertType(src.getCollected())); + return tgt; + } + + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent(); + copyElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(convertReference(src.getCollector())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasCollected()) + tgt.setCollected(convertType(src.getCollected())); + return tgt; + } + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertCodeableConcept(src.getProcedure())); + if (src.hasAdditive()) + tgt.setAdditive(convertReference(src.getAdditive())); + if (src.hasTime()) + tgt.setTime(convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertCodeableConcept(src.getProcedure())); + if (src.hasAdditive()) + tgt.setAdditive(convertReference(src.getAdditive())); + if (src.hasTime()) + tgt.setTime(convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTime()) + tgt.setTime(convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTime()) + tgt.setTime(convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTemperature()) + tgt.setTemperatureElement(convertDecimal(src.getTemperatureElement())); + if (src.hasScale()) + tgt.setScale(convertBiologicallyDerivedProductStorageScale(src.getScale())); + if (src.hasDuration()) + tgt.setDuration(convertPeriod(src.getDuration())); + return tgt; + } + + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTemperature()) + tgt.setTemperatureElement(convertDecimal(src.getTemperatureElement())); + if (src.hasScale()) + tgt.setScale(convertBiologicallyDerivedProductStorageScale(src.getScale())); + if (src.hasDuration()) + tgt.setDuration(convertPeriod(src.getDuration())); + return tgt; + } + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FARENHEIT: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT; + case CELSIUS: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS; + case KELVIN: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN; + default: + return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL; + } + } + + public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FARENHEIT: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT; + case CELSIUS: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS; + case KELVIN: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN; + default: + return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BodyStructure.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BodyStructure.java index 7b3eb8bbc..32381ccf2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BodyStructure.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/BodyStructure.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,59 +50,60 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class BodyStructure extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.BodyStructure convertBodyStructure(org.hl7.fhir.r4.model.BodyStructure src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.BodyStructure tgt = new org.hl7.fhir.r5.model.BodyStructure(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasMorphology()) - tgt.setMorphology(convertCodeableConcept(src.getMorphology())); - if (src.hasLocation()) - tgt.setLocation(convertCodeableConcept(src.getLocation())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationQualifier()) - tgt.addLocationQualifier(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Attachment t : src.getImage()) - tgt.addImage(convertAttachment(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - return tgt; - } - - public static org.hl7.fhir.r4.model.BodyStructure convertBodyStructure(org.hl7.fhir.r5.model.BodyStructure src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.BodyStructure tgt = new org.hl7.fhir.r4.model.BodyStructure(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasMorphology()) - tgt.setMorphology(convertCodeableConcept(src.getMorphology())); - if (src.hasLocation()) - tgt.setLocation(convertCodeableConcept(src.getLocation())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocationQualifier()) - tgt.addLocationQualifier(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) - tgt.addImage(convertAttachment(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - return tgt; - } - + public static org.hl7.fhir.r5.model.BodyStructure convertBodyStructure(org.hl7.fhir.r4.model.BodyStructure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BodyStructure tgt = new org.hl7.fhir.r5.model.BodyStructure(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasMorphology()) + tgt.setMorphology(convertCodeableConcept(src.getMorphology())); + if (src.hasLocation()) + tgt.setLocation(convertCodeableConcept(src.getLocation())); + if (src.hasLocationQualifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationQualifier()) tgt.addLocationQualifier(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasImage()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getImage()) tgt.addImage(convertAttachment(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + return tgt; + } + public static org.hl7.fhir.r4.model.BodyStructure convertBodyStructure(org.hl7.fhir.r5.model.BodyStructure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.BodyStructure tgt = new org.hl7.fhir.r4.model.BodyStructure(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasMorphology()) + tgt.setMorphology(convertCodeableConcept(src.getMorphology())); + if (src.hasLocation()) + tgt.setLocation(convertCodeableConcept(src.getLocation())); + if (src.hasLocationQualifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocationQualifier()) tgt.addLocationQualifier(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasImage()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) tgt.addImage(convertAttachment(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Bundle.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Bundle.java index da6ad3ecc..eb89d2915 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Bundle.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Bundle.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,303 +50,346 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Bundle extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Bundle convertBundle(org.hl7.fhir.r4.model.Bundle src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle(); - copyResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasType()) - tgt.setType(convertBundleType(src.getType())); - if (src.hasTimestamp()) - tgt.setTimestampElement(convertInstant(src.getTimestampElement())); - if (src.hasTotal()) - tgt.setTotalElement(convertUnsignedInt(src.getTotalElement())); - for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) - tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) - tgt.addEntry(convertBundleEntryComponent(t)); - if (src.hasSignature()) - tgt.setSignature(convertSignature(src.getSignature())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.r5.model.Bundle src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); - copyResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasType()) - tgt.setType(convertBundleType(src.getType())); - if (src.hasTimestamp()) - tgt.setTimestampElement(convertInstant(src.getTimestampElement())); - if (src.hasTotal()) - tgt.setTotalElement(convertUnsignedInt(src.getTotalElement())); - for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) - tgt.addLink(convertBundleLinkComponent(t)); - for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) - tgt.addEntry(convertBundleEntryComponent(t)); - if (src.hasSignature()) - tgt.setSignature(convertSignature(src.getSignature())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Bundle.BundleType convertBundleType(org.hl7.fhir.r4.model.Bundle.BundleType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DOCUMENT: return org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT; - case MESSAGE: return org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE; - case TRANSACTION: return org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION; - case TRANSACTIONRESPONSE: return org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE; - case BATCH: return org.hl7.fhir.r5.model.Bundle.BundleType.BATCH; - case BATCHRESPONSE: return org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE; - case HISTORY: return org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY; - case SEARCHSET: return org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET; - case COLLECTION: return org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION; - default: return org.hl7.fhir.r5.model.Bundle.BundleType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Bundle.BundleType convertBundleType(org.hl7.fhir.r5.model.Bundle.BundleType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DOCUMENT: return org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT; - case MESSAGE: return org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE; - case TRANSACTION: return org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION; - case TRANSACTIONRESPONSE: return org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE; - case BATCH: return org.hl7.fhir.r4.model.Bundle.BundleType.BATCH; - case BATCHRESPONSE: return org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE; - case HISTORY: return org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY; - case SEARCHSET: return org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET; - case COLLECTION: return org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION; - default: return org.hl7.fhir.r4.model.Bundle.BundleType.NULL; - } -} - - public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4.model.Bundle.BundleLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleLinkComponent(); - copyElement(src, tgt); - if (src.hasRelation()) - tgt.setRelationElement(convertString(src.getRelationElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r5.model.Bundle.BundleLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleLinkComponent(); - copyElement(src, tgt); - if (src.hasRelation()) - tgt.setRelationElement(convertString(src.getRelationElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) - tgt.addLink(convertBundleLinkComponent(t)); - if (src.hasFullUrl()) - tgt.setFullUrlElement(convertUri(src.getFullUrlElement())); - if (src.hasResource()) - tgt.setResource(convertResource(src.getResource())); - if (src.hasSearch()) - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - if (src.hasRequest()) - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - if (src.hasResponse()) - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) - tgt.addLink(convertBundleLinkComponent(t)); - if (src.hasFullUrl()) - tgt.setFullUrlElement(convertUri(src.getFullUrlElement())); - if (src.hasResource()) - tgt.setResource(convertResource(src.getResource())); - if (src.hasSearch()) - tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); - if (src.hasRequest()) - tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); - if (src.hasResponse()) - tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertSearchEntryMode(src.getMode())); - if (src.hasScore()) - tgt.setScoreElement(convertDecimal(src.getScoreElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertSearchEntryMode(src.getMode())); - if (src.hasScore()) - tgt.setScoreElement(convertDecimal(src.getScoreElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Bundle.SearchEntryMode convertSearchEntryMode(org.hl7.fhir.r4.model.Bundle.SearchEntryMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MATCH: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH; - case INCLUDE: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE; - case OUTCOME: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME; - default: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.Bundle.SearchEntryMode convertSearchEntryMode(org.hl7.fhir.r5.model.Bundle.SearchEntryMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MATCH: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH; - case INCLUDE: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE; - case OUTCOME: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME; - default: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent(); - copyElement(src, tgt); - if (src.hasMethod()) - tgt.setMethod(convertHTTPVerb(src.getMethod())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasIfNoneMatch()) - tgt.setIfNoneMatchElement(convertString(src.getIfNoneMatchElement())); - if (src.hasIfModifiedSince()) - tgt.setIfModifiedSinceElement(convertInstant(src.getIfModifiedSinceElement())); - if (src.hasIfMatch()) - tgt.setIfMatchElement(convertString(src.getIfMatchElement())); - if (src.hasIfNoneExist()) - tgt.setIfNoneExistElement(convertString(src.getIfNoneExistElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent(); - copyElement(src, tgt); - if (src.hasMethod()) - tgt.setMethod(convertHTTPVerb(src.getMethod())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasIfNoneMatch()) - tgt.setIfNoneMatchElement(convertString(src.getIfNoneMatchElement())); - if (src.hasIfModifiedSince()) - tgt.setIfModifiedSinceElement(convertInstant(src.getIfModifiedSinceElement())); - if (src.hasIfMatch()) - tgt.setIfMatchElement(convertString(src.getIfMatchElement())); - if (src.hasIfNoneExist()) - tgt.setIfNoneExistElement(convertString(src.getIfNoneExistElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Bundle.HTTPVerb convertHTTPVerb(org.hl7.fhir.r4.model.Bundle.HTTPVerb src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case GET: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET; - case HEAD: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.HEAD; - case POST: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST; - case PUT: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT; - case DELETE: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE; - case PATCH: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.PATCH; - default: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL; - } -} - - public static org.hl7.fhir.r4.model.Bundle.HTTPVerb convertHTTPVerb(org.hl7.fhir.r5.model.Bundle.HTTPVerb src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case GET: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET; - case HEAD: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.HEAD; - case POST: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST; - case PUT: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT; - case DELETE: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE; - case PATCH: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.PATCH; - default: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL; - } -} - - public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent(); - copyElement(src, tgt); - if (src.hasStatus()) - tgt.setStatusElement(convertString(src.getStatusElement())); - if (src.hasLocation()) - tgt.setLocationElement(convertUri(src.getLocationElement())); - if (src.hasEtag()) - tgt.setEtagElement(convertString(src.getEtagElement())); - if (src.hasLastModified()) - tgt.setLastModifiedElement(convertInstant(src.getLastModifiedElement())); - if (src.hasOutcome()) - tgt.setOutcome(convertResource(src.getOutcome())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent(); - copyElement(src, tgt); - if (src.hasStatus()) - tgt.setStatusElement(convertString(src.getStatusElement())); - if (src.hasLocation()) - tgt.setLocationElement(convertUri(src.getLocationElement())); - if (src.hasEtag()) - tgt.setEtagElement(convertString(src.getEtagElement())); - if (src.hasLastModified()) - tgt.setLastModifiedElement(convertInstant(src.getLastModifiedElement())); - if (src.hasOutcome()) - tgt.setOutcome(convertResource(src.getOutcome())); - return tgt; - } + public static org.hl7.fhir.r5.model.Bundle convertBundle(org.hl7.fhir.r4.model.Bundle src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle(); + copyResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasType()) + tgt.setType(convertBundleType(src.getType())); + if (src.hasTimestamp()) + tgt.setTimestampElement(convertInstant(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(convertUnsignedInt(src.getTotalElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) + tgt.setSignature(convertSignature(src.getSignature())); + return tgt; + } + public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.r5.model.Bundle src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); + copyResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasType()) + tgt.setType(convertBundleType(src.getType())); + if (src.hasTimestamp()) + tgt.setTimestampElement(convertInstant(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(convertUnsignedInt(src.getTotalElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); + } + if (src.hasSignature()) + tgt.setSignature(convertSignature(src.getSignature())); + return tgt; + } + public static org.hl7.fhir.r5.model.Bundle.BundleType convertBundleType(org.hl7.fhir.r4.model.Bundle.BundleType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DOCUMENT: + return org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT; + case MESSAGE: + return org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE; + case TRANSACTION: + return org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION; + case TRANSACTIONRESPONSE: + return org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE; + case BATCH: + return org.hl7.fhir.r5.model.Bundle.BundleType.BATCH; + case BATCHRESPONSE: + return org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE; + case HISTORY: + return org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY; + case SEARCHSET: + return org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET; + case COLLECTION: + return org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION; + default: + return org.hl7.fhir.r5.model.Bundle.BundleType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Bundle.BundleType convertBundleType(org.hl7.fhir.r5.model.Bundle.BundleType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DOCUMENT: + return org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT; + case MESSAGE: + return org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE; + case TRANSACTION: + return org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION; + case TRANSACTIONRESPONSE: + return org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE; + case BATCH: + return org.hl7.fhir.r4.model.Bundle.BundleType.BATCH; + case BATCHRESPONSE: + return org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE; + case HISTORY: + return org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY; + case SEARCHSET: + return org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET; + case COLLECTION: + return org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION; + default: + return org.hl7.fhir.r4.model.Bundle.BundleType.NULL; + } + } + + public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4.model.Bundle.BundleLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleLinkComponent(); + copyElement(src, tgt); + if (src.hasRelation()) + tgt.setRelationElement(convertString(src.getRelationElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r5.model.Bundle.BundleLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleLinkComponent(); + copyElement(src, tgt); + if (src.hasRelation()) + tgt.setRelationElement(convertString(src.getRelationElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent(); + copyElement(src, tgt); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasFullUrl()) + tgt.setFullUrlElement(convertUri(src.getFullUrlElement())); + if (src.hasResource()) + tgt.setResource(convertResource(src.getResource())); + if (src.hasSearch()) + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + if (src.hasRequest()) + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent(); + copyElement(src, tgt); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + } + if (src.hasFullUrl()) + tgt.setFullUrlElement(convertUri(src.getFullUrlElement())); + if (src.hasResource()) + tgt.setResource(convertResource(src.getResource())); + if (src.hasSearch()) + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + if (src.hasRequest()) + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasScore()) + tgt.setScoreElement(convertDecimal(src.getScoreElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertSearchEntryMode(src.getMode())); + if (src.hasScore()) + tgt.setScoreElement(convertDecimal(src.getScoreElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Bundle.SearchEntryMode convertSearchEntryMode(org.hl7.fhir.r4.model.Bundle.SearchEntryMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MATCH: + return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH; + case INCLUDE: + return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE; + case OUTCOME: + return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME; + default: + return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.Bundle.SearchEntryMode convertSearchEntryMode(org.hl7.fhir.r5.model.Bundle.SearchEntryMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MATCH: + return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH; + case INCLUDE: + return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE; + case OUTCOME: + return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME; + default: + return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent(); + copyElement(src, tgt); + if (src.hasMethod()) + tgt.setMethod(convertHTTPVerb(src.getMethod())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIfNoneMatch()) + tgt.setIfNoneMatchElement(convertString(src.getIfNoneMatchElement())); + if (src.hasIfModifiedSince()) + tgt.setIfModifiedSinceElement(convertInstant(src.getIfModifiedSinceElement())); + if (src.hasIfMatch()) + tgt.setIfMatchElement(convertString(src.getIfMatchElement())); + if (src.hasIfNoneExist()) + tgt.setIfNoneExistElement(convertString(src.getIfNoneExistElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent(); + copyElement(src, tgt); + if (src.hasMethod()) + tgt.setMethod(convertHTTPVerb(src.getMethod())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIfNoneMatch()) + tgt.setIfNoneMatchElement(convertString(src.getIfNoneMatchElement())); + if (src.hasIfModifiedSince()) + tgt.setIfModifiedSinceElement(convertInstant(src.getIfModifiedSinceElement())); + if (src.hasIfMatch()) + tgt.setIfMatchElement(convertString(src.getIfMatchElement())); + if (src.hasIfNoneExist()) + tgt.setIfNoneExistElement(convertString(src.getIfNoneExistElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Bundle.HTTPVerb convertHTTPVerb(org.hl7.fhir.r4.model.Bundle.HTTPVerb src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case GET: + return org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET; + case HEAD: + return org.hl7.fhir.r5.model.Bundle.HTTPVerb.HEAD; + case POST: + return org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST; + case PUT: + return org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT; + case DELETE: + return org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE; + case PATCH: + return org.hl7.fhir.r5.model.Bundle.HTTPVerb.PATCH; + default: + return org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL; + } + } + + public static org.hl7.fhir.r4.model.Bundle.HTTPVerb convertHTTPVerb(org.hl7.fhir.r5.model.Bundle.HTTPVerb src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case GET: + return org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET; + case HEAD: + return org.hl7.fhir.r4.model.Bundle.HTTPVerb.HEAD; + case POST: + return org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST; + case PUT: + return org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT; + case DELETE: + return org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE; + case PATCH: + return org.hl7.fhir.r4.model.Bundle.HTTPVerb.PATCH; + default: + return org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL; + } + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent(); + copyElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(convertString(src.getStatusElement())); + if (src.hasLocation()) + tgt.setLocationElement(convertUri(src.getLocationElement())); + if (src.hasEtag()) + tgt.setEtagElement(convertString(src.getEtagElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(convertInstant(src.getLastModifiedElement())); + if (src.hasOutcome()) + tgt.setOutcome(convertResource(src.getOutcome())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent(); + copyElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(convertString(src.getStatusElement())); + if (src.hasLocation()) + tgt.setLocationElement(convertUri(src.getLocationElement())); + if (src.hasEtag()) + tgt.setEtagElement(convertString(src.getEtagElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(convertInstant(src.getLastModifiedElement())); + if (src.hasOutcome()) + tgt.setOutcome(convertResource(src.getOutcome())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java index 6000b2fd6..6346aae49 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,798 +51,938 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CapabilityStatement extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement tgt = new org.hl7.fhir.r5.model.CapabilityStatement(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasKind()) - tgt.setKind(convertCapabilityStatementKind(src.getKind())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiates()) - tgt.getInstantiates().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getImports()) - tgt.getImports().add(convertCanonical(t)); - if (src.hasSoftware()) - tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); - if (src.hasImplementation()) - tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation())); - if (src.hasFhirVersion()) - tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); - for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) - tgt.getFormat().add(convertCode(t)); - for (org.hl7.fhir.r4.model.CodeType t : src.getPatchFormat()) - tgt.getPatchFormat().add(convertCode(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getImplementationGuide()) - tgt.getImplementationGuide().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) - tgt.addRest(convertCapabilityStatementRestComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) - tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) - tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r5.model.CapabilityStatement src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement tgt = new org.hl7.fhir.r4.model.CapabilityStatement(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasKind()) - tgt.setKind(convertCapabilityStatementKind(src.getKind())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiates()) - tgt.getInstantiates().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getImports()) - tgt.getImports().add(convertCanonical(t)); - if (src.hasSoftware()) - tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); - if (src.hasImplementation()) - tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation())); - if (src.hasFhirVersion()) - tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); - for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) - tgt.getFormat().add(convertCode(t)); - for (org.hl7.fhir.r5.model.CodeType t : src.getPatchFormat()) - tgt.getPatchFormat().add(convertCode(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getImplementationGuide()) - tgt.getImplementationGuide().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) - tgt.addRest(convertCapabilityStatementRestComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) - tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) - tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE; - case CAPABILITY: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY; - case REQUIREMENTS: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS; - default: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE; - case CAPABILITY: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY; - case REQUIREMENTS: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS; - default: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasReleaseDate()) - tgt.setReleaseDateElement(convertDateTime(src.getReleaseDateElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasReleaseDate()) - tgt.setReleaseDateElement(convertDateTime(src.getReleaseDateElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertUrl(src.getUrlElement())); - if (src.hasCustodian()) - tgt.setCustodian(convertReference(src.getCustodian())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertUrl(src.getUrlElement())); - if (src.hasCustodian()) - tgt.setCustodian(convertReference(src.getCustodian())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertRestfulCapabilityMode(src.getMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - if (src.hasSecurity()) - tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) - tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) - tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) - tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) - tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getCompartment()) - tgt.getCompartment().add(convertCanonical(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertRestfulCapabilityMode(src.getMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - if (src.hasSecurity()) - tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) - tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) - tgt.addInteraction(convertSystemInteractionComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) - tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) - tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getCompartment()) - tgt.getCompartment().add(convertCanonical(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode convertRestfulCapabilityMode(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLIENT: return org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.CLIENT; - case SERVER: return org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.SERVER; - default: return org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode convertRestfulCapabilityMode(org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLIENT: return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT; - case SERVER: return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER; - default: return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); - copyElement(src, tgt); - if (src.hasCors()) - tgt.setCorsElement(convertBoolean(src.getCorsElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) - tgt.addService(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); - copyElement(src, tgt); - if (src.hasCors()) - tgt.setCorsElement(convertBoolean(src.getCorsElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) - tgt.addService(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getSupportedProfile()) - tgt.getSupportedProfile().add(convertCanonical(t)); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) - tgt.addInteraction(convertResourceInteractionComponent(t)); - if (src.hasVersioning()) - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - if (src.hasReadHistory()) - tgt.setReadHistoryElement(convertBoolean(src.getReadHistoryElement())); - if (src.hasUpdateCreate()) - tgt.setUpdateCreateElement(convertBoolean(src.getUpdateCreateElement())); - if (src.hasConditionalCreate()) - tgt.setConditionalCreateElement(convertBoolean(src.getConditionalCreateElement())); - if (src.hasConditionalRead()) - tgt.setConditionalRead(convertConditionalReadStatus(src.getConditionalRead())); - if (src.hasConditionalUpdate()) - tgt.setConditionalUpdateElement(convertBoolean(src.getConditionalUpdateElement())); - if (src.hasConditionalDelete()) - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getReferencePolicy()) - copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) - tgt.getSearchInclude().add(convertString(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) - tgt.getSearchRevInclude().add(convertString(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) - tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) - tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); - return tgt; - } - - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getSupportedProfile()) - tgt.getSupportedProfile().add(convertCanonical(t)); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) - tgt.addInteraction(convertResourceInteractionComponent(t)); - if (src.hasVersioning()) - tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); - if (src.hasReadHistory()) - tgt.setReadHistoryElement(convertBoolean(src.getReadHistoryElement())); - if (src.hasUpdateCreate()) - tgt.setUpdateCreateElement(convertBoolean(src.getUpdateCreateElement())); - if (src.hasConditionalCreate()) - tgt.setConditionalCreateElement(convertBoolean(src.getConditionalCreateElement())); - if (src.hasConditionalRead()) - tgt.setConditionalRead(convertConditionalReadStatus(src.getConditionalRead())); - if (src.hasConditionalUpdate()) - tgt.setConditionalUpdateElement(convertBoolean(src.getConditionalUpdateElement())); - if (src.hasConditionalDelete()) - tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getReferencePolicy()) - copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) - tgt.getSearchInclude().add(convertString(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) - tgt.getSearchRevInclude().add(convertString(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) - tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) - tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy convertResourceVersionPolicy(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOVERSION: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION; - case VERSIONED: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED; - case VERSIONEDUPDATE: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE; - default: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy convertResourceVersionPolicy(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOVERSION: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION; - case VERSIONED: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED; - case VERSIONEDUPDATE: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE; - default: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus convertConditionalReadStatus(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTSUPPORTED: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED; - case MODIFIEDSINCE: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE; - case NOTMATCH: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH; - case FULLSUPPORT: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT; - default: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus convertConditionalReadStatus(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTSUPPORTED: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED; - case MODIFIEDSINCE: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE; - case NOTMATCH: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH; - case FULLSUPPORT: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT; - default: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus convertConditionalDeleteStatus(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTSUPPORTED: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED; - case SINGLE: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE; - case MULTIPLE: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE; - default: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus convertConditionalDeleteStatus(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTSUPPORTED: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED; - case SINGLE: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE; - case MULTIPLE: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE; - default: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy convertReferenceHandlingPolicy(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case LITERAL: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL; - case LOGICAL: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL; - case RESOLVES: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES; - case ENFORCED: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED; - case LOCAL: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL; - default: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy convertReferenceHandlingPolicy(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case LITERAL: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL; - case LOGICAL: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL; - case RESOLVES: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES; - case ENFORCED: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED; - case LOCAL: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL; - default: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertTypeRestfulInteraction(src.getCode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction convertTypeRestfulInteraction(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case READ: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ; - case VREAD: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD; - case UPDATE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE; - case PATCH: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH; - case DELETE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE; - case HISTORYINSTANCE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE; - case HISTORYTYPE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE; - case CREATE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE; - case SEARCHTYPE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE; - default: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction convertTypeRestfulInteraction(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case READ: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ; - case VREAD: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD; - case UPDATE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE; - case PATCH: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.PATCH; - case DELETE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE; - case HISTORYINSTANCE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE; - case HISTORYTYPE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE; - case CREATE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE; - case SEARCHTYPE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE; - default: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - if (src.hasType()) - tgt.setType(Enumerations.convertSearchParamType(src.getType())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - if (src.hasType()) - tgt.setType(Enumerations.convertSearchParamType(src.getType())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertSystemRestfulInteraction(src.getCode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction convertSystemRestfulInteraction(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case TRANSACTION: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION; - case BATCH: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH; - case SEARCHSYSTEM: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM; - case HISTORYSYSTEM: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM; - default: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction convertSystemRestfulInteraction(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case TRANSACTION: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION; - case BATCH: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.BATCH; - case SEARCHSYSTEM: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM; - case HISTORYSYSTEM: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM; - default: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) - tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); - if (src.hasReliableCache()) - tgt.setReliableCacheElement(convertUnsignedInt(src.getReliableCacheElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) - tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) - tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); - if (src.hasReliableCache()) - tgt.setReliableCacheElement(convertUnsignedInt(src.getReliableCacheElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) - tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); - copyElement(src, tgt); - if (src.hasProtocol()) - tgt.setProtocol(convertCoding(src.getProtocol())); - if (src.hasAddress()) - tgt.setAddressElement(convertUrl(src.getAddressElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); - copyElement(src, tgt); - if (src.hasProtocol()) - tgt.setProtocol(convertCoding(src.getProtocol())); - if (src.hasAddress()) - tgt.setAddressElement(convertUrl(src.getAddressElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertEventCapabilityMode(src.getMode())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertEventCapabilityMode(src.getMode())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode convertEventCapabilityMode(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SENDER: return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER; - case RECEIVER: return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER; - default: return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode convertEventCapabilityMode(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SENDER: return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER; - case RECEIVER: return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER; - default: return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertDocumentMode(src.getMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertDocumentMode(src.getMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode convertDocumentMode(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRODUCER: return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER; - case CONSUMER: return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER; - default: return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode convertDocumentMode(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRODUCER: return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER; - case CONSUMER: return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER; - default: return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL; - } -} + public static org.hl7.fhir.r5.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement tgt = new org.hl7.fhir.r5.model.CapabilityStatement(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKind(convertCapabilityStatementKind(src.getKind())); + if (src.hasInstantiates()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiates()) tgt.getInstantiates().add(convertCanonical(t)); + } + if (src.hasImports()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getImports()) tgt.getImports().add(convertCanonical(t)); + } + if (src.hasSoftware()) + tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation())); + if (src.hasFhirVersion()) + tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); + if (src.hasFormat()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.getFormat().add(convertCode(t)); + } + if (src.hasPatchFormat()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getPatchFormat()) tgt.getPatchFormat().add(convertCode(t)); + } + if (src.hasImplementationGuide()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getImplementationGuide()) tgt.getImplementationGuide().add(convertCanonical(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r5.model.CapabilityStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement tgt = new org.hl7.fhir.r4.model.CapabilityStatement(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKind(convertCapabilityStatementKind(src.getKind())); + if (src.hasInstantiates()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiates()) tgt.getInstantiates().add(convertCanonical(t)); + } + if (src.hasImports()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getImports()) tgt.getImports().add(convertCanonical(t)); + } + if (src.hasSoftware()) + tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation())); + if (src.hasFhirVersion()) + tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); + if (src.hasFormat()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.getFormat().add(convertCode(t)); + } + if (src.hasPatchFormat()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getPatchFormat()) tgt.getPatchFormat().add(convertCode(t)); + } + if (src.hasImplementationGuide()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getImplementationGuide()) tgt.getImplementationGuide().add(convertCanonical(t)); + } + if (src.hasRest()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) tgt.addRest(convertCapabilityStatementRestComponent(t)); + } + if (src.hasMessaging()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + } + if (src.hasDocument()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE; + case CAPABILITY: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY; + case REQUIREMENTS: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS; + default: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE; + case CAPABILITY: + return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY; + case REQUIREMENTS: + return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasReleaseDate()) + tgt.setReleaseDateElement(convertDateTime(src.getReleaseDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasReleaseDate()) + tgt.setReleaseDateElement(convertDateTime(src.getReleaseDateElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertUrl(src.getUrlElement())); + if (src.hasCustodian()) + tgt.setCustodian(convertReference(src.getCustodian())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertUrl(src.getUrlElement())); + if (src.hasCustodian()) + tgt.setCustodian(convertReference(src.getCustodian())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertRestfulCapabilityMode(src.getMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasSecurity()) + tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getCompartment()) tgt.getCompartment().add(convertCanonical(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertRestfulCapabilityMode(src.getMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasSecurity()) + tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + } + if (src.hasInteraction()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertSystemInteractionComponent(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + } + if (src.hasCompartment()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getCompartment()) tgt.getCompartment().add(convertCanonical(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode convertRestfulCapabilityMode(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLIENT: + return org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.CLIENT; + case SERVER: + return org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.SERVER; + default: + return org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode convertRestfulCapabilityMode(org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLIENT: + return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT; + case SERVER: + return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); + copyElement(src, tgt); + if (src.hasCors()) + tgt.setCorsElement(convertBoolean(src.getCorsElement())); + if (src.hasService()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService()) tgt.addService(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); + copyElement(src, tgt); + if (src.hasCors()) + tgt.setCorsElement(convertBoolean(src.getCorsElement())); + if (src.hasService()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) tgt.addService(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasSupportedProfile()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getSupportedProfile()) tgt.getSupportedProfile().add(convertCanonical(t)); + } + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasInteraction()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + if (src.hasReadHistory()) + tgt.setReadHistoryElement(convertBoolean(src.getReadHistoryElement())); + if (src.hasUpdateCreate()) + tgt.setUpdateCreateElement(convertBoolean(src.getUpdateCreateElement())); + if (src.hasConditionalCreate()) + tgt.setConditionalCreateElement(convertBoolean(src.getConditionalCreateElement())); + if (src.hasConditionalRead()) + tgt.setConditionalRead(convertConditionalReadStatus(src.getConditionalRead())); + if (src.hasConditionalUpdate()) + tgt.setConditionalUpdateElement(convertBoolean(src.getConditionalUpdateElement())); + if (src.hasConditionalDelete()) + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + if (src.hasReferencePolicy()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getReferencePolicy()) copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.getSearchInclude().add(convertString(t)); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.getSearchRevInclude().add(convertString(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasSupportedProfile()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getSupportedProfile()) tgt.getSupportedProfile().add(convertCanonical(t)); + } + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasInteraction()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) tgt.addInteraction(convertResourceInteractionComponent(t)); + } + if (src.hasVersioning()) + tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); + if (src.hasReadHistory()) + tgt.setReadHistoryElement(convertBoolean(src.getReadHistoryElement())); + if (src.hasUpdateCreate()) + tgt.setUpdateCreateElement(convertBoolean(src.getUpdateCreateElement())); + if (src.hasConditionalCreate()) + tgt.setConditionalCreateElement(convertBoolean(src.getConditionalCreateElement())); + if (src.hasConditionalRead()) + tgt.setConditionalRead(convertConditionalReadStatus(src.getConditionalRead())); + if (src.hasConditionalUpdate()) + tgt.setConditionalUpdateElement(convertBoolean(src.getConditionalUpdateElement())); + if (src.hasConditionalDelete()) + tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); + if (src.hasReferencePolicy()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getReferencePolicy()) copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); + } + if (src.hasSearchInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.getSearchInclude().add(convertString(t)); + } + if (src.hasSearchRevInclude()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) tgt.getSearchRevInclude().add(convertString(t)); + } + if (src.hasSearchParam()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + } + if (src.hasOperation()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy convertResourceVersionPolicy(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOVERSION: + return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION; + case VERSIONED: + return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED; + case VERSIONEDUPDATE: + return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy convertResourceVersionPolicy(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOVERSION: + return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION; + case VERSIONED: + return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED; + case VERSIONEDUPDATE: + return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus convertConditionalReadStatus(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTSUPPORTED: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED; + case MODIFIEDSINCE: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE; + case NOTMATCH: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH; + case FULLSUPPORT: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus convertConditionalReadStatus(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTSUPPORTED: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED; + case MODIFIEDSINCE: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE; + case NOTMATCH: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH; + case FULLSUPPORT: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus convertConditionalDeleteStatus(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTSUPPORTED: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED; + case SINGLE: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE; + case MULTIPLE: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus convertConditionalDeleteStatus(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTSUPPORTED: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED; + case SINGLE: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE; + case MULTIPLE: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy convertReferenceHandlingPolicy(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case LITERAL: + return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL; + case LOGICAL: + return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL; + case RESOLVES: + return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES; + case ENFORCED: + return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED; + case LOCAL: + return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy convertReferenceHandlingPolicy(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case LITERAL: + return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL; + case LOGICAL: + return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL; + case RESOLVES: + return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES; + case ENFORCED: + return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED; + case LOCAL: + return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertTypeRestfulInteraction(src.getCode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction convertTypeRestfulInteraction(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case READ: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ; + case VREAD: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD; + case UPDATE: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE; + case PATCH: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH; + case DELETE: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE; + case HISTORYINSTANCE: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE; + case HISTORYTYPE: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE; + case CREATE: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE; + case SEARCHTYPE: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction convertTypeRestfulInteraction(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case READ: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ; + case VREAD: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD; + case UPDATE: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE; + case PATCH: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.PATCH; + case DELETE: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE; + case HISTORYINSTANCE: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE; + case HISTORYTYPE: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE; + case CREATE: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE; + case SEARCHTYPE: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + if (src.hasType()) + tgt.setType(Enumerations.convertSearchParamType(src.getType())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + if (src.hasType()) + tgt.setType(Enumerations.convertSearchParamType(src.getType())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertSystemRestfulInteraction(src.getCode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction convertSystemRestfulInteraction(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case TRANSACTION: + return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION; + case BATCH: + return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH; + case SEARCHSYSTEM: + return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM; + case HISTORYSYSTEM: + return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction convertSystemRestfulInteraction(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case TRANSACTION: + return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION; + case BATCH: + return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.BATCH; + case SEARCHSYSTEM: + return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM; + case HISTORYSYSTEM: + return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent(); + copyElement(src, tgt); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) + tgt.setReliableCacheElement(convertUnsignedInt(src.getReliableCacheElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasSupportedMessage()) { + for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent(); + copyElement(src, tgt); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + } + if (src.hasReliableCache()) + tgt.setReliableCacheElement(convertUnsignedInt(src.getReliableCacheElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasSupportedMessage()) { + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); + copyElement(src, tgt); + if (src.hasProtocol()) + tgt.setProtocol(convertCoding(src.getProtocol())); + if (src.hasAddress()) + tgt.setAddressElement(convertUrl(src.getAddressElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); + copyElement(src, tgt); + if (src.hasProtocol()) + tgt.setProtocol(convertCoding(src.getProtocol())); + if (src.hasAddress()) + tgt.setAddressElement(convertUrl(src.getAddressElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertEventCapabilityMode(src.getMode())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertEventCapabilityMode(src.getMode())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode convertEventCapabilityMode(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SENDER: + return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER; + case RECEIVER: + return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode convertEventCapabilityMode(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SENDER: + return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER; + case RECEIVER: + return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertDocumentMode(src.getMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode convertDocumentMode(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRODUCER: + return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER; + case CONSUMER: + return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER; + default: + return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode convertDocumentMode(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRODUCER: + return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER; + case CONSUMER: + return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER; + default: + return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CarePlan.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CarePlan.java index fc395ae44..6a66cfb9b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CarePlan.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CarePlan.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,364 +51,459 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CarePlan extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.CarePlan convertCarePlan(org.hl7.fhir.r4.model.CarePlan src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CarePlan tgt = new org.hl7.fhir.r5.model.CarePlan(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertCarePlanIntent(src.getIntent())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (org.hl7.fhir.r4.model.Reference t : src.getContributor()) - tgt.addContributor(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getCareTeam()) - tgt.addCareTeam(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) - tgt.addAddresses(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) - tgt.addGoal(convertReference(t)); - for (org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) - tgt.addActivity(convertCarePlanActivityComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CarePlan convertCarePlan(org.hl7.fhir.r5.model.CarePlan src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CarePlan tgt = new org.hl7.fhir.r4.model.CarePlan(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertCarePlanStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertCarePlanIntent(src.getIntent())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (org.hl7.fhir.r5.model.Reference t : src.getContributor()) - tgt.addContributor(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam()) - tgt.addCareTeam(convertReference(t)); - for (CodeableReference t : src.getAddresses()) - if (t.hasReference()) - tgt.addAddresses(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) - tgt.addGoal(convertReference(t)); - for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) - tgt.addActivity(convertCarePlanActivityComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertCarePlanStatus(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.CarePlan.CarePlanStatus convertCarePlanStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.CarePlan.CarePlanIntent convertCarePlanIntent(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN; - case ORDER: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER; - case OPTION: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION; - default: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.CarePlan.CarePlanIntent convertCarePlanIntent(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PLAN; - case ORDER: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.ORDER; - case OPTION: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.OPTION; - default: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCodeableConcept()) - tgt.addOutcome(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference()) - tgt.addOutcome(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getProgress()) - tgt.addProgress(convertAnnotation(t)); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - if (src.hasDetail()) - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent(); - copyElement(src, tgt); - for (CodeableReference t : src.getOutcome()) - if (t.hasConcept()) - tgt.addOutcomeCodeableConcept(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getOutcome()) - if (t.hasReference()) - tgt.addOutcomeReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) - tgt.addProgress(convertAnnotation(t)); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - if (src.hasDetail()) - tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent(); - copyElement(src, tgt); - if (src.hasKind()) - tgt.setKind(convertCarePlanActivityKind(src.getKind())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) - tgt.addGoal(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasScheduled()) - tgt.setScheduled(convertType(src.getScheduled())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - if (src.hasProduct()) - tgt.setProduct(convertType(src.getProduct())); - if (src.hasDailyAmount()) - tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent(); - copyElement(src, tgt); - if (src.hasKind()) - tgt.setKind(convertCarePlanActivityKind(src.getKind())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) - tgt.addGoal(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasScheduled()) - tgt.setScheduled(convertType(src.getScheduled())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - if (src.hasProduct()) - tgt.setProduct(convertType(src.getProduct())); - if (src.hasDailyAmount()) - tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind convertCarePlanActivityKind(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPOINTMENT: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.APPOINTMENT; - case COMMUNICATIONREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST; - case DEVICEREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST; - case MEDICATIONREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST; - case NUTRITIONORDER: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER; - case TASK: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.TASK; - case SERVICEREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST; - case VISIONPRESCRIPTION: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION; - default: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NULL; - } -} - - public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind convertCarePlanActivityKind(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPOINTMENT: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.APPOINTMENT; - case COMMUNICATIONREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST; - case DEVICEREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST; - case MEDICATIONREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST; - case NUTRITIONORDER: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER; - case TASK: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.TASK; - case SERVICEREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST; - case VISIONPRESCRIPTION: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION; - default: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus convertCarePlanActivityStatus(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTSTARTED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NOTSTARTED; - case SCHEDULED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.SCHEDULED; - case INPROGRESS: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.INPROGRESS; - case ONHOLD: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ONHOLD; - case COMPLETED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.COMPLETED; - case CANCELLED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.CANCELLED; - case STOPPED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.STOPPED; - case UNKNOWN: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.UNKNOWN; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus convertCarePlanActivityStatus(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTSTARTED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NOTSTARTED; - case SCHEDULED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.SCHEDULED; - case INPROGRESS: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.INPROGRESS; - case ONHOLD: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ONHOLD; - case COMPLETED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.COMPLETED; - case CANCELLED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.CANCELLED; - case STOPPED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.STOPPED; - case UNKNOWN: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.UNKNOWN; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.CarePlan convertCarePlan(org.hl7.fhir.r4.model.CarePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CarePlan tgt = new org.hl7.fhir.r5.model.CarePlan(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertCarePlanIntent(src.getIntent())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasContributor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getContributor()) tgt.addContributor(convertReference(t)); + } + if (src.hasCareTeam()) { + for (org.hl7.fhir.r4.model.Reference t : src.getCareTeam()) tgt.addCareTeam(convertReference(t)); + } + if (src.hasAddresses()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) tgt.addAddresses(convertReferenceToCodeableReference(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) tgt.addGoal(convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.CarePlan convertCarePlan(org.hl7.fhir.r5.model.CarePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CarePlan tgt = new org.hl7.fhir.r4.model.CarePlan(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCarePlanStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertCarePlanIntent(src.getIntent())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasContributor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getContributor()) tgt.addContributor(convertReference(t)); + } + if (src.hasCareTeam()) { + for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam()) tgt.addCareTeam(convertReference(t)); + } + for (CodeableReference t : src.getAddresses()) if (t.hasReference()) + tgt.addAddresses(convertReference(t.getReference())); + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(convertReference(t)); + } + if (src.hasActivity()) { + for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertCarePlanStatus(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.CarePlan.CarePlanStatus convertCarePlanStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.CarePlan.CarePlanIntent convertCarePlanIntent(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN; + case ORDER: + return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER; + case OPTION: + return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION; + default: + return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.CarePlan.CarePlanIntent convertCarePlanIntent(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PLAN; + case ORDER: + return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.ORDER; + case OPTION: + return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.OPTION; + default: + return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent(); + copyElement(src, tgt); + if (src.hasOutcomeCodeableConcept()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCodeableConcept()) tgt.addOutcome(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasOutcomeReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference()) tgt.addOutcome(convertReferenceToCodeableReference(t)); + } + if (src.hasProgress()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getProgress()) tgt.addProgress(convertAnnotation(t)); + } + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasDetail()) + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent(); + copyElement(src, tgt); + for (CodeableReference t : src.getOutcome()) if (t.hasConcept()) + tgt.addOutcomeCodeableConcept(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getOutcome()) if (t.hasReference()) + tgt.addOutcomeReference(convertReference(t.getReference())); + if (src.hasProgress()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) tgt.addProgress(convertAnnotation(t)); + } + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasDetail()) + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent(); + copyElement(src, tgt); + if (src.hasKind()) + tgt.setKind(convertCarePlanActivityKind(src.getKind())); + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r4.model.Reference t : src.getGoal()) tgt.addGoal(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasScheduled()) + tgt.setScheduled(convertType(src.getScheduled())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasProduct()) + tgt.setProduct(convertType(src.getProduct())); + if (src.hasDailyAmount()) + tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent(); + copyElement(src, tgt); + if (src.hasKind()) + tgt.setKind(convertCarePlanActivityKind(src.getKind())); + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasGoal()) { + for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasScheduled()) + tgt.setScheduled(convertType(src.getScheduled())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasProduct()) + tgt.setProduct(convertType(src.getProduct())); + if (src.hasDailyAmount()) + tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind convertCarePlanActivityKind(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPOINTMENT: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.APPOINTMENT; + case COMMUNICATIONREQUEST: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST; + case DEVICEREQUEST: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST; + case MEDICATIONREQUEST: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST; + case NUTRITIONORDER: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER; + case TASK: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.TASK; + case SERVICEREQUEST: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST; + case VISIONPRESCRIPTION: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION; + default: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NULL; + } + } + + public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind convertCarePlanActivityKind(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPOINTMENT: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.APPOINTMENT; + case COMMUNICATIONREQUEST: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST; + case DEVICEREQUEST: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST; + case MEDICATIONREQUEST: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST; + case NUTRITIONORDER: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER; + case TASK: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.TASK; + case SERVICEREQUEST: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST; + case VISIONPRESCRIPTION: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION; + default: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus convertCarePlanActivityStatus(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTSTARTED: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NOTSTARTED; + case SCHEDULED: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.SCHEDULED; + case INPROGRESS: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.INPROGRESS; + case ONHOLD: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ONHOLD; + case COMPLETED: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.COMPLETED; + case CANCELLED: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.CANCELLED; + case STOPPED: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.STOPPED; + case UNKNOWN: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.UNKNOWN; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus convertCarePlanActivityStatus(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTSTARTED: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NOTSTARTED; + case SCHEDULED: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.SCHEDULED; + case INPROGRESS: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.INPROGRESS; + case ONHOLD: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ONHOLD; + case COMPLETED: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.COMPLETED; + case CANCELLED: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.CANCELLED; + case STOPPED: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.STOPPED; + case UNKNOWN: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.UNKNOWN; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CareTeam.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CareTeam.java index ff7ee5431..f70c860a5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CareTeam.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CareTeam.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,135 +51,155 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CareTeam extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.CareTeam convertCareTeam(org.hl7.fhir.r4.model.CareTeam src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CareTeam tgt = new org.hl7.fhir.r5.model.CareTeam(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertCareTeamStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertCareTeamParticipantComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getManagingOrganization()) - tgt.addManagingOrganization(convertReference(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CareTeam convertCareTeam(org.hl7.fhir.r5.model.CareTeam src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CareTeam tgt = new org.hl7.fhir.r4.model.CareTeam(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertCareTeamStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertCareTeamParticipantComponent(t)); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getManagingOrganization()) - tgt.addManagingOrganization(convertReference(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CareTeam.CareTeamStatus convertCareTeamStatus(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSED: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED; - case ACTIVE: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED; - case INACTIVE: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.CareTeam.CareTeamStatus convertCareTeamStatus(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSED: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.PROPOSED; - case ACTIVE: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.SUSPENDED; - case INACTIVE: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) - tgt.setRole(convertCodeableConcept(t)); - if (src.hasMember()) - tgt.setMember(convertReference(src.getMember())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - if (src.hasPeriod()) - tgt.setCoverage(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent(); - copyElement(src, tgt); - if (src.hasRole()) - tgt.addRole(convertCodeableConcept(src.getRole())); - if (src.hasMember()) - tgt.setMember(convertReference(src.getMember())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - if (src.hasCoveragePeriod()) - tgt.setPeriod(convertPeriod(src.getCoveragePeriod())); - return tgt; - } + public static org.hl7.fhir.r5.model.CareTeam convertCareTeam(org.hl7.fhir.r4.model.CareTeam src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CareTeam tgt = new org.hl7.fhir.r5.model.CareTeam(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCareTeamStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasManagingOrganization()) { + for (org.hl7.fhir.r4.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.CareTeam convertCareTeam(org.hl7.fhir.r5.model.CareTeam src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CareTeam tgt = new org.hl7.fhir.r4.model.CareTeam(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCareTeamStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertCareTeamParticipantComponent(t)); + } + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasManagingOrganization()) { + for (org.hl7.fhir.r5.model.Reference t : src.getManagingOrganization()) tgt.addManagingOrganization(convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.CareTeam.CareTeamStatus convertCareTeamStatus(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSED: + return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED; + case ACTIVE: + return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED; + case INACTIVE: + return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.CareTeam.CareTeamStatus convertCareTeamStatus(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSED: + return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.PROPOSED; + case ACTIVE: + return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.SUSPENDED; + case INACTIVE: + return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent(); + copyElement(src, tgt); + if (src.hasRole()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.setRole(convertCodeableConcept(t)); + } + if (src.hasMember()) + tgt.setMember(convertReference(src.getMember())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + if (src.hasPeriod()) + tgt.setCoverage(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent(); + copyElement(src, tgt); + if (src.hasRole()) + tgt.addRole(convertCodeableConcept(src.getRole())); + if (src.hasMember()) + tgt.setMember(convertReference(src.getMember())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + if (src.hasCoveragePeriod()) + tgt.setPeriod(convertPeriod(src.getCoveragePeriod())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItem.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItem.java index c6271630e..22002064a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItem.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItem.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,185 +50,218 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ChargeItem extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ChargeItem convertChargeItem(org.hl7.fhir.r4.model.ChargeItem src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ChargeItem tgt = new org.hl7.fhir.r5.model.ChargeItem(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getDefinitionUri()) - tgt.getDefinitionUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getDefinitionCanonical()) - tgt.getDefinitionCanonical().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(convertChargeItemStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasContext()) - tgt.setContext(convertReference(src.getContext())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - for (org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertChargeItemPerformerComponent(t)); - if (src.hasPerformingOrganization()) - tgt.setPerformingOrganization(convertReference(src.getPerformingOrganization())); - if (src.hasRequestingOrganization()) - tgt.setRequestingOrganization(convertReference(src.getRequestingOrganization())); - if (src.hasCostCenter()) - tgt.setCostCenter(convertReference(src.getCostCenter())); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodysite()) - tgt.addBodysite(convertCodeableConcept(t)); - if (src.hasFactorOverride()) - tgt.setFactorOverrideElement(convertDecimal(src.getFactorOverrideElement())); - if (src.hasPriceOverride()) - tgt.setPriceOverride(convertMoney(src.getPriceOverride())); - if (src.hasOverrideReason()) - tgt.setOverrideReasonElement(convertString(src.getOverrideReasonElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasEnteredDate()) - tgt.setEnteredDateElement(convertDateTime(src.getEnteredDateElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getService()) - tgt.addService(convertReference(t)); - if (src.hasProduct()) - tgt.setProduct(convertType(src.getProduct())); - for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) - tgt.addAccount(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ChargeItem convertChargeItem(org.hl7.fhir.r5.model.ChargeItem src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ChargeItem tgt = new org.hl7.fhir.r4.model.ChargeItem(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getDefinitionUri()) - tgt.getDefinitionUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getDefinitionCanonical()) - tgt.getDefinitionCanonical().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(convertChargeItemStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasContext()) - tgt.setContext(convertReference(src.getContext())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - for (org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertChargeItemPerformerComponent(t)); - if (src.hasPerformingOrganization()) - tgt.setPerformingOrganization(convertReference(src.getPerformingOrganization())); - if (src.hasRequestingOrganization()) - tgt.setRequestingOrganization(convertReference(src.getRequestingOrganization())); - if (src.hasCostCenter()) - tgt.setCostCenter(convertReference(src.getCostCenter())); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodysite()) - tgt.addBodysite(convertCodeableConcept(t)); - if (src.hasFactorOverride()) - tgt.setFactorOverrideElement(convertDecimal(src.getFactorOverrideElement())); - if (src.hasPriceOverride()) - tgt.setPriceOverride(convertMoney(src.getPriceOverride())); - if (src.hasOverrideReason()) - tgt.setOverrideReasonElement(convertString(src.getOverrideReasonElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasEnteredDate()) - tgt.setEnteredDateElement(convertDateTime(src.getEnteredDateElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getService()) - tgt.addService(convertReference(t)); - if (src.hasProduct()) - tgt.setProduct(convertType(src.getProduct())); - for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) - tgt.addAccount(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus convertChargeItemStatus(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.PLANNED; - case BILLABLE: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLABLE; - case NOTBILLABLE: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NOTBILLABLE; - case ABORTED: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ABORTED; - case BILLED: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus convertChargeItemStatus(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.PLANNED; - case BILLABLE: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLABLE; - case NOTBILLABLE: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NOTBILLABLE; - case ABORTED: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ABORTED; - case BILLED: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } + public static org.hl7.fhir.r5.model.ChargeItem convertChargeItem(org.hl7.fhir.r4.model.ChargeItem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItem tgt = new org.hl7.fhir.r5.model.ChargeItem(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasDefinitionUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getDefinitionUri()) tgt.getDefinitionUri().add(convertUri(t)); + } + if (src.hasDefinitionCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getDefinitionCanonical()) tgt.getDefinitionCanonical().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertChargeItemStatus(src.getStatus())); + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setContext(convertReference(src.getContext())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertChargeItemPerformerComponent(t)); + } + if (src.hasPerformingOrganization()) + tgt.setPerformingOrganization(convertReference(src.getPerformingOrganization())); + if (src.hasRequestingOrganization()) + tgt.setRequestingOrganization(convertReference(src.getRequestingOrganization())); + if (src.hasCostCenter()) + tgt.setCostCenter(convertReference(src.getCostCenter())); + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasBodysite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodysite()) tgt.addBodysite(convertCodeableConcept(t)); + } + if (src.hasFactorOverride()) + tgt.setFactorOverrideElement(convertDecimal(src.getFactorOverrideElement())); + if (src.hasPriceOverride()) + tgt.setPriceOverride(convertMoney(src.getPriceOverride())); + if (src.hasOverrideReason()) + tgt.setOverrideReasonElement(convertString(src.getOverrideReasonElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasEnteredDate()) + tgt.setEnteredDateElement(convertDateTime(src.getEnteredDateElement())); + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasService()) { + for (org.hl7.fhir.r4.model.Reference t : src.getService()) tgt.addService(convertReference(t)); + } + if (src.hasProduct()) + tgt.setProduct(convertType(src.getProduct())); + if (src.hasAccount()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ChargeItem convertChargeItem(org.hl7.fhir.r5.model.ChargeItem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ChargeItem tgt = new org.hl7.fhir.r4.model.ChargeItem(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasDefinitionUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getDefinitionUri()) tgt.getDefinitionUri().add(convertUri(t)); + } + if (src.hasDefinitionCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getDefinitionCanonical()) tgt.getDefinitionCanonical().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertChargeItemStatus(src.getStatus())); + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setContext(convertReference(src.getContext())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertChargeItemPerformerComponent(t)); + } + if (src.hasPerformingOrganization()) + tgt.setPerformingOrganization(convertReference(src.getPerformingOrganization())); + if (src.hasRequestingOrganization()) + tgt.setRequestingOrganization(convertReference(src.getRequestingOrganization())); + if (src.hasCostCenter()) + tgt.setCostCenter(convertReference(src.getCostCenter())); + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasBodysite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodysite()) tgt.addBodysite(convertCodeableConcept(t)); + } + if (src.hasFactorOverride()) + tgt.setFactorOverrideElement(convertDecimal(src.getFactorOverrideElement())); + if (src.hasPriceOverride()) + tgt.setPriceOverride(convertMoney(src.getPriceOverride())); + if (src.hasOverrideReason()) + tgt.setOverrideReasonElement(convertString(src.getOverrideReasonElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasEnteredDate()) + tgt.setEnteredDateElement(convertDateTime(src.getEnteredDateElement())); + if (src.hasReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasService()) { + for (org.hl7.fhir.r5.model.Reference t : src.getService()) tgt.addService(convertReference(t)); + } + if (src.hasProduct()) + tgt.setProduct(convertType(src.getProduct())); + if (src.hasAccount()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus convertChargeItemStatus(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.PLANNED; + case BILLABLE: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLABLE; + case NOTBILLABLE: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NOTBILLABLE; + case ABORTED: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ABORTED; + case BILLED: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus convertChargeItemStatus(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.PLANNED; + case BILLABLE: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLABLE; + case NOTBILLABLE: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NOTBILLABLE; + case ABORTED: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ABORTED; + case BILLED: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItemDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItemDefinition.java index 477c44b16..6d6432b7f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItemDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ChargeItemDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,231 +50,264 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ChargeItemDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r4.model.ChargeItemDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ChargeItemDefinition tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r4.model.UriType t : src.getDerivedFromUri()) - tgt.getDerivedFromUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getPartOf()) - tgt.getPartOf().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getReplaces()) - tgt.getReplaces().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.Reference t : src.getInstance()) - tgt.addInstance(convertReference(t)); - for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) - tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); - for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup()) - tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r4.model.ChargeItemDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDerivedFromUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getDerivedFromUri()) tgt.getDerivedFromUri().add(convertUri(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getPartOf()) tgt.getPartOf().add(convertCanonical(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getReplaces()) tgt.getReplaces().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasInstance()) { + for (org.hl7.fhir.r4.model.Reference t : src.getInstance()) tgt.addInstance(convertReference(t)); + } + if (src.hasApplicability()) { + for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + } + if (src.hasPropertyGroup()) { + for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup()) tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r5.model.ChargeItemDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ChargeItemDefinition tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r5.model.UriType t : src.getDerivedFromUri()) - tgt.getDerivedFromUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getPartOf()) - tgt.getPartOf().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) - tgt.getReplaces().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.Reference t : src.getInstance()) - tgt.addInstance(convertReference(t)); - for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) - tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); - for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup()) - tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r5.model.ChargeItemDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ChargeItemDefinition tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDerivedFromUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getDerivedFromUri()) tgt.getDerivedFromUri().add(convertUri(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getPartOf()) tgt.getPartOf().add(convertCanonical(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) tgt.getReplaces().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasInstance()) { + for (org.hl7.fhir.r5.model.Reference t : src.getInstance()) tgt.addInstance(convertReference(t)); + } + if (src.hasApplicability()) { + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + } + if (src.hasPropertyGroup()) { + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup()) tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasLanguage()) - tgt.setLanguageElement(convertString(src.getLanguageElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasLanguage()) + tgt.setLanguageElement(convertString(src.getLanguageElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasLanguage()) - tgt.setLanguageElement(convertString(src.getLanguageElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasLanguage()) + tgt.setLanguageElement(convertString(src.getLanguageElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) - tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); - for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent()) - tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent(); + copyElement(src, tgt); + if (src.hasApplicability()) { + for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + } + if (src.hasPriceComponent()) { + for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent()) tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) - tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); - for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent()) - tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent(); + copyElement(src, tgt); + if (src.hasApplicability()) { + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + } + if (src.hasPriceComponent()) { + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent()) tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertChargeItemDefinitionPriceComponentType(src.getType())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertChargeItemDefinitionPriceComponentType(src.getType())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BASE: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.BASE; - case SURCHARGE: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.SURCHARGE; - case DEDUCTION: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DEDUCTION; - case DISCOUNT: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DISCOUNT; - case TAX: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.TAX; - case INFORMATIONAL: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL; - default: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.NULL; - } -} - - public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BASE: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.BASE; - case SURCHARGE: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.SURCHARGE; - case DEDUCTION: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DEDUCTION; - case DISCOUNT: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DISCOUNT; - case TAX: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.TAX; - case INFORMATIONAL: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.INFORMATIONAL; - default: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.NULL; - } -} + public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertChargeItemDefinitionPriceComponentType(src.getType())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertChargeItemDefinitionPriceComponentType(src.getType())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BASE: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.BASE; + case SURCHARGE: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.SURCHARGE; + case DEDUCTION: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DEDUCTION; + case DISCOUNT: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DISCOUNT; + case TAX: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.TAX; + case INFORMATIONAL: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL; + default: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.NULL; + } + } + + public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BASE: + return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.BASE; + case SURCHARGE: + return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.SURCHARGE; + case DEDUCTION: + return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DEDUCTION; + case DISCOUNT: + return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DISCOUNT; + case TAX: + return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.TAX; + case INFORMATIONAL: + return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.INFORMATIONAL; + default: + return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Claim.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Claim.java index 885669fa6..8323c297e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Claim.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Claim.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,677 +50,748 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Claim extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Claim convertClaim(org.hl7.fhir.r4.model.Claim src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim tgt = new org.hl7.fhir.r5.model.Claim(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertClaimStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasUse()) - tgt.setUse(convertUse(src.getUse())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasBillablePeriod()) - tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasFundsReserve()) - tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); - for (org.hl7.fhir.r4.model.Claim.RelatedClaimComponent t : src.getRelated()) - tgt.addRelated(convertRelatedClaimComponent(t)); - if (src.hasPrescription()) - tgt.setPrescription(convertReference(src.getPrescription())); - if (src.hasOriginalPrescription()) - tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); - if (src.hasPayee()) - tgt.setPayee(convertPayeeComponent(src.getPayee())); - if (src.hasReferral()) - tgt.setReferral(convertReference(src.getReferral())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - for (org.hl7.fhir.r4.model.Claim.CareTeamComponent t : src.getCareTeam()) - tgt.addCareTeam(convertCareTeamComponent(t)); - for (org.hl7.fhir.r4.model.Claim.SupportingInformationComponent t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertSupportingInformationComponent(t)); - for (org.hl7.fhir.r4.model.Claim.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r4.model.Claim.ProcedureComponent t : src.getProcedure()) - tgt.addProcedure(convertProcedureComponent(t)); - for (org.hl7.fhir.r4.model.Claim.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - if (src.hasAccident()) - tgt.setAccident(convertAccidentComponent(src.getAccident())); - for (org.hl7.fhir.r4.model.Claim.ItemComponent t : src.getItem()) - tgt.addItem(convertItemComponent(t)); - if (src.hasTotal()) - tgt.setTotal(convertMoney(src.getTotal())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim convertClaim(org.hl7.fhir.r5.model.Claim src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim tgt = new org.hl7.fhir.r4.model.Claim(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertClaimStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasUse()) - tgt.setUse(convertUse(src.getUse())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasBillablePeriod()) - tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasFundsReserve()) - tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); - for (org.hl7.fhir.r5.model.Claim.RelatedClaimComponent t : src.getRelated()) - tgt.addRelated(convertRelatedClaimComponent(t)); - if (src.hasPrescription()) - tgt.setPrescription(convertReference(src.getPrescription())); - if (src.hasOriginalPrescription()) - tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); - if (src.hasPayee()) - tgt.setPayee(convertPayeeComponent(src.getPayee())); - if (src.hasReferral()) - tgt.setReferral(convertReference(src.getReferral())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - for (org.hl7.fhir.r5.model.Claim.CareTeamComponent t : src.getCareTeam()) - tgt.addCareTeam(convertCareTeamComponent(t)); - for (org.hl7.fhir.r5.model.Claim.SupportingInformationComponent t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertSupportingInformationComponent(t)); - for (org.hl7.fhir.r5.model.Claim.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r5.model.Claim.ProcedureComponent t : src.getProcedure()) - tgt.addProcedure(convertProcedureComponent(t)); - for (org.hl7.fhir.r5.model.Claim.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - if (src.hasAccident()) - tgt.setAccident(convertAccidentComponent(src.getAccident())); - for (org.hl7.fhir.r5.model.Claim.ItemComponent t : src.getItem()) - tgt.addItem(convertItemComponent(t)); - if (src.hasTotal()) - tgt.setTotal(convertMoney(src.getTotal())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertClaimStatus(org.hl7.fhir.r4.model.Claim.ClaimStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Claim.ClaimStatus convertClaimStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Claim.ClaimStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.Claim.ClaimStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.Claim.ClaimStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Claim.ClaimStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Claim.ClaimStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.Use convertUse(org.hl7.fhir.r4.model.Claim.Use src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLAIM: return org.hl7.fhir.r5.model.Enumerations.Use.CLAIM; - case PREAUTHORIZATION: return org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION; - case PREDETERMINATION: return org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION; - default: return org.hl7.fhir.r5.model.Enumerations.Use.NULL; - } -} - - public static org.hl7.fhir.r4.model.Claim.Use convertUse(org.hl7.fhir.r5.model.Enumerations.Use src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLAIM: return org.hl7.fhir.r4.model.Claim.Use.CLAIM; - case PREAUTHORIZATION: return org.hl7.fhir.r4.model.Claim.Use.PREAUTHORIZATION; - case PREDETERMINATION: return org.hl7.fhir.r4.model.Claim.Use.PREDETERMINATION; - default: return org.hl7.fhir.r4.model.Claim.Use.NULL; - } -} - - public static org.hl7.fhir.r5.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4.model.Claim.RelatedClaimComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r5.model.Claim.RelatedClaimComponent(); - copyElement(src, tgt); - if (src.hasClaim()) - tgt.setClaim(convertReference(src.getClaim())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasReference()) - tgt.setReference(convertIdentifier(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.Claim.RelatedClaimComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r4.model.Claim.RelatedClaimComponent(); - copyElement(src, tgt); - if (src.hasClaim()) - tgt.setClaim(convertReference(src.getClaim())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasReference()) - tgt.setReference(convertIdentifier(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4.model.Claim.PayeeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r5.model.Claim.PayeeComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.Claim.PayeeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r4.model.Claim.PayeeComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4.model.Claim.CareTeamComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r5.model.Claim.CareTeamComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasResponsible()) - tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasQualification()) - tgt.setQualification(convertCodeableConcept(src.getQualification())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.Claim.CareTeamComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r4.model.Claim.CareTeamComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasResponsible()) - tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasQualification()) - tgt.setQualification(convertCodeableConcept(src.getQualification())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.model.Claim.SupportingInformationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.Claim.SupportingInformationComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.Claim.SupportingInformationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.Claim.SupportingInformationComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.Claim.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Claim.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasDiagnosis()) - tgt.setDiagnosis(convertType(src.getDiagnosis())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasOnAdmission()) - tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); - if (src.hasPackageCode()) - tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Claim.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.Claim.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasDiagnosis()) - tgt.setDiagnosis(convertType(src.getDiagnosis())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasOnAdmission()) - tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); - if (src.hasPackageCode()) - tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4.model.Claim.ProcedureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r5.model.Claim.ProcedureComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertType(src.getProcedure())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.Claim.ProcedureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r4.model.Claim.ProcedureComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertType(src.getProcedure())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.Claim.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r5.model.Claim.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasBusinessArrangement()) - tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getPreAuthRef()) - tgt.getPreAuthRef().add(convertString(t)); - if (src.hasClaimResponse()) - tgt.setClaimResponse(convertReference(src.getClaimResponse())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.Claim.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r4.model.Claim.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasBusinessArrangement()) - tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) - tgt.getPreAuthRef().add(convertString(t)); - if (src.hasClaimResponse()) - tgt.setClaimResponse(convertReference(src.getClaimResponse())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4.model.Claim.AccidentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r5.model.Claim.AccidentComponent(); - copyElement(src, tgt); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.Claim.AccidentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r4.model.Claim.AccidentComponent(); - copyElement(src, tgt); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r4.model.Claim.ItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.ItemComponent tgt = new org.hl7.fhir.r5.model.Claim.ItemComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getCareTeamSequence()) - tgt.getCareTeamSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDiagnosisSequence()) - tgt.getDiagnosisSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getProcedureSequence()) - tgt.getProcedureSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getInformationSequence()) - tgt.getInformationSequence().add(convertPositiveInt(t)); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEncounter()) - tgt.addEncounter(convertReference(t)); - for (org.hl7.fhir.r4.model.Claim.DetailComponent t : src.getDetail()) - tgt.addDetail(convertDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.Claim.ItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.ItemComponent tgt = new org.hl7.fhir.r4.model.Claim.ItemComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence()) - tgt.getCareTeamSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence()) - tgt.getDiagnosisSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence()) - tgt.getProcedureSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence()) - tgt.getInformationSequence().add(convertPositiveInt(t)); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) - tgt.addEncounter(convertReference(t)); - for (org.hl7.fhir.r5.model.Claim.DetailComponent t : src.getDetail()) - tgt.addDetail(convertDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r4.model.Claim.DetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.DetailComponent tgt = new org.hl7.fhir.r5.model.Claim.DetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - for (org.hl7.fhir.r4.model.Claim.SubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.Claim.DetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.DetailComponent tgt = new org.hl7.fhir.r4.model.Claim.DetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - for (org.hl7.fhir.r5.model.Claim.SubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4.model.Claim.SubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r5.model.Claim.SubDetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.Claim.SubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r4.model.Claim.SubDetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Claim convertClaim(org.hl7.fhir.r4.model.Claim src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim tgt = new org.hl7.fhir.r5.model.Claim(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertClaimStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUse(convertUse(src.getUse())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); + if (src.hasRelated()) { + for (org.hl7.fhir.r4.model.Claim.RelatedClaimComponent t : src.getRelated()) tgt.addRelated(convertRelatedClaimComponent(t)); + } + if (src.hasPrescription()) + tgt.setPrescription(convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasCareTeam()) { + for (org.hl7.fhir.r4.model.Claim.CareTeamComponent t : src.getCareTeam()) tgt.addCareTeam(convertCareTeamComponent(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.Claim.SupportingInformationComponent t : src.getSupportingInfo()) tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r4.model.Claim.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasProcedure()) { + for (org.hl7.fhir.r4.model.Claim.ProcedureComponent t : src.getProcedure()) tgt.addProcedure(convertProcedureComponent(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.Claim.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Claim.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + } + if (src.hasTotal()) + tgt.setTotal(convertMoney(src.getTotal())); + return tgt; + } + public static org.hl7.fhir.r4.model.Claim convertClaim(org.hl7.fhir.r5.model.Claim src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim tgt = new org.hl7.fhir.r4.model.Claim(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertClaimStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUse(convertUse(src.getUse())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); + if (src.hasRelated()) { + for (org.hl7.fhir.r5.model.Claim.RelatedClaimComponent t : src.getRelated()) tgt.addRelated(convertRelatedClaimComponent(t)); + } + if (src.hasPrescription()) + tgt.setPrescription(convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasCareTeam()) { + for (org.hl7.fhir.r5.model.Claim.CareTeamComponent t : src.getCareTeam()) tgt.addCareTeam(convertCareTeamComponent(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.Claim.SupportingInformationComponent t : src.getSupportingInfo()) tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r5.model.Claim.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasProcedure()) { + for (org.hl7.fhir.r5.model.Claim.ProcedureComponent t : src.getProcedure()) tgt.addProcedure(convertProcedureComponent(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.Claim.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Claim.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + } + if (src.hasTotal()) + tgt.setTotal(convertMoney(src.getTotal())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertClaimStatus(org.hl7.fhir.r4.model.Claim.ClaimStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Claim.ClaimStatus convertClaimStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Claim.ClaimStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.Claim.ClaimStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.Claim.ClaimStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Claim.ClaimStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Claim.ClaimStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.Use convertUse(org.hl7.fhir.r4.model.Claim.Use src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLAIM: + return org.hl7.fhir.r5.model.Enumerations.Use.CLAIM; + case PREAUTHORIZATION: + return org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION; + case PREDETERMINATION: + return org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION; + default: + return org.hl7.fhir.r5.model.Enumerations.Use.NULL; + } + } + + public static org.hl7.fhir.r4.model.Claim.Use convertUse(org.hl7.fhir.r5.model.Enumerations.Use src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLAIM: + return org.hl7.fhir.r4.model.Claim.Use.CLAIM; + case PREAUTHORIZATION: + return org.hl7.fhir.r4.model.Claim.Use.PREAUTHORIZATION; + case PREDETERMINATION: + return org.hl7.fhir.r4.model.Claim.Use.PREDETERMINATION; + default: + return org.hl7.fhir.r4.model.Claim.Use.NULL; + } + } + + public static org.hl7.fhir.r5.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4.model.Claim.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r5.model.Claim.RelatedClaimComponent(); + copyElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.Claim.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r4.model.Claim.RelatedClaimComponent(); + copyElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4.model.Claim.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r5.model.Claim.PayeeComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.Claim.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r4.model.Claim.PayeeComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4.model.Claim.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r5.model.Claim.CareTeamComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.Claim.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r4.model.Claim.CareTeamComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.model.Claim.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.Claim.SupportingInformationComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.Claim.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.Claim.SupportingInformationComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.Claim.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Claim.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(convertType(src.getDiagnosis())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasOnAdmission()) + tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Claim.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.Claim.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(convertType(src.getDiagnosis())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasOnAdmission()) + tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4.model.Claim.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r5.model.Claim.ProcedureComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertType(src.getProcedure())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.Claim.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r4.model.Claim.ProcedureComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertType(src.getProcedure())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.Claim.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r5.model.Claim.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); + if (src.hasPreAuthRef()) { + for (org.hl7.fhir.r4.model.StringType t : src.getPreAuthRef()) tgt.getPreAuthRef().add(convertString(t)); + } + if (src.hasClaimResponse()) + tgt.setClaimResponse(convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.Claim.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r4.model.Claim.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); + if (src.hasPreAuthRef()) { + for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) tgt.getPreAuthRef().add(convertString(t)); + } + if (src.hasClaimResponse()) + tgt.setClaimResponse(convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4.model.Claim.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r5.model.Claim.AccidentComponent(); + copyElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.Claim.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r4.model.Claim.AccidentComponent(); + copyElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r4.model.Claim.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.ItemComponent tgt = new org.hl7.fhir.r5.model.Claim.ItemComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCareTeamSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getCareTeamSequence()) tgt.getCareTeamSequence().add(convertPositiveInt(t)); + } + if (src.hasDiagnosisSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDiagnosisSequence()) tgt.getDiagnosisSequence().add(convertPositiveInt(t)); + } + if (src.hasProcedureSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getProcedureSequence()) tgt.getProcedureSequence().add(convertPositiveInt(t)); + } + if (src.hasInformationSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getInformationSequence()) tgt.getInformationSequence().add(convertPositiveInt(t)); + } + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasEncounter()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEncounter()) tgt.addEncounter(convertReference(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Claim.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.Claim.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.ItemComponent tgt = new org.hl7.fhir.r4.model.Claim.ItemComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCareTeamSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence()) tgt.getCareTeamSequence().add(convertPositiveInt(t)); + } + if (src.hasDiagnosisSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence()) tgt.getDiagnosisSequence().add(convertPositiveInt(t)); + } + if (src.hasProcedureSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence()) tgt.getProcedureSequence().add(convertPositiveInt(t)); + } + if (src.hasInformationSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence()) tgt.getInformationSequence().add(convertPositiveInt(t)); + } + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasEncounter()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) tgt.addEncounter(convertReference(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Claim.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r4.model.Claim.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.DetailComponent tgt = new org.hl7.fhir.r5.model.Claim.DetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r4.model.Claim.SubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.Claim.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.DetailComponent tgt = new org.hl7.fhir.r4.model.Claim.DetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r5.model.Claim.SubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4.model.Claim.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r5.model.Claim.SubDetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.Claim.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r4.model.Claim.SubDetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClaimResponse.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClaimResponse.java index 6f5187c3f..d899eb067 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClaimResponse.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClaimResponse.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,681 +50,772 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ClaimResponse extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r4.model.ClaimResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse tgt = new org.hl7.fhir.r5.model.ClaimResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertClaimResponseStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasUse()) - tgt.setUse(convertUse(src.getUse())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasRequestor()) - tgt.setRequestor(convertReference(src.getRequestor())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasPreAuthRef()) - tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); - if (src.hasPreAuthPeriod()) - tgt.setPreAuthPeriod(convertPeriod(src.getPreAuthPeriod())); - if (src.hasPayeeType()) - tgt.setPayeeType(convertCodeableConcept(src.getPayeeType())); - for (org.hl7.fhir.r4.model.ClaimResponse.ItemComponent t : src.getItem()) - tgt.addItem(convertItemComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent t : src.getAddItem()) - tgt.addAddItem(convertAddedItemComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.TotalComponent t : src.getTotal()) - tgt.addTotal(convertTotalComponent(t)); - if (src.hasPayment()) - tgt.setPayment(convertPaymentComponent(src.getPayment())); - if (src.hasFundsReserve()) - tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); - if (src.hasFormCode()) - tgt.setFormCode(convertCodeableConcept(src.getFormCode())); - if (src.hasForm()) - tgt.setForm(convertAttachment(src.getForm())); - for (org.hl7.fhir.r4.model.ClaimResponse.NoteComponent t : src.getProcessNote()) - tgt.addProcessNote(convertNoteComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getCommunicationRequest()) - tgt.addCommunicationRequest(convertReference(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent t : src.getError()) - tgt.addError(convertErrorComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r5.model.ClaimResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse tgt = new org.hl7.fhir.r4.model.ClaimResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertClaimResponseStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasUse()) - tgt.setUse(convertUse(src.getUse())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasRequestor()) - tgt.setRequestor(convertReference(src.getRequestor())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasPreAuthRef()) - tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); - if (src.hasPreAuthPeriod()) - tgt.setPreAuthPeriod(convertPeriod(src.getPreAuthPeriod())); - if (src.hasPayeeType()) - tgt.setPayeeType(convertCodeableConcept(src.getPayeeType())); - for (org.hl7.fhir.r5.model.ClaimResponse.ItemComponent t : src.getItem()) - tgt.addItem(convertItemComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent t : src.getAddItem()) - tgt.addAddItem(convertAddedItemComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.TotalComponent t : src.getTotal()) - tgt.addTotal(convertTotalComponent(t)); - if (src.hasPayment()) - tgt.setPayment(convertPaymentComponent(src.getPayment())); - if (src.hasFundsReserve()) - tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); - if (src.hasFormCode()) - tgt.setFormCode(convertCodeableConcept(src.getFormCode())); - if (src.hasForm()) - tgt.setForm(convertAttachment(src.getForm())); - for (org.hl7.fhir.r5.model.ClaimResponse.NoteComponent t : src.getProcessNote()) - tgt.addProcessNote(convertNoteComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getCommunicationRequest()) - tgt.addCommunicationRequest(convertReference(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent t : src.getError()) - tgt.addError(convertErrorComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertClaimResponseStatus(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus convertClaimResponseStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.Use convertUse(org.hl7.fhir.r4.model.ClaimResponse.Use src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLAIM: return org.hl7.fhir.r5.model.Enumerations.Use.CLAIM; - case PREAUTHORIZATION: return org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION; - case PREDETERMINATION: return org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION; - default: return org.hl7.fhir.r5.model.Enumerations.Use.NULL; - } -} - - public static org.hl7.fhir.r4.model.ClaimResponse.Use convertUse(org.hl7.fhir.r5.model.Enumerations.Use src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLAIM: return org.hl7.fhir.r4.model.ClaimResponse.Use.CLAIM; - case PREAUTHORIZATION: return org.hl7.fhir.r4.model.ClaimResponse.Use.PREAUTHORIZATION; - case PREDETERMINATION: return org.hl7.fhir.r4.model.ClaimResponse.Use.PREDETERMINATION; - default: return org.hl7.fhir.r4.model.ClaimResponse.Use.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; - case COMPLETE: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; - case ERROR: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; - case PARTIAL: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; - default: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.QUEUED; - case COMPLETE: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.COMPLETE; - case ERROR: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.ERROR; - case PARTIAL: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.PARTIAL; - default: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.NULL; - } -} - - public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4.model.ClaimResponse.ItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemComponent(); - copyElement(src, tgt); - if (src.hasItemSequence()) - tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent t : src.getDetail()) - tgt.addDetail(convertItemDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ItemComponent(); - copyElement(src, tgt); - if (src.hasItemSequence()) - tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent t : src.getDetail()) - tgt.addDetail(convertItemDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasValue()) - tgt.setValueElement(convertDecimal(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasValue()) - tgt.setValueElement(convertDecimal(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent(); - copyElement(src, tgt); - if (src.hasDetailSequence()) - tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent(); - copyElement(src, tgt); - if (src.hasDetailSequence()) - tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent(); - copyElement(src, tgt); - if (src.hasSubDetailSequence()) - tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent(); - copyElement(src, tgt); - if (src.hasSubDetailSequence()) - tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getItemSequence()) - tgt.getItemSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDetailSequence()) - tgt.getDetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSubdetailSequence()) - tgt.getSubdetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getProvider()) - tgt.addProvider(convertReference(t)); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail()) - tgt.addDetail(convertAddedItemDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence()) - tgt.getItemSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence()) - tgt.getDetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubdetailSequence()) - tgt.getSubdetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) - tgt.addProvider(convertReference(t)); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail()) - tgt.addDetail(convertAddedItemDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertAddedItemSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertAddedItemSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r4.model.ClaimResponse.TotalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.TotalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ClaimResponse.TotalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.TotalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAdjustment()) - tgt.setAdjustment(convertMoney(src.getAdjustment())); - if (src.hasAdjustmentReason()) - tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAdjustment()) - tgt.setAdjustment(convertMoney(src.getAdjustment())); - if (src.hasAdjustmentReason()) - tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r4.model.ClaimResponse.NoteComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.NoteComponent(); - copyElement(src, tgt); - if (src.hasNumber()) - tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); - if (src.hasType()) - tgt.setType(Enumerations.convertNoteType(src.getType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ClaimResponse.NoteComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.NoteComponent(); - copyElement(src, tgt); - if (src.hasNumber()) - tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); - if (src.hasType()) - tgt.setType(Enumerations.convertNoteType(src.getType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasBusinessArrangement()) - tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); - if (src.hasClaimResponse()) - tgt.setClaimResponse(convertReference(src.getClaimResponse())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasBusinessArrangement()) - tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); - if (src.hasClaimResponse()) - tgt.setClaimResponse(convertReference(src.getClaimResponse())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent(); - copyElement(src, tgt); - if (src.hasItemSequence()) - tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); - if (src.hasDetailSequence()) - tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); - if (src.hasSubDetailSequence()) - tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent(); - copyElement(src, tgt); - if (src.hasItemSequence()) - tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); - if (src.hasDetailSequence()) - tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); - if (src.hasSubDetailSequence()) - tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - return tgt; - } + public static org.hl7.fhir.r5.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r4.model.ClaimResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse tgt = new org.hl7.fhir.r5.model.ClaimResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertClaimResponseStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUse(convertUse(src.getUse())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasRequestor()) + tgt.setRequestor(convertReference(src.getRequestor())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasPreAuthRef()) + tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); + if (src.hasPreAuthPeriod()) + tgt.setPreAuthPeriod(convertPeriod(src.getPreAuthPeriod())); + if (src.hasPayeeType()) + tgt.setPayeeType(convertCodeableConcept(src.getPayeeType())); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + } + if (src.hasAddItem()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent t : src.getAddItem()) tgt.addAddItem(convertAddedItemComponent(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasTotal()) { + for (org.hl7.fhir.r4.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t)); + } + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); + if (src.hasFormCode()) + tgt.setFormCode(convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(convertAttachment(src.getForm())); + if (src.hasProcessNote()) { + for (org.hl7.fhir.r4.model.ClaimResponse.NoteComponent t : src.getProcessNote()) tgt.addProcessNote(convertNoteComponent(t)); + } + if (src.hasCommunicationRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getCommunicationRequest()) tgt.addCommunicationRequest(convertReference(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasError()) { + for (org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r5.model.ClaimResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse tgt = new org.hl7.fhir.r4.model.ClaimResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertClaimResponseStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUse(convertUse(src.getUse())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasRequestor()) + tgt.setRequestor(convertReference(src.getRequestor())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasPreAuthRef()) + tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); + if (src.hasPreAuthPeriod()) + tgt.setPreAuthPeriod(convertPeriod(src.getPreAuthPeriod())); + if (src.hasPayeeType()) + tgt.setPayeeType(convertCodeableConcept(src.getPayeeType())); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + } + if (src.hasAddItem()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent t : src.getAddItem()) tgt.addAddItem(convertAddedItemComponent(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasTotal()) { + for (org.hl7.fhir.r5.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t)); + } + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); + if (src.hasFormCode()) + tgt.setFormCode(convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(convertAttachment(src.getForm())); + if (src.hasProcessNote()) { + for (org.hl7.fhir.r5.model.ClaimResponse.NoteComponent t : src.getProcessNote()) tgt.addProcessNote(convertNoteComponent(t)); + } + if (src.hasCommunicationRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getCommunicationRequest()) tgt.addCommunicationRequest(convertReference(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasError()) { + for (org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertClaimResponseStatus(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus convertClaimResponseStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.Use convertUse(org.hl7.fhir.r4.model.ClaimResponse.Use src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLAIM: + return org.hl7.fhir.r5.model.Enumerations.Use.CLAIM; + case PREAUTHORIZATION: + return org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION; + case PREDETERMINATION: + return org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION; + default: + return org.hl7.fhir.r5.model.Enumerations.Use.NULL; + } + } + + public static org.hl7.fhir.r4.model.ClaimResponse.Use convertUse(org.hl7.fhir.r5.model.Enumerations.Use src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLAIM: + return org.hl7.fhir.r4.model.ClaimResponse.Use.CLAIM; + case PREAUTHORIZATION: + return org.hl7.fhir.r4.model.ClaimResponse.Use.PREAUTHORIZATION; + case PREDETERMINATION: + return org.hl7.fhir.r4.model.ClaimResponse.Use.PREDETERMINATION; + default: + return org.hl7.fhir.r4.model.ClaimResponse.Use.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; + case COMPLETE: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; + case ERROR: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; + case PARTIAL: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; + default: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.QUEUED; + case COMPLETE: + return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.COMPLETE; + case ERROR: + return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.ERROR; + case PARTIAL: + return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.PARTIAL; + default: + return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.NULL; + } + } + + public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4.model.ClaimResponse.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent t : src.getDetail()) tgt.addDetail(convertItemDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ItemComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent t : src.getDetail()) tgt.addDetail(convertItemDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent(); + copyElement(src, tgt); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent(); + copyElement(src, tgt); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent(); + copyElement(src, tgt); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent(); + copyElement(src, tgt); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getItemSequence()) tgt.getItemSequence().add(convertPositiveInt(t)); + } + if (src.hasDetailSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDetailSequence()) tgt.getDetailSequence().add(convertPositiveInt(t)); + } + if (src.hasSubdetailSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSubdetailSequence()) tgt.getSubdetailSequence().add(convertPositiveInt(t)); + } + if (src.hasProvider()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProvider()) tgt.addProvider(convertReference(t)); + } + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail()) tgt.addDetail(convertAddedItemDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence()) tgt.getItemSequence().add(convertPositiveInt(t)); + } + if (src.hasDetailSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence()) tgt.getDetailSequence().add(convertPositiveInt(t)); + } + if (src.hasSubdetailSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubdetailSequence()) tgt.getSubdetailSequence().add(convertPositiveInt(t)); + } + if (src.hasProvider()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) tgt.addProvider(convertReference(t)); + } + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail()) tgt.addDetail(convertAddedItemDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertAddedItemSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertAddedItemSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r4.model.ClaimResponse.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.TotalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ClaimResponse.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.TotalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r4.model.ClaimResponse.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.NoteComponent(); + copyElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setType(Enumerations.convertNoteType(src.getType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ClaimResponse.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.NoteComponent(); + copyElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setType(Enumerations.convertNoteType(src.getType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement())); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement())); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClinicalImpression.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClinicalImpression.java index 8db80de5c..3c305de6e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClinicalImpression.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ClinicalImpression.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,153 +50,172 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ClinicalImpression extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r4.model.ClinicalImpression src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClinicalImpression tgt = new org.hl7.fhir.r5.model.ClinicalImpression(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); -// if (src.hasCode()) -// tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasAssessor()) - tgt.setPerformer(convertReference(src.getAssessor())); - if (src.hasPrevious()) - tgt.setPrevious(convertReference(src.getPrevious())); - for (org.hl7.fhir.r4.model.Reference t : src.getProblem()) - tgt.addProblem(convertReference(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getProtocol()) - tgt.getProtocol().add(convertUri(t)); - if (src.hasSummary()) - tgt.setSummaryElement(convertString(src.getSummaryElement())); - for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) - tgt.addFinding(convertClinicalImpressionFindingComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPrognosisCodeableConcept()) - tgt.addPrognosisCodeableConcept(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPrognosisReference()) - tgt.addPrognosisReference(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r5.model.ClinicalImpression src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClinicalImpression tgt = new org.hl7.fhir.r4.model.ClinicalImpression(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); -// if (src.hasCode()) -// tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPerformer()) - tgt.setAssessor(convertReference(src.getPerformer())); - if (src.hasPrevious()) - tgt.setPrevious(convertReference(src.getPrevious())); - for (org.hl7.fhir.r5.model.Reference t : src.getProblem()) - tgt.addProblem(convertReference(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getProtocol()) - tgt.getProtocol().add(convertUri(t)); - if (src.hasSummary()) - tgt.setSummaryElement(convertString(src.getSummaryElement())); - for (org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) - tgt.addFinding(convertClinicalImpressionFindingComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPrognosisCodeableConcept()) - tgt.addPrognosisCodeableConcept(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPrognosisReference()) - tgt.addPrognosisReference(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.EventStatus convertClinicalImpressionStatus(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INPROGRESS: return org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus convertClinicalImpressionStatus(org.hl7.fhir.r5.model.Enumerations.EventStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INPROGRESS: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS; - case COMPLETED: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent(); - copyElement(src, tgt); - if (src.hasItemCodeableConcept()) - tgt.setItem(convertCodeableConceptToCodeableReference(src.getItemCodeableConcept())); - if (src.hasItemReference()) - tgt.setItem(convertReferenceToCodeableReference(src.getItemReference())); - if (src.hasBasis()) - tgt.setBasisElement(convertString(src.getBasisElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent(); - copyElement(src, tgt); - if (src.hasItem() && src.getItem().hasConcept()) - tgt.setItemCodeableConcept(convertCodeableConcept(src.getItem().getConcept())); - if (src.hasItem() && src.getItem().hasReference()) - tgt.setItemReference(convertReference(src.getItem().getReference())); - if (src.hasBasis()) - tgt.setBasisElement(convertString(src.getBasisElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r4.model.ClinicalImpression src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClinicalImpression tgt = new org.hl7.fhir.r5.model.ClinicalImpression(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + // if (src.hasCode()) + // tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAssessor()) + tgt.setPerformer(convertReference(src.getAssessor())); + if (src.hasPrevious()) + tgt.setPrevious(convertReference(src.getPrevious())); + if (src.hasProblem()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProblem()) tgt.addProblem(convertReference(t)); + } + if (src.hasProtocol()) { + for (org.hl7.fhir.r4.model.UriType t : src.getProtocol()) tgt.getProtocol().add(convertUri(t)); + } + if (src.hasSummary()) + tgt.setSummaryElement(convertString(src.getSummaryElement())); + if (src.hasFinding()) { + for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } + if (src.hasPrognosisCodeableConcept()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(convertCodeableConcept(t)); + } + if (src.hasPrognosisReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(convertReference(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r5.model.ClinicalImpression src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClinicalImpression tgt = new org.hl7.fhir.r4.model.ClinicalImpression(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + // if (src.hasCode()) + // tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPerformer()) + tgt.setAssessor(convertReference(src.getPerformer())); + if (src.hasPrevious()) + tgt.setPrevious(convertReference(src.getPrevious())); + if (src.hasProblem()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProblem()) tgt.addProblem(convertReference(t)); + } + if (src.hasProtocol()) { + for (org.hl7.fhir.r5.model.UriType t : src.getProtocol()) tgt.getProtocol().add(convertUri(t)); + } + if (src.hasSummary()) + tgt.setSummaryElement(convertString(src.getSummaryElement())); + if (src.hasFinding()) { + for (org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + } + if (src.hasPrognosisCodeableConcept()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPrognosisCodeableConcept()) tgt.addPrognosisCodeableConcept(convertCodeableConcept(t)); + } + if (src.hasPrognosisReference()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPrognosisReference()) tgt.addPrognosisReference(convertReference(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.EventStatus convertClinicalImpressionStatus(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INPROGRESS: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus convertClinicalImpressionStatus(org.hl7.fhir.r5.model.Enumerations.EventStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INPROGRESS: + return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS; + case COMPLETED: + return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent(); + copyElement(src, tgt); + if (src.hasItemCodeableConcept()) + tgt.setItem(convertCodeableConceptToCodeableReference(src.getItemCodeableConcept())); + if (src.hasItemReference()) + tgt.setItem(convertReferenceToCodeableReference(src.getItemReference())); + if (src.hasBasis()) + tgt.setBasisElement(convertString(src.getBasisElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent(); + copyElement(src, tgt); + if (src.hasItem() && src.getItem().hasConcept()) + tgt.setItemCodeableConcept(convertCodeableConcept(src.getItem().getConcept())); + if (src.hasItem() && src.getItem().hasReference()) + tgt.setItemReference(convertReference(src.getItem().getReference())); + if (src.hasBasis()) + tgt.setBasisElement(convertString(src.getBasisElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java index 07d4ad451..74b193e21 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,401 +50,476 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CodeSystem extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4.model.CodeSystem src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CodeSystem tgt = new org.hl7.fhir.r5.model.CodeSystem(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasCaseSensitive()) - tgt.setCaseSensitiveElement(convertBoolean(src.getCaseSensitiveElement())); - if (src.hasValueSet()) - tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); - if (src.hasHierarchyMeaning()) - tgt.setHierarchyMeaning(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaning())); - if (src.hasCompositional()) - tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); - if (src.hasVersionNeeded()) - tgt.setVersionNeededElement(convertBoolean(src.getVersionNeededElement())); - if (src.hasContent()) - tgt.setContent(convertCodeSystemContentMode(src.getContent())); - if (src.hasSupplements()) - tgt.setSupplementsElement(convertCanonical(src.getSupplementsElement())); - if (src.hasCount()) - tgt.setCountElement(convertUnsignedInt(src.getCountElement())); - for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) - tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) - tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) - tgt.addConcept(convertConceptDefinitionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5.model.CodeSystem src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CodeSystem tgt = new org.hl7.fhir.r4.model.CodeSystem(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasCaseSensitive()) - tgt.setCaseSensitiveElement(convertBoolean(src.getCaseSensitiveElement())); - if (src.hasValueSet()) - tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); - if (src.hasHierarchyMeaning()) - tgt.setHierarchyMeaning(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaning())); - if (src.hasCompositional()) - tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); - if (src.hasVersionNeeded()) - tgt.setVersionNeededElement(convertBoolean(src.getVersionNeededElement())); - if (src.hasContent()) - tgt.setContent(convertCodeSystemContentMode(src.getContent())); - if (src.hasSupplements()) - tgt.setSupplementsElement(convertCanonical(src.getSupplementsElement())); - if (src.hasCount()) - tgt.setCountElement(convertUnsignedInt(src.getCountElement())); - for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) - tgt.addFilter(convertCodeSystemFilterComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) - tgt.addProperty(convertPropertyComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) - tgt.addConcept(convertConceptDefinitionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case GROUPEDBY: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY; - case ISA: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA; - case PARTOF: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF; - case CLASSIFIEDWITH: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH; - default: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL; - } -} - - public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case GROUPEDBY: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY; - case ISA: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA; - case PARTOF: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF; - case CLASSIFIEDWITH: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH; - default: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL; - } -} - - public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode convertCodeSystemContentMode(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTPRESENT: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NOTPRESENT; - case EXAMPLE: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.EXAMPLE; - case FRAGMENT: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.FRAGMENT; - case COMPLETE: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.COMPLETE; - case SUPPLEMENT: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT; - default: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode convertCodeSystemContentMode(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTPRESENT: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT; - case EXAMPLE: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE; - case FRAGMENT: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT; - case COMPLETE: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE; - case SUPPLEMENT: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT; - default: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getOperator()) - copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getOperator()) - copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FilterOperator convertFilterOperator(org.hl7.fhir.r4.model.CodeSystem.FilterOperator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQUAL: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL; - case ISA: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA; - case DESCENDENTOF: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF; - case ISNOTA: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA; - case REGEX: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX; - case IN: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN; - case NOTIN: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN; - case GENERALIZES: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES; - case EXISTS: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS; - default: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL; - } -} - - public static org.hl7.fhir.r4.model.CodeSystem.FilterOperator convertFilterOperator(org.hl7.fhir.r5.model.Enumerations.FilterOperator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQUAL: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL; - case ISA: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA; - case DESCENDENTOF: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF; - case ISNOTA: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA; - case REGEX: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX; - case IN: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN; - case NOTIN: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN; - case GENERALIZES: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES; - case EXISTS: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS; - default: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL; - } -} - - public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.PropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.PropertyComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasType()) - tgt.setType(convertPropertyType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.PropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.PropertyComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasType()) - tgt.setType(convertPropertyType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CodeSystem.PropertyType convertPropertyType(org.hl7.fhir.r4.model.CodeSystem.PropertyType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CODE: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE; - case CODING: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING; - case STRING: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING; - case INTEGER: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER; - case BOOLEAN: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN; - case DATETIME: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME; - case DECIMAL: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL; - default: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL; - } -} - - public static org.hl7.fhir.r4.model.CodeSystem.PropertyType convertPropertyType(org.hl7.fhir.r5.model.CodeSystem.PropertyType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CODE: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE; - case CODING: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING; - case STRING: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING; - case INTEGER: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER; - case BOOLEAN: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN; - case DATETIME: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME; - case DECIMAL: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.DECIMAL; - default: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL; - } -} - - public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertString(src.getDefinitionElement())); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) - tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) - tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) - tgt.addConcept(convertConceptDefinitionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertString(src.getDefinitionElement())); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) - tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) - tgt.addProperty(convertConceptPropertyComponent(t)); - for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) - tgt.addConcept(convertConceptDefinitionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguageElement(convertCode(src.getLanguageElement())); - if (src.hasUse()) - tgt.setUse(convertCoding(src.getUse())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguageElement(convertCode(src.getLanguageElement())); - if (src.hasUse()) - tgt.setUse(convertCoding(src.getUse())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4.model.CodeSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem tgt = new org.hl7.fhir.r5.model.CodeSystem(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasCaseSensitive()) + tgt.setCaseSensitiveElement(convertBoolean(src.getCaseSensitiveElement())); + if (src.hasValueSet()) + tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); + if (src.hasHierarchyMeaning()) + tgt.setHierarchyMeaning(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaning())); + if (src.hasCompositional()) + tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); + if (src.hasVersionNeeded()) + tgt.setVersionNeededElement(convertBoolean(src.getVersionNeededElement())); + if (src.hasContent()) + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasSupplements()) + tgt.setSupplementsElement(convertCanonical(src.getSupplementsElement())); + if (src.hasCount()) + tgt.setCountElement(convertUnsignedInt(src.getCountElement())); + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5.model.CodeSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CodeSystem tgt = new org.hl7.fhir.r4.model.CodeSystem(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasCaseSensitive()) + tgt.setCaseSensitiveElement(convertBoolean(src.getCaseSensitiveElement())); + if (src.hasValueSet()) + tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); + if (src.hasHierarchyMeaning()) + tgt.setHierarchyMeaning(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaning())); + if (src.hasCompositional()) + tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); + if (src.hasVersionNeeded()) + tgt.setVersionNeededElement(convertBoolean(src.getVersionNeededElement())); + if (src.hasContent()) + tgt.setContent(convertCodeSystemContentMode(src.getContent())); + if (src.hasSupplements()) + tgt.setSupplementsElement(convertCanonical(src.getSupplementsElement())); + if (src.hasCount()) + tgt.setCountElement(convertUnsignedInt(src.getCountElement())); + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case GROUPEDBY: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY; + case ISA: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA; + case PARTOF: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF; + case CLASSIFIEDWITH: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH; + default: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL; + } + } + + public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case GROUPEDBY: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY; + case ISA: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA; + case PARTOF: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF; + case CLASSIFIEDWITH: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH; + default: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL; + } + } + + public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode convertCodeSystemContentMode(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTPRESENT: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NOTPRESENT; + case EXAMPLE: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.EXAMPLE; + case FRAGMENT: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.FRAGMENT; + case COMPLETE: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.COMPLETE; + case SUPPLEMENT: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT; + default: + return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode convertCodeSystemContentMode(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTPRESENT: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT; + case EXAMPLE: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE; + case FRAGMENT: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT; + case COMPLETE: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE; + case SUPPLEMENT: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT; + default: + return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasOperator()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getOperator()) copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); + } + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasOperator()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getOperator()) copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); + } + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.FilterOperator convertFilterOperator(org.hl7.fhir.r4.model.CodeSystem.FilterOperator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQUAL: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL; + case ISA: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA; + case DESCENDENTOF: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF; + case ISNOTA: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA; + case REGEX: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX; + case IN: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN; + case NOTIN: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN; + case GENERALIZES: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES; + case EXISTS: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS; + default: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL; + } + } + + public static org.hl7.fhir.r4.model.CodeSystem.FilterOperator convertFilterOperator(org.hl7.fhir.r5.model.Enumerations.FilterOperator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQUAL: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL; + case ISA: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA; + case DESCENDENTOF: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF; + case ISNOTA: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA; + case REGEX: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX; + case IN: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN; + case NOTIN: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN; + case GENERALIZES: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES; + case EXISTS: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS; + default: + return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL; + } + } + + public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.PropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.PropertyComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasType()) + tgt.setType(convertPropertyType(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.PropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.PropertyComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasType()) + tgt.setType(convertPropertyType(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeSystem.PropertyType convertPropertyType(org.hl7.fhir.r4.model.CodeSystem.PropertyType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CODE: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE; + case CODING: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING; + case STRING: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING; + case INTEGER: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER; + case BOOLEAN: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN; + case DATETIME: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME; + case DECIMAL: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL; + default: + return org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL; + } + } + + public static org.hl7.fhir.r4.model.CodeSystem.PropertyType convertPropertyType(org.hl7.fhir.r5.model.CodeSystem.PropertyType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CODE: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE; + case CODING: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING; + case STRING: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING; + case INTEGER: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER; + case BOOLEAN: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN; + case DATETIME: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME; + case DECIMAL: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.DECIMAL; + default: + return org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL; + } + } + + public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertString(src.getDefinitionElement())); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertString(src.getDefinitionElement())); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t)); + } + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Communication.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Communication.java index 429438088..2f11cdf62 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Communication.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Communication.java @@ -19,8 +19,6 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r5.model.CodeableConcept; @@ -28,7 +26,6 @@ import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.r5.model.DataType; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -57,213 +54,272 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Communication extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Communication convertCommunication(org.hl7.fhir.r4.model.Communication src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Communication tgt = new org.hl7.fhir.r5.model.Communication(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getInResponseTo()) - tgt.addInResponseTo(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertCommunicationPriority(src.getPriority())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) - tgt.addMedium(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasTopic()) - tgt.setTopic(convertCodeableConcept(src.getTopic())); - for (org.hl7.fhir.r4.model.Reference t : src.getAbout()) - tgt.addAbout(convertReference(t)); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasSent()) - tgt.setSentElement(convertDateTime(src.getSentElement())); - if (src.hasReceived()) - tgt.setReceivedElement(convertDateTime(src.getReceivedElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - if (src.hasSender()) - tgt.setSender(convertReference(src.getSender())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent t : src.getPayload()) - tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Communication convertCommunication(org.hl7.fhir.r5.model.Communication src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Communication tgt = new org.hl7.fhir.r4.model.Communication(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getInResponseTo()) - tgt.addInResponseTo(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertCommunicationStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertCommunicationPriority(src.getPriority())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) - tgt.addMedium(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasTopic()) - tgt.setTopic(convertCodeableConcept(src.getTopic())); - for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) - tgt.addAbout(convertReference(t)); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasSent()) - tgt.setSentElement(convertDateTime(src.getSentElement())); - if (src.hasReceived()) - tgt.setReceivedElement(convertDateTime(src.getReceivedElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - if (src.hasSender()) - tgt.setSender(convertReference(src.getSender())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload()) - tgt.addPayload(convertCommunicationPayloadComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.EventStatus convertCommunicationStatus(org.hl7.fhir.r4.model.Communication.CommunicationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PREPARATION: return org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION; - case INPROGRESS: return org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS; - case NOTDONE: return org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD; - case STOPPED: return org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Communication.CommunicationStatus convertCommunicationStatus(org.hl7.fhir.r5.model.Enumerations.EventStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PREPARATION: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.PREPARATION; - case INPROGRESS: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS; - case NOTDONE: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE; - case ONHOLD: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD; - case STOPPED: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.STOPPED; - case COMPLETED: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertCommunicationPriority(org.hl7.fhir.r4.model.Communication.CommunicationPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.Communication.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.STAT; - default: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent(); - copyElement(src, tgt); - if (src.hasContent()) { - if (src.getContent() instanceof StringType) { - CodeableConcept tgtc = new CodeableConcept(); - copyElement(src.getContent(), tgtc); - tgtc.setText(src.getContentStringType().getValue()); - tgt.setContent(tgtc); - } else { - tgt.setContent(convertType(src.getContent())); - } + public static org.hl7.fhir.r5.model.Communication convertCommunication(org.hl7.fhir.r4.model.Communication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Communication tgt = new org.hl7.fhir.r5.model.Communication(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasInResponseTo()) { + for (org.hl7.fhir.r4.model.Reference t : src.getInResponseTo()) tgt.addInResponseTo(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertCommunicationPriority(src.getPriority())); + if (src.hasMedium()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasTopic()) + tgt.setTopic(convertCodeableConcept(src.getTopic())); + if (src.hasAbout()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAbout()) tgt.addAbout(convertReference(t)); + } + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasSent()) + tgt.setSentElement(convertDateTime(src.getSentElement())); + if (src.hasReceived()) + tgt.setReceivedElement(convertDateTime(src.getReceivedElement())); + if (src.hasRecipient()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + if (src.hasSender()) + tgt.setSender(convertReference(src.getSender())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasPayload()) { + for (org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; } - return tgt; - } - public static org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent(); - copyElement(src, tgt); - if (src.hasContent()) { - if (src.hasContentCodeableConcept()) { - StringType tgts = new StringType(); - copyElement(src.getContent(), tgts); - tgts.setValue(src.getContentCodeableConcept().getText()); - tgt.setContent(tgts); - } else { - tgt.setContent(convertType(src.getContent())); - } + public static org.hl7.fhir.r4.model.Communication convertCommunication(org.hl7.fhir.r5.model.Communication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Communication tgt = new org.hl7.fhir.r4.model.Communication(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasInResponseTo()) { + for (org.hl7.fhir.r5.model.Reference t : src.getInResponseTo()) tgt.addInResponseTo(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCommunicationStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertCommunicationPriority(src.getPriority())); + if (src.hasMedium()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasTopic()) + tgt.setTopic(convertCodeableConcept(src.getTopic())); + if (src.hasAbout()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) tgt.addAbout(convertReference(t)); + } + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasSent()) + tgt.setSentElement(convertDateTime(src.getSentElement())); + if (src.hasReceived()) + tgt.setReceivedElement(convertDateTime(src.getReceivedElement())); + if (src.hasRecipient()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + if (src.hasSender()) + tgt.setSender(convertReference(src.getSender())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasPayload()) { + for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; } - return tgt; - } + public static org.hl7.fhir.r5.model.Enumerations.EventStatus convertCommunicationStatus(org.hl7.fhir.r4.model.Communication.CommunicationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PREPARATION: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION; + case INPROGRESS: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS; + case NOTDONE: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD; + case STOPPED: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL; + } + } + public static org.hl7.fhir.r4.model.Communication.CommunicationStatus convertCommunicationStatus(org.hl7.fhir.r5.model.Enumerations.EventStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PREPARATION: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.PREPARATION; + case INPROGRESS: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS; + case NOTDONE: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE; + case ONHOLD: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD; + case STOPPED: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.STOPPED; + case COMPLETED: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertCommunicationPriority(org.hl7.fhir.r4.model.Communication.CommunicationPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.Communication.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.Communication.CommunicationPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.Communication.CommunicationPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.Communication.CommunicationPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.Communication.CommunicationPriority.STAT; + default: + return org.hl7.fhir.r4.model.Communication.CommunicationPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent(); + copyElement(src, tgt); + if (src.hasContent()) { + if (src.getContent() instanceof StringType) { + CodeableConcept tgtc = new CodeableConcept(); + if (src.hasContent()) { + copyElement(src.getContent(), tgtc); + } + if (src.hasContentStringType()) { + tgtc.setText(src.getContentStringType().getValue()); + } + tgt.setContent(tgtc); + } else { + if (src.hasContent()) { + tgt.setContent(convertType(src.getContent())); + } + } + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent(); + copyElement(src, tgt); + if (src.hasContent()) { + if (src.hasContentCodeableConcept()) { + StringType tgts = new StringType(); + if (src.hasContent()) { + copyElement(src.getContent(), tgts); + } + if (src.hasContentCodeableConcept()) { + tgts.setValue(src.getContentCodeableConcept().getText()); + } + tgt.setContent(tgts); + } else { + if (src.hasContent()) { + tgt.setContent(convertType(src.getContent())); + } + } + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CommunicationRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CommunicationRequest.java index 7303324d2..91591f76d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CommunicationRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CommunicationRequest.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,214 +51,256 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CommunicationRequest extends VersionConvertor_40_50 { - public final static String EXT_PAYLOAD_CONTENT = "http://hl7.org/fhir/4.0/StructureDefinition/extension-CommunicationRequest.payload.content"; - - public static org.hl7.fhir.r5.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r4.model.CommunicationRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CommunicationRequest tgt = new org.hl7.fhir.r5.model.CommunicationRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertCommunicationPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) - tgt.addMedium(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getAbout()) - tgt.addAbout(convertReference(t)); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - for (org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) - tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - if (src.hasSender()) - tgt.addInformationProvider(convertReference(src.getSender())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - public static org.hl7.fhir.r4.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r5.model.CommunicationRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CommunicationRequest tgt = new org.hl7.fhir.r4.model.CommunicationRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertCommunicationPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) - tgt.addMedium(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) - tgt.addAbout(convertReference(t)); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) - tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - if (src.hasInformationProvider()) - tgt.setSender(convertReference(src.getInformationProviderFirstRep())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } + public final static String EXT_PAYLOAD_CONTENT = "http://hl7.org/fhir/4.0/StructureDefinition/extension-CommunicationRequest.payload.content"; - public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertCommunicationRequestStatus(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus convertCommunicationRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertCommunicationPriority(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.STAT; - default: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent(); - copyElement(src, tgt); - if (org.hl7.fhir.r4.utils.ToolingExtensions.hasExtension(src, EXT_PAYLOAD_CONTENT)) { - org.hl7.fhir.r4.model.Extension e = org.hl7.fhir.r4.utils.ToolingExtensions.getExtension(src, EXT_PAYLOAD_CONTENT); - tgt.setContent(convertType(e.getValue())); - org.hl7.fhir.r5.utils.ToolingExtensions.removeExtension(tgt, EXT_PAYLOAD_CONTENT); - } else if (src.hasContent()) { - org.hl7.fhir.r4.model.Type content = src.getContent(); - if (content instanceof org.hl7.fhir.r4.model.StringType) { - org.hl7.fhir.r4.model.StringType string = (org.hl7.fhir.r4.model.StringType)content; - org.hl7.fhir.r5.model.CodeableConcept code = new org.hl7.fhir.r5.model.CodeableConcept(); - code.setTextElement((org.hl7.fhir.r5.model.StringType)convertType(string)); - tgt.setContent(code); - } else - tgt.setContent(convertType(content)); - } - return tgt; - } - - public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent(); - copyElement(src, tgt); - if (src.hasContent()) { - org.hl7.fhir.r5.model.DataType content = src.getContent(); - if (content instanceof org.hl7.fhir.r5.model.CodeableConcept) { - org.hl7.fhir.r5.model.CodeableConcept code = (org.hl7.fhir.r5.model.CodeableConcept)content; - if (code.hasText()) - tgt.setContent(new org.hl7.fhir.r4.model.StringType(code.getText())); - if (code.hasCoding() || code.hasExtension()) { - org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(EXT_PAYLOAD_CONTENT); - e.setValue(convertType(code)); - tgt.addExtension(e); + public static org.hl7.fhir.r5.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r4.model.CommunicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CommunicationRequest tgt = new org.hl7.fhir.r5.model.CommunicationRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); } - } else - tgt.setContent(convertType(content)); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertCommunicationPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasMedium()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium()) tgt.addMedium(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasAbout()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAbout()) tgt.addAbout(convertReference(t)); + } + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasPayload()) { + for (org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasRecipient()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + if (src.hasSender()) + tgt.addInformationProvider(convertReference(src.getSender())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r5.model.CommunicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CommunicationRequest tgt = new org.hl7.fhir.r4.model.CommunicationRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertCommunicationRequestStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertCommunicationPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasMedium()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasAbout()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) tgt.addAbout(convertReference(t)); + } + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasPayload()) { + for (org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + } + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasRecipient()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + if (src.hasInformationProvider()) + tgt.setSender(convertReference(src.getInformationProviderFirstRep())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertCommunicationRequestStatus(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus convertCommunicationRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertCommunicationPriority(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.STAT; + default: + return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent(); + copyElement(src, tgt); + if (org.hl7.fhir.r4.utils.ToolingExtensions.hasExtension(src, EXT_PAYLOAD_CONTENT)) { + org.hl7.fhir.r4.model.Extension e = org.hl7.fhir.r4.utils.ToolingExtensions.getExtension(src, EXT_PAYLOAD_CONTENT); + tgt.setContent(convertType(e.getValue())); + org.hl7.fhir.r5.utils.ToolingExtensions.removeExtension(tgt, EXT_PAYLOAD_CONTENT); + } else if (src.hasContent()) { + org.hl7.fhir.r4.model.Type content = src.getContent(); + if (content instanceof org.hl7.fhir.r4.model.StringType) { + org.hl7.fhir.r4.model.StringType string = (org.hl7.fhir.r4.model.StringType) content; + org.hl7.fhir.r5.model.CodeableConcept code = new org.hl7.fhir.r5.model.CodeableConcept(); + code.setTextElement((org.hl7.fhir.r5.model.StringType) convertType(string)); + tgt.setContent(code); + } else + tgt.setContent(convertType(content)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent(); + copyElement(src, tgt); + if (src.hasContent()) { + org.hl7.fhir.r5.model.DataType content = src.getContent(); + if (content instanceof org.hl7.fhir.r5.model.CodeableConcept) { + org.hl7.fhir.r5.model.CodeableConcept code = (org.hl7.fhir.r5.model.CodeableConcept) content; + if (code.hasText()) + tgt.setContent(new org.hl7.fhir.r4.model.StringType(code.getText())); + if (code.hasCoding() || code.hasExtension()) { + org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(EXT_PAYLOAD_CONTENT); + e.setValue(convertType(code)); + tgt.addExtension(e); + } + } else + tgt.setContent(convertType(content)); + } + return tgt; } - return tgt; - } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CompartmentDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CompartmentDefinition.java index c0a56c017..4589d0cd2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CompartmentDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CompartmentDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,137 +50,152 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CompartmentDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r4.model.CompartmentDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CompartmentDefinition tgt = new org.hl7.fhir.r5.model.CompartmentDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCode()) - tgt.setCode(convertCompartmentType(src.getCode())); - if (src.hasSearch()) - tgt.setSearchElement(convertBoolean(src.getSearchElement())); - for (org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) - tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r5.model.CompartmentDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CompartmentDefinition tgt = new org.hl7.fhir.r4.model.CompartmentDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCode()) - tgt.setCode(convertCompartmentType(src.getCode())); - if (src.hasSearch()) - tgt.setSearchElement(convertBoolean(src.getSearchElement())); - for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) - tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.CompartmentType convertCompartmentType(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT; - case ENCOUNTER: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER; - case RELATEDPERSON: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON; - case PRACTITIONER: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER; - case DEVICE: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE; - default: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL; - } -} - - public static org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType convertCompartmentType(org.hl7.fhir.r5.model.Enumerations.CompartmentType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PATIENT; - case ENCOUNTER: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.ENCOUNTER; - case RELATEDPERSON: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.RELATEDPERSON; - case PRACTITIONER: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PRACTITIONER; - case DEVICE: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.DEVICE; - default: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.NULL; - } -} - - public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getParam()) - tgt.getParam().add(convertString(t)); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getParam()) - tgt.getParam().add(convertString(t)); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r4.model.CompartmentDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CompartmentDefinition tgt = new org.hl7.fhir.r5.model.CompartmentDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCode(convertCompartmentType(src.getCode())); + if (src.hasSearch()) + tgt.setSearchElement(convertBoolean(src.getSearchElement())); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r5.model.CompartmentDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CompartmentDefinition tgt = new org.hl7.fhir.r4.model.CompartmentDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCode(convertCompartmentType(src.getCode())); + if (src.hasSearch()) + tgt.setSearchElement(convertBoolean(src.getSearchElement())); + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.CompartmentType convertCompartmentType(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT; + case ENCOUNTER: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER; + case RELATEDPERSON: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON; + case PRACTITIONER: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER; + case DEVICE: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE; + default: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL; + } + } + + public static org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType convertCompartmentType(org.hl7.fhir.r5.model.Enumerations.CompartmentType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PATIENT; + case ENCOUNTER: + return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.ENCOUNTER; + case RELATEDPERSON: + return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.RELATEDPERSON; + case PRACTITIONER: + return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PRACTITIONER; + case DEVICE: + return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.DEVICE; + default: + return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.NULL; + } + } + + public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); + if (src.hasParam()) { + for (org.hl7.fhir.r4.model.StringType t : src.getParam()) tgt.getParam().add(convertString(t)); + } + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); + if (src.hasParam()) { + for (org.hl7.fhir.r5.model.StringType t : src.getParam()) tgt.getParam().add(convertString(t)); + } + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Composition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Composition.java index 200e0d952..c256d28ab 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Composition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Composition.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,345 +51,414 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Composition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Composition convertComposition(org.hl7.fhir.r4.model.Composition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Composition tgt = new org.hl7.fhir.r5.model.Composition(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertCompositionStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasConfidentiality()) - tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); - for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester()) - tgt.addAttester(convertCompositionAttesterComponent(t)); - if (src.hasCustodian()) - tgt.setCustodian(convertReference(src.getCustodian())); - for (org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) - tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); - for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent()) - tgt.addEvent(convertCompositionEventComponent(t)); - for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) - tgt.addSection(convertSectionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Composition convertComposition(org.hl7.fhir.r5.model.Composition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Composition tgt = new org.hl7.fhir.r4.model.Composition(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertCompositionStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasConfidentiality()) - tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); - for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester()) - tgt.addAttester(convertCompositionAttesterComponent(t)); - if (src.hasCustodian()) - tgt.setCustodian(convertReference(src.getCustodian())); - for (org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) - tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); - for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent()) - tgt.addEvent(convertCompositionEventComponent(t)); - for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) - tgt.addSection(convertSectionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.CompositionStatus convertCompositionStatus(org.hl7.fhir.r4.model.Composition.CompositionStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRELIMINARY: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL; - case AMENDED: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Composition.CompositionStatus convertCompositionStatus(org.hl7.fhir.r5.model.Enumerations.CompositionStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRELIMINARY: return org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL; - case AMENDED: return org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification convertDocumentConfidentiality(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case U: return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.U; - case L: return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.L; - case M: return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.M; - case N: return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.N; - case R: return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.R; - case V: return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.V; - default: return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.NULL; - } -} - - public static org.hl7.fhir.r4.model.Composition.DocumentConfidentiality convertDocumentConfidentiality(org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case U: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.U; - case L: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.L; - case M: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.M; - case N: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.N; - case R: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.R; - case V: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.V; - default: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.NULL; - } -} - - public static org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertCompositionAttestationMode(src.getMode())); - if (src.hasTime()) - tgt.setTimeElement(convertDateTime(src.getTimeElement())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertCompositionAttestationMode(src.getMode())); - if (src.hasTime()) - tgt.setTimeElement(convertDateTime(src.getTimeElement())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Composition.CompositionAttestationMode convertCompositionAttestationMode(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PERSONAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PERSONAL; - case PROFESSIONAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PROFESSIONAL; - case LEGAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.LEGAL; - case OFFICIAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.OFFICIAL; - default: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.Composition.CompositionAttestationMode convertCompositionAttestationMode(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PERSONAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL; - case PROFESSIONAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL; - case LEGAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL; - case OFFICIAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL; - default: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - if (src.hasTarget()) - tgt.setTarget(convertType(src.getTarget())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - if (src.hasTarget()) - tgt.setTarget(convertType(src.getTarget())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REPLACES: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES; - case TRANSFORMS: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS; - case SIGNS: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS; - case APPENDS: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS; - default: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Composition.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REPLACES: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.REPLACES; - case TRANSFORMS: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.TRANSFORMS; - case SIGNS: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.SIGNS; - case APPENDS: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.APPENDS; - default: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.NULL; - } -} - - public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4.model.Composition.CompositionEventComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionEventComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r5.model.Composition.CompositionEventComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionEventComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r4.model.Composition.SectionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Composition.SectionComponent tgt = new org.hl7.fhir.r5.model.Composition.SectionComponent(); - copyElement(src, tgt); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - if (src.hasFocus()) - tgt.setFocus(convertReference(src.getFocus())); - if (src.hasText()) - tgt.setText(convertNarrative(src.getText())); - if (src.hasMode()) - tgt.setMode(convertSectionMode(src.getMode())); - if (src.hasOrderedBy()) - tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r4.model.Reference t : src.getEntry()) - tgt.addEntry(convertReference(t)); - if (src.hasEmptyReason()) - tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) - tgt.addSection(convertSectionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r5.model.Composition.SectionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Composition.SectionComponent tgt = new org.hl7.fhir.r4.model.Composition.SectionComponent(); - copyElement(src, tgt); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - if (src.hasFocus()) - tgt.setFocus(convertReference(src.getFocus())); - if (src.hasText()) - tgt.setText(convertNarrative(src.getText())); - if (src.hasMode()) - tgt.setMode(convertSectionMode(src.getMode())); - if (src.hasOrderedBy()) - tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) - tgt.addEntry(convertReference(t)); - if (src.hasEmptyReason()) - tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); - for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) - tgt.addSection(convertSectionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ListMode convertSectionMode(org.hl7.fhir.r4.model.Composition.SectionMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case WORKING: return org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING; - case SNAPSHOT: return org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT; - case CHANGES: return org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES; - default: return org.hl7.fhir.r5.model.Enumerations.ListMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.Composition.SectionMode convertSectionMode(org.hl7.fhir.r5.model.Enumerations.ListMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case WORKING: return org.hl7.fhir.r4.model.Composition.SectionMode.WORKING; - case SNAPSHOT: return org.hl7.fhir.r4.model.Composition.SectionMode.SNAPSHOT; - case CHANGES: return org.hl7.fhir.r4.model.Composition.SectionMode.CHANGES; - default: return org.hl7.fhir.r4.model.Composition.SectionMode.NULL; - } -} + public static org.hl7.fhir.r5.model.Composition convertComposition(org.hl7.fhir.r4.model.Composition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition tgt = new org.hl7.fhir.r5.model.Composition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertCompositionStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasConfidentiality()) + tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); + if (src.hasAttester()) { + for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) + tgt.setCustodian(convertReference(src.getCustodian())); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasSection()) { + for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Composition convertComposition(org.hl7.fhir.r5.model.Composition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Composition tgt = new org.hl7.fhir.r4.model.Composition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertCompositionStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasConfidentiality()) + tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality())); + if (src.hasAttester()) { + for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t)); + } + if (src.hasCustodian()) + tgt.setCustodian(convertReference(src.getCustodian())); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t)); + } + if (src.hasSection()) { + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.CompositionStatus convertCompositionStatus(org.hl7.fhir.r4.model.Composition.CompositionStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRELIMINARY: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Composition.CompositionStatus convertCompositionStatus(org.hl7.fhir.r5.model.Enumerations.CompositionStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRELIMINARY: + return org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification convertDocumentConfidentiality(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case U: + return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.U; + case L: + return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.L; + case M: + return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.M; + case N: + return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.N; + case R: + return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.R; + case V: + return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.V; + default: + return org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification.NULL; + } + } + + public static org.hl7.fhir.r4.model.Composition.DocumentConfidentiality convertDocumentConfidentiality(org.hl7.fhir.r5.model.Composition.V3ConfidentialityClassification src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case U: + return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.U; + case L: + return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.L; + case M: + return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.M; + case N: + return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.N; + case R: + return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.R; + case V: + return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.V; + default: + return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.NULL; + } + } + + public static org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertCompositionAttestationMode(src.getMode())); + if (src.hasTime()) + tgt.setTimeElement(convertDateTime(src.getTimeElement())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertCompositionAttestationMode(src.getMode())); + if (src.hasTime()) + tgt.setTimeElement(convertDateTime(src.getTimeElement())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Composition.CompositionAttestationMode convertCompositionAttestationMode(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PERSONAL: + return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PERSONAL; + case PROFESSIONAL: + return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PROFESSIONAL; + case LEGAL: + return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.LEGAL; + case OFFICIAL: + return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.OFFICIAL; + default: + return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.Composition.CompositionAttestationMode convertCompositionAttestationMode(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PERSONAL: + return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL; + case PROFESSIONAL: + return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL; + case LEGAL: + return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL; + case OFFICIAL: + return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL; + default: + return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + if (src.hasTarget()) + tgt.setTarget(convertType(src.getTarget())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + if (src.hasTarget()) + tgt.setTarget(convertType(src.getTarget())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REPLACES: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES; + case TRANSFORMS: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS; + case SIGNS: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS; + case APPENDS: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS; + default: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Composition.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REPLACES: + return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.REPLACES; + case TRANSFORMS: + return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.TRANSFORMS; + case SIGNS: + return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.SIGNS; + case APPENDS: + return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.APPENDS; + default: + return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.NULL; + } + } + + public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4.model.Composition.CompositionEventComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionEventComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r5.model.Composition.CompositionEventComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionEventComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r4.model.Composition.SectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition.SectionComponent tgt = new org.hl7.fhir.r5.model.Composition.SectionComponent(); + copyElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasFocus()) + tgt.setFocus(convertReference(src.getFocus())); + if (src.hasText()) + tgt.setText(convertNarrative(src.getText())); + if (src.hasMode()) + tgt.setMode(convertSectionMode(src.getMode())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEntry()) tgt.addEntry(convertReference(t)); + } + if (src.hasEmptyReason()) + tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); + if (src.hasSection()) { + for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r5.model.Composition.SectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Composition.SectionComponent tgt = new org.hl7.fhir.r4.model.Composition.SectionComponent(); + copyElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasFocus()) + tgt.setFocus(convertReference(src.getFocus())); + if (src.hasText()) + tgt.setText(convertNarrative(src.getText())); + if (src.hasMode()) + tgt.setMode(convertSectionMode(src.getMode())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) tgt.addEntry(convertReference(t)); + } + if (src.hasEmptyReason()) + tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); + if (src.hasSection()) { + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ListMode convertSectionMode(org.hl7.fhir.r4.model.Composition.SectionMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case WORKING: + return org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING; + case SNAPSHOT: + return org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT; + case CHANGES: + return org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES; + default: + return org.hl7.fhir.r5.model.Enumerations.ListMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.Composition.SectionMode convertSectionMode(org.hl7.fhir.r5.model.Enumerations.ListMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case WORKING: + return org.hl7.fhir.r4.model.Composition.SectionMode.WORKING; + case SNAPSHOT: + return org.hl7.fhir.r4.model.Composition.SectionMode.SNAPSHOT; + case CHANGES: + return org.hl7.fhir.r4.model.Composition.SectionMode.CHANGES; + default: + return org.hl7.fhir.r4.model.Composition.SectionMode.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap.java index 81d5dc2a7..4b7692a54 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ConceptMap.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,302 +50,318 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ConceptMap extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ConceptMap convertConceptMap(org.hl7.fhir.r4.model.ConceptMap src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ConceptMap tgt = new org.hl7.fhir.r5.model.ConceptMap(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasIdentifier()) - tgt.addIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasSource()) - tgt.setSource(convertType(src.getSource())); - if (src.hasTarget()) - tgt.setTarget(convertType(src.getTarget())); - for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) - tgt.addGroup(convertConceptMapGroupComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ConceptMap convertConceptMap(org.hl7.fhir.r5.model.ConceptMap src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ConceptMap tgt = new org.hl7.fhir.r4.model.ConceptMap(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifierFirstRep())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasSource()) - tgt.setSource(convertType(src.getSource())); - if (src.hasTarget()) - tgt.setTarget(convertType(src.getTarget())); - for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) - tgt.addGroup(convertConceptMapGroupComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent(); - copyElement(src, tgt); - if (src.hasSource()) - tgt.setSourceElement(convertUri(src.getSourceElement())); - if (src.hasSourceVersion()) - tgt.setSourceVersionElement(convertString(src.getSourceVersionElement())); - if (src.hasTarget()) - tgt.setTargetElement(convertUri(src.getTargetElement())); - if (src.hasTargetVersion()) - tgt.setTargetVersionElement(convertString(src.getTargetVersionElement())); - for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : src.getElement()) - tgt.addElement(convertSourceElementComponent(t)); - if (src.hasUnmapped()) - tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent(); - copyElement(src, tgt); - if (src.hasSource()) - tgt.setSourceElement(convertUri(src.getSourceElement())); - if (src.hasSourceVersion()) - tgt.setSourceVersionElement(convertString(src.getSourceVersionElement())); - if (src.hasTarget()) - tgt.setTargetElement(convertUri(src.getTargetElement())); - if (src.hasTargetVersion()) - tgt.setTargetVersionElement(convertString(src.getTargetVersionElement())); - for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : src.getElement()) - tgt.addElement(convertSourceElementComponent(t)); - if (src.hasUnmapped()) - tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) - if (t.getEquivalence() == org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED) { - tgt.setNoMap(true); - } else { - tgt.addTarget(convertTargetElementComponent(t)); - } - return tgt; - } - - public static org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - if (src.hasNoMap() && src.getNoMap() == true) { - tgt.addTarget(new org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent().setEquivalence(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED)); + public static org.hl7.fhir.r5.model.ConceptMap convertConceptMap(org.hl7.fhir.r4.model.ConceptMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap tgt = new org.hl7.fhir.r5.model.ConceptMap(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.addIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasSource()) + tgt.setSource(convertType(src.getSource())); + if (src.hasTarget()) + tgt.setTarget(convertType(src.getTarget())); + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) tgt.addGroup(convertConceptMapGroupComponent(t)); + } + return tgt; } - else { - for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) - tgt.addTarget(convertTargetElementComponent(t)); + + public static org.hl7.fhir.r4.model.ConceptMap convertConceptMap(org.hl7.fhir.r5.model.ConceptMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ConceptMap tgt = new org.hl7.fhir.r4.model.ConceptMap(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasSource()) + tgt.setSource(convertType(src.getSource())); + if (src.hasTarget()) + tgt.setTarget(convertType(src.getTarget())); + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) tgt.addGroup(convertConceptMapGroupComponent(t)); + } + return tgt; } - return tgt; - } - public static org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - if (src.hasEquivalence()) - tgt.setRelationship(Enumerations.convertConceptMapRelationship(src.getEquivalence())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) - tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) - tgt.addProduct(convertOtherElementComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent(); + copyElement(src, tgt); + if (src.hasSource()) + tgt.setSourceElement(convertUri(src.getSourceElement())); + if (src.hasSourceVersion()) + tgt.setSourceVersionElement(convertString(src.getSourceVersionElement())); + if (src.hasTarget()) + tgt.setTargetElement(convertUri(src.getTargetElement())); + if (src.hasTargetVersion()) + tgt.setTargetVersionElement(convertString(src.getTargetVersionElement())); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + } + if (src.hasUnmapped()) + tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); + return tgt; + } - public static org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - if (src.hasRelationship()) - tgt.setEquivalence(Enumerations.convertConceptMapEquivalence(src.getRelationship())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) - tgt.addDependsOn(convertOtherElementComponent(t)); - for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) - tgt.addProduct(convertOtherElementComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent(); + copyElement(src, tgt); + if (src.hasSource()) + tgt.setSourceElement(convertUri(src.getSourceElement())); + if (src.hasSourceVersion()) + tgt.setSourceVersionElement(convertString(src.getSourceVersionElement())); + if (src.hasTarget()) + tgt.setTargetElement(convertUri(src.getTargetElement())); + if (src.hasTargetVersion()) + tgt.setTargetVersionElement(convertString(src.getTargetVersionElement())); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : src.getElement()) tgt.addElement(convertSourceElementComponent(t)); + } + if (src.hasUnmapped()) + tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); + return tgt; + } - public static org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent(); - copyElement(src, tgt); - if (src.hasProperty()) - tgt.setPropertyElement(convertUri(src.getPropertyElement())); - if (src.hasSystem()) - tgt.setSystemElement(convertCanonical(src.getSystemElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget()) if (t.getEquivalence() == org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED) { + tgt.setNoMap(true); + } else { + tgt.addTarget(convertTargetElementComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent(); - copyElement(src, tgt); - if (src.hasProperty()) - tgt.setPropertyElement(convertUri(src.getPropertyElement())); - if (src.hasSystem()) - tgt.setSystemElement(convertCanonical(src.getSystemElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasNoMap() && src.getNoMap() == true) { + tgt.addTarget(new org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent().setEquivalence(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED)); + } else { + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t)); + } + } + return tgt; + } - public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertConceptMapGroupUnmappedMode(src.getMode())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertCanonical(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent(); - copyElement(src, tgt); - if (src.hasMode()) - tgt.setMode(convertConceptMapGroupUnmappedMode(src.getMode())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertCanonical(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROVIDED: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED; - case FIXED: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED; - case OTHERMAP: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP; - default: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROVIDED: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED; - case FIXED: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED; - case OTHERMAP: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP; - default: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL; - } -} + public static org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasEquivalence()) + tgt.setRelationship(Enumerations.convertConceptMapRelationship(src.getEquivalence())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasRelationship()) + tgt.setEquivalence(Enumerations.convertConceptMapEquivalence(src.getRelationship())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); + } + if (src.hasProduct()) { + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent(); + copyElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(convertUri(src.getPropertyElement())); + if (src.hasSystem()) + tgt.setSystemElement(convertCanonical(src.getSystemElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent(); + copyElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(convertUri(src.getPropertyElement())); + if (src.hasSystem()) + tgt.setSystemElement(convertCanonical(src.getSystemElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertConceptMapGroupUnmappedMode(src.getMode())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertCanonical(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent(); + copyElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertConceptMapGroupUnmappedMode(src.getMode())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertCanonical(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROVIDED: + return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED; + case FIXED: + return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED; + case OTHERMAP: + return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP; + default: + return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROVIDED: + return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED; + case FIXED: + return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED; + case OTHERMAP: + return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP; + default: + return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Condition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Condition.java index 274c9c816..37a54b607 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Condition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Condition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,147 +50,160 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Condition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Condition convertCondition(org.hl7.fhir.r4.model.Condition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Condition tgt = new org.hl7.fhir.r5.model.Condition(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasClinicalStatus()) - tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); - if (src.hasVerificationStatus()) - tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasSeverity()) - tgt.setSeverity(convertCodeableConcept(src.getSeverity())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOnset()) - tgt.setOnset(convertType(src.getOnset())); - if (src.hasAbatement()) - tgt.setAbatement(convertType(src.getAbatement())); - if (src.hasRecordedDate()) - tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - if (src.hasAsserter()) - tgt.setAsserter(convertReference(src.getAsserter())); - for (org.hl7.fhir.r4.model.Condition.ConditionStageComponent t : src.getStage()) - tgt.addStage(convertConditionStageComponent(t)); - for (org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) - tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Condition convertCondition(org.hl7.fhir.r4.model.Condition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Condition tgt = new org.hl7.fhir.r5.model.Condition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasSeverity()) + tgt.setSeverity(convertCodeableConcept(src.getSeverity())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasBodySite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(convertType(src.getOnset())); + if (src.hasAbatement()) + tgt.setAbatement(convertType(src.getAbatement())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + if (src.hasAsserter()) + tgt.setAsserter(convertReference(src.getAsserter())); + if (src.hasStage()) { + for (org.hl7.fhir.r4.model.Condition.ConditionStageComponent t : src.getStage()) tgt.addStage(convertConditionStageComponent(t)); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Condition convertCondition(org.hl7.fhir.r5.model.Condition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Condition tgt = new org.hl7.fhir.r4.model.Condition(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasClinicalStatus()) - tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); - if (src.hasVerificationStatus()) - tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasSeverity()) - tgt.setSeverity(convertCodeableConcept(src.getSeverity())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOnset()) - tgt.setOnset(convertType(src.getOnset())); - if (src.hasAbatement()) - tgt.setAbatement(convertType(src.getAbatement())); - if (src.hasRecordedDate()) - tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - if (src.hasAsserter()) - tgt.setAsserter(convertReference(src.getAsserter())); - for (org.hl7.fhir.r5.model.Condition.ConditionStageComponent t : src.getStage()) - tgt.addStage(convertConditionStageComponent(t)); - for (org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) - tgt.addEvidence(convertConditionEvidenceComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Condition convertCondition(org.hl7.fhir.r5.model.Condition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Condition tgt = new org.hl7.fhir.r4.model.Condition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasSeverity()) + tgt.setSeverity(convertCodeableConcept(src.getSeverity())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasBodySite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(convertType(src.getOnset())); + if (src.hasAbatement()) + tgt.setAbatement(convertType(src.getAbatement())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + if (src.hasAsserter()) + tgt.setAsserter(convertReference(src.getAsserter())); + if (src.hasStage()) { + for (org.hl7.fhir.r5.model.Condition.ConditionStageComponent t : src.getStage()) tgt.addStage(convertConditionStageComponent(t)); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r4.model.Condition.ConditionStageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionStageComponent(); - copyElement(src, tgt); - if (src.hasSummary()) - tgt.setSummary(convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.r4.model.Reference t : src.getAssessment()) - tgt.addAssessment(convertReference(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - return tgt; - } + public static org.hl7.fhir.r5.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r4.model.Condition.ConditionStageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionStageComponent(); + copyElement(src, tgt); + if (src.hasSummary()) + tgt.setSummary(convertCodeableConcept(src.getSummary())); + if (src.hasAssessment()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAssessment()) tgt.addAssessment(convertReference(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + return tgt; + } - public static org.hl7.fhir.r4.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r5.model.Condition.ConditionStageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionStageComponent(); - copyElement(src, tgt); - if (src.hasSummary()) - tgt.setSummary(convertCodeableConcept(src.getSummary())); - for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) - tgt.addAssessment(convertReference(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r5.model.Condition.ConditionStageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionStageComponent(); + copyElement(src, tgt); + if (src.hasSummary()) + tgt.setSummary(convertCodeableConcept(src.getSummary())); + if (src.hasAssessment()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) tgt.addAssessment(convertReference(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + return tgt; + } + public static org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Consent.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Consent.java index 0f001c954..00ca7b515 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Consent.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Consent.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,313 +50,364 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Consent extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Consent convertConsent(org.hl7.fhir.r4.model.Consent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Consent tgt = new org.hl7.fhir.r5.model.Consent(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertConsentState(src.getStatus())); - if (src.hasScope()) - tgt.setScope(convertCodeableConcept(src.getScope())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDateTime()) - tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getOrganization()) - tgt.addOrganization(convertReference(t)); - if (src.hasSourceAttachment()) - tgt.addSourceAttachment(convertAttachment(src.getSourceAttachment())); - if (src.hasSourceReference()) - tgt.addSourceReference(convertReference(src.getSourceReference())); - for (org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent t : src.getPolicy()) - tgt.addPolicy(convertConsentPolicyComponent(t)); - if (src.hasPolicyRule()) - tgt.setPolicyRule(convertCodeableConcept(src.getPolicyRule())); - for (org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent t : src.getVerification()) - tgt.addVerification(convertConsentVerificationComponent(t)); - if (src.hasProvision()) - tgt.setProvision(convertprovisionComponent(src.getProvision())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Consent convertConsent(org.hl7.fhir.r5.model.Consent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Consent tgt = new org.hl7.fhir.r4.model.Consent(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertConsentState(src.getStatus())); - if (src.hasScope()) - tgt.setScope(convertCodeableConcept(src.getScope())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDateTime()) - tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getOrganization()) - tgt.addOrganization(convertReference(t)); - if (src.hasSourceAttachment()) - tgt.setSource(convertType(src.getSourceAttachmentFirstRep())); - if (src.hasSourceReference()) - tgt.setSource(convertType(src.getSourceReferenceFirstRep())); - for (org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent t : src.getPolicy()) - tgt.addPolicy(convertConsentPolicyComponent(t)); - if (src.hasPolicyRule()) - tgt.setPolicyRule(convertCodeableConcept(src.getPolicyRule())); - for (org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent t : src.getVerification()) - tgt.addVerification(convertConsentVerificationComponent(t)); - if (src.hasProvision()) - tgt.setProvision(convertprovisionComponent(src.getProvision())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Consent.ConsentState convertConsentState(org.hl7.fhir.r4.model.Consent.ConsentState src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT; - case PROPOSED: return org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Consent.ConsentState.ACTIVE; - case REJECTED: return org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE; - case INACTIVE: return org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Consent.ConsentState.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Consent.ConsentState.NULL; - } -} - - public static org.hl7.fhir.r4.model.Consent.ConsentState convertConsentState(org.hl7.fhir.r5.model.Consent.ConsentState src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.Consent.ConsentState.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.Consent.ConsentState.ACTIVE; - case INACTIVE: return org.hl7.fhir.r4.model.Consent.ConsentState.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Consent.ConsentState.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Consent.ConsentState.NULL; - } -} - - public static org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent(); - copyElement(src, tgt); - if (src.hasAuthority()) - tgt.setAuthorityElement(convertUri(src.getAuthorityElement())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent(); - copyElement(src, tgt); - if (src.hasAuthority()) - tgt.setAuthorityElement(convertUri(src.getAuthorityElement())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent(); - copyElement(src, tgt); - if (src.hasVerified()) - tgt.setVerifiedElement(convertBoolean(src.getVerifiedElement())); - if (src.hasVerifiedWith()) - tgt.setVerifiedWith(convertReference(src.getVerifiedWith())); - if (src.hasVerificationDate()) - tgt.getVerificationDate().add(convertDateTime(src.getVerificationDateElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent(); - copyElement(src, tgt); - if (src.hasVerified()) - tgt.setVerifiedElement(convertBoolean(src.getVerifiedElement())); - if (src.hasVerifiedWith()) - tgt.setVerifiedWith(convertReference(src.getVerifiedWith())); - if (src.hasVerificationDate()) - tgt.setVerificationDateElement(convertDateTime(src.getVerificationDate().get(0))); - return tgt; - } - - public static org.hl7.fhir.r5.model.Consent.ProvisionComponent convertprovisionComponent(org.hl7.fhir.r4.model.Consent.provisionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Consent.ProvisionComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertConsentProvisionType(src.getType())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Consent.provisionActorComponent t : src.getActor()) - tgt.addActor(convertprovisionActorComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAction()) - tgt.addAction(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertCoding(t)); - for (org.hl7.fhir.r4.model.Coding t : src.getPurpose()) - tgt.addPurpose(convertCoding(t)); - for (org.hl7.fhir.r4.model.Coding t : src.getClass_()) - tgt.addClass_(convertCoding(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - if (src.hasDataPeriod()) - tgt.setDataPeriod(convertPeriod(src.getDataPeriod())); - for (org.hl7.fhir.r4.model.Consent.provisionDataComponent t : src.getData()) - tgt.addData(convertprovisionDataComponent(t)); - for (org.hl7.fhir.r4.model.Consent.provisionComponent t : src.getProvision()) - tgt.addProvision(convertprovisionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Consent.provisionComponent convertprovisionComponent(org.hl7.fhir.r5.model.Consent.ProvisionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Consent.provisionComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertConsentProvisionType(src.getType())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Consent.ProvisionActorComponent t : src.getActor()) - tgt.addActor(convertprovisionActorComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAction()) - tgt.addAction(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertCoding(t)); - for (org.hl7.fhir.r5.model.Coding t : src.getPurpose()) - tgt.addPurpose(convertCoding(t)); - for (org.hl7.fhir.r5.model.Coding t : src.getClass_()) - tgt.addClass_(convertCoding(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - if (src.hasDataPeriod()) - tgt.setDataPeriod(convertPeriod(src.getDataPeriod())); - for (org.hl7.fhir.r5.model.Consent.ProvisionDataComponent t : src.getData()) - tgt.addData(convertprovisionDataComponent(t)); - for (org.hl7.fhir.r5.model.Consent.ProvisionComponent t : src.getProvision()) - tgt.addProvision(convertprovisionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Consent.ConsentProvisionType convertConsentProvisionType(org.hl7.fhir.r4.model.Consent.ConsentProvisionType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DENY: return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.DENY; - case PERMIT: return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.PERMIT; - default: return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Consent.ConsentProvisionType convertConsentProvisionType(org.hl7.fhir.r5.model.Consent.ConsentProvisionType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DENY: return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.DENY; - case PERMIT: return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.PERMIT; - default: return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.NULL; - } -} - - public static org.hl7.fhir.r5.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r4.model.Consent.provisionActorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Consent.ProvisionActorComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionActorComponent(); - copyElement(src, tgt); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Consent.provisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r5.model.Consent.ProvisionActorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Consent.provisionActorComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionActorComponent(); - copyElement(src, tgt); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Consent.ProvisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r4.model.Consent.provisionDataComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Consent.ProvisionDataComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionDataComponent(); - copyElement(src, tgt); - if (src.hasMeaning()) - tgt.setMeaning(convertConsentDataMeaning(src.getMeaning())); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Consent.provisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r5.model.Consent.ProvisionDataComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Consent.provisionDataComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionDataComponent(); - copyElement(src, tgt); - if (src.hasMeaning()) - tgt.setMeaning(convertConsentDataMeaning(src.getMeaning())); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Consent.ConsentDataMeaning convertConsentDataMeaning(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.INSTANCE; - case RELATED: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.RELATED; - case DEPENDENTS: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.DEPENDENTS; - case AUTHOREDBY: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.AUTHOREDBY; - default: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.NULL; - } -} - - public static org.hl7.fhir.r4.model.Consent.ConsentDataMeaning convertConsentDataMeaning(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.INSTANCE; - case RELATED: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.RELATED; - case DEPENDENTS: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.DEPENDENTS; - case AUTHOREDBY: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.AUTHOREDBY; - default: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.NULL; - } -} + public static org.hl7.fhir.r5.model.Consent convertConsent(org.hl7.fhir.r4.model.Consent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent tgt = new org.hl7.fhir.r5.model.Consent(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertConsentState(src.getStatus())); + if (src.hasScope()) + tgt.setScope(convertCodeableConcept(src.getScope())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDateTime()) + tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasOrganization()) { + for (org.hl7.fhir.r4.model.Reference t : src.getOrganization()) tgt.addOrganization(convertReference(t)); + } + if (src.hasSourceAttachment()) + tgt.addSourceAttachment(convertAttachment(src.getSourceAttachment())); + if (src.hasSourceReference()) + tgt.addSourceReference(convertReference(src.getSourceReference())); + if (src.hasPolicy()) { + for (org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent t : src.getPolicy()) tgt.addPolicy(convertConsentPolicyComponent(t)); + } + if (src.hasPolicyRule()) + tgt.setPolicyRule(convertCodeableConcept(src.getPolicyRule())); + if (src.hasVerification()) { + for (org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent t : src.getVerification()) tgt.addVerification(convertConsentVerificationComponent(t)); + } + if (src.hasProvision()) + tgt.setProvision(convertprovisionComponent(src.getProvision())); + return tgt; + } + public static org.hl7.fhir.r4.model.Consent convertConsent(org.hl7.fhir.r5.model.Consent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Consent tgt = new org.hl7.fhir.r4.model.Consent(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertConsentState(src.getStatus())); + if (src.hasScope()) + tgt.setScope(convertCodeableConcept(src.getScope())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDateTime()) + tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasOrganization()) { + for (org.hl7.fhir.r5.model.Reference t : src.getOrganization()) tgt.addOrganization(convertReference(t)); + } + if (src.hasSourceAttachment()) + tgt.setSource(convertType(src.getSourceAttachmentFirstRep())); + if (src.hasSourceReference()) + tgt.setSource(convertType(src.getSourceReferenceFirstRep())); + if (src.hasPolicy()) { + for (org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent t : src.getPolicy()) tgt.addPolicy(convertConsentPolicyComponent(t)); + } + if (src.hasPolicyRule()) + tgt.setPolicyRule(convertCodeableConcept(src.getPolicyRule())); + if (src.hasVerification()) { + for (org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent t : src.getVerification()) tgt.addVerification(convertConsentVerificationComponent(t)); + } + if (src.hasProvision()) + tgt.setProvision(convertprovisionComponent(src.getProvision())); + return tgt; + } + public static org.hl7.fhir.r5.model.Consent.ConsentState convertConsentState(org.hl7.fhir.r4.model.Consent.ConsentState src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT; + case PROPOSED: + return org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Consent.ConsentState.ACTIVE; + case REJECTED: + return org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE; + case INACTIVE: + return org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Consent.ConsentState.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Consent.ConsentState.NULL; + } + } + + public static org.hl7.fhir.r4.model.Consent.ConsentState convertConsentState(org.hl7.fhir.r5.model.Consent.ConsentState src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.Consent.ConsentState.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.Consent.ConsentState.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r4.model.Consent.ConsentState.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Consent.ConsentState.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Consent.ConsentState.NULL; + } + } + + public static org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent(); + copyElement(src, tgt); + if (src.hasAuthority()) + tgt.setAuthorityElement(convertUri(src.getAuthorityElement())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent(); + copyElement(src, tgt); + if (src.hasAuthority()) + tgt.setAuthorityElement(convertUri(src.getAuthorityElement())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent(); + copyElement(src, tgt); + if (src.hasVerified()) + tgt.setVerifiedElement(convertBoolean(src.getVerifiedElement())); + if (src.hasVerifiedWith()) + tgt.setVerifiedWith(convertReference(src.getVerifiedWith())); + if (src.hasVerificationDate()) + tgt.getVerificationDate().add(convertDateTime(src.getVerificationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent(); + copyElement(src, tgt); + if (src.hasVerified()) + tgt.setVerifiedElement(convertBoolean(src.getVerifiedElement())); + if (src.hasVerifiedWith()) + tgt.setVerifiedWith(convertReference(src.getVerifiedWith())); + if (src.hasVerificationDate()) + tgt.setVerificationDateElement(convertDateTime(src.getVerificationDate().get(0))); + return tgt; + } + + public static org.hl7.fhir.r5.model.Consent.ProvisionComponent convertprovisionComponent(org.hl7.fhir.r4.model.Consent.provisionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ProvisionComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertConsentProvisionType(src.getType())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasActor()) { + for (org.hl7.fhir.r4.model.Consent.provisionActorComponent t : src.getActor()) tgt.addActor(convertprovisionActorComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAction()) tgt.addAction(convertCodeableConcept(t)); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(convertCoding(t)); + } + if (src.hasPurpose()) { + for (org.hl7.fhir.r4.model.Coding t : src.getPurpose()) tgt.addPurpose(convertCoding(t)); + } + if (src.hasClass_()) { + for (org.hl7.fhir.r4.model.Coding t : src.getClass_()) tgt.addClass_(convertCoding(t)); + } + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDataPeriod()) + tgt.setDataPeriod(convertPeriod(src.getDataPeriod())); + if (src.hasData()) { + for (org.hl7.fhir.r4.model.Consent.provisionDataComponent t : src.getData()) tgt.addData(convertprovisionDataComponent(t)); + } + if (src.hasProvision()) { + for (org.hl7.fhir.r4.model.Consent.provisionComponent t : src.getProvision()) tgt.addProvision(convertprovisionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Consent.provisionComponent convertprovisionComponent(org.hl7.fhir.r5.model.Consent.ProvisionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Consent.provisionComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertConsentProvisionType(src.getType())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasActor()) { + for (org.hl7.fhir.r5.model.Consent.ProvisionActorComponent t : src.getActor()) tgt.addActor(convertprovisionActorComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAction()) tgt.addAction(convertCodeableConcept(t)); + } + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(convertCoding(t)); + } + if (src.hasPurpose()) { + for (org.hl7.fhir.r5.model.Coding t : src.getPurpose()) tgt.addPurpose(convertCoding(t)); + } + if (src.hasClass_()) { + for (org.hl7.fhir.r5.model.Coding t : src.getClass_()) tgt.addClass_(convertCoding(t)); + } + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDataPeriod()) + tgt.setDataPeriod(convertPeriod(src.getDataPeriod())); + if (src.hasData()) { + for (org.hl7.fhir.r5.model.Consent.ProvisionDataComponent t : src.getData()) tgt.addData(convertprovisionDataComponent(t)); + } + if (src.hasProvision()) { + for (org.hl7.fhir.r5.model.Consent.ProvisionComponent t : src.getProvision()) tgt.addProvision(convertprovisionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Consent.ConsentProvisionType convertConsentProvisionType(org.hl7.fhir.r4.model.Consent.ConsentProvisionType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DENY: + return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.DENY; + case PERMIT: + return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.PERMIT; + default: + return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Consent.ConsentProvisionType convertConsentProvisionType(org.hl7.fhir.r5.model.Consent.ConsentProvisionType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DENY: + return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.DENY; + case PERMIT: + return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.PERMIT; + default: + return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.NULL; + } + } + + public static org.hl7.fhir.r5.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r4.model.Consent.provisionActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ProvisionActorComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionActorComponent(); + copyElement(src, tgt); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Consent.provisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r5.model.Consent.ProvisionActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Consent.provisionActorComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionActorComponent(); + copyElement(src, tgt); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Consent.ProvisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r4.model.Consent.provisionDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ProvisionDataComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionDataComponent(); + copyElement(src, tgt); + if (src.hasMeaning()) + tgt.setMeaning(convertConsentDataMeaning(src.getMeaning())); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Consent.provisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r5.model.Consent.ProvisionDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Consent.provisionDataComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionDataComponent(); + copyElement(src, tgt); + if (src.hasMeaning()) + tgt.setMeaning(convertConsentDataMeaning(src.getMeaning())); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Consent.ConsentDataMeaning convertConsentDataMeaning(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.INSTANCE; + case RELATED: + return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.RELATED; + case DEPENDENTS: + return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.DEPENDENTS; + case AUTHOREDBY: + return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.AUTHOREDBY; + default: + return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.NULL; + } + } + + public static org.hl7.fhir.r4.model.Consent.ConsentDataMeaning convertConsentDataMeaning(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.INSTANCE; + case RELATED: + return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.RELATED; + case DEPENDENTS: + return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.DEPENDENTS; + case AUTHOREDBY: + return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.AUTHOREDBY; + default: + return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Contract.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Contract.java index 1341b04e1..66c2090ea 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Contract.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Contract.java @@ -19,14 +19,11 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -55,875 +52,1043 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Contract extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Contract convertContract(org.hl7.fhir.r4.model.Contract src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract tgt = new org.hl7.fhir.r5.model.Contract(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasStatus()) - tgt.setStatus(convertContractStatus(src.getStatus())); - if (src.hasLegalState()) - tgt.setLegalState(convertCodeableConcept(src.getLegalState())); - if (src.hasInstantiatesCanonical()) - tgt.setInstantiatesCanonical(convertReference(src.getInstantiatesCanonical())); - if (src.hasInstantiatesUri()) - tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); - if (src.hasContentDerivative()) - tgt.setContentDerivative(convertCodeableConcept(src.getContentDerivative())); - if (src.hasIssued()) - tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); - if (src.hasApplies()) - tgt.setApplies(convertPeriod(src.getApplies())); - if (src.hasExpirationType()) - tgt.setExpirationType(convertCodeableConcept(src.getExpirationType())); - for (org.hl7.fhir.r4.model.Reference t : src.getSubject()) - tgt.addSubject(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthority()) - tgt.addAuthority(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getDomain()) - tgt.addDomain(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSite()) - tgt.addSite(convertReference(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - if (src.hasScope()) - tgt.setScope(convertCodeableConcept(src.getScope())); - if (src.hasTopic()) - tgt.setTopic(convertType(src.getTopic())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubType()) - tgt.addSubType(convertCodeableConcept(t)); - if (src.hasContentDefinition()) - tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition())); - for (org.hl7.fhir.r4.model.Contract.TermComponent t : src.getTerm()) - tgt.addTerm(convertTermComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - for (org.hl7.fhir.r4.model.Contract.SignatoryComponent t : src.getSigner()) - tgt.addSigner(convertSignatoryComponent(t)); - for (org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) - tgt.addFriendly(convertFriendlyLanguageComponent(t)); - for (org.hl7.fhir.r4.model.Contract.LegalLanguageComponent t : src.getLegal()) - tgt.addLegal(convertLegalLanguageComponent(t)); - for (org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent t : src.getRule()) - tgt.addRule(convertComputableLanguageComponent(t)); - if (src.hasLegallyBinding()) - tgt.setLegallyBinding(convertType(src.getLegallyBinding())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract convertContract(org.hl7.fhir.r5.model.Contract src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract tgt = new org.hl7.fhir.r4.model.Contract(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasStatus()) - tgt.setStatus(convertContractStatus(src.getStatus())); - if (src.hasLegalState()) - tgt.setLegalState(convertCodeableConcept(src.getLegalState())); - if (src.hasInstantiatesCanonical()) - tgt.setInstantiatesCanonical(convertReference(src.getInstantiatesCanonical())); - if (src.hasInstantiatesUri()) - tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); - if (src.hasContentDerivative()) - tgt.setContentDerivative(convertCodeableConcept(src.getContentDerivative())); - if (src.hasIssued()) - tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); - if (src.hasApplies()) - tgt.setApplies(convertPeriod(src.getApplies())); - if (src.hasExpirationType()) - tgt.setExpirationType(convertCodeableConcept(src.getExpirationType())); - for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) - tgt.addSubject(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthority()) - tgt.addAuthority(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getDomain()) - tgt.addDomain(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSite()) - tgt.addSite(convertReference(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - if (src.hasScope()) - tgt.setScope(convertCodeableConcept(src.getScope())); - if (src.hasTopic()) - tgt.setTopic(convertType(src.getTopic())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubType()) - tgt.addSubType(convertCodeableConcept(t)); - if (src.hasContentDefinition()) - tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition())); - for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getTerm()) - tgt.addTerm(convertTermComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - for (org.hl7.fhir.r5.model.Contract.SignatoryComponent t : src.getSigner()) - tgt.addSigner(convertSignatoryComponent(t)); - for (org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) - tgt.addFriendly(convertFriendlyLanguageComponent(t)); - for (org.hl7.fhir.r5.model.Contract.LegalLanguageComponent t : src.getLegal()) - tgt.addLegal(convertLegalLanguageComponent(t)); - for (org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent t : src.getRule()) - tgt.addRule(convertComputableLanguageComponent(t)); - if (src.hasLegallyBinding()) - tgt.setLegallyBinding(convertType(src.getLegallyBinding())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes convertContractStatus(org.hl7.fhir.r4.model.Contract.ContractStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AMENDED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.AMENDED; - case APPENDED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.APPENDED; - case CANCELLED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.CANCELLED; - case DISPUTED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.DISPUTED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR; - case EXECUTABLE: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTABLE; - case EXECUTED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTED; - case NEGOTIABLE: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NEGOTIABLE; - case OFFERED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.OFFERED; - case POLICY: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.POLICY; - case REJECTED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REJECTED; - case RENEWED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RENEWED; - case REVOKED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REVOKED; - case RESOLVED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RESOLVED; - case TERMINATED: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.TERMINATED; - default: return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Contract.ContractStatus convertContractStatus(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AMENDED: return org.hl7.fhir.r4.model.Contract.ContractStatus.AMENDED; - case APPENDED: return org.hl7.fhir.r4.model.Contract.ContractStatus.APPENDED; - case CANCELLED: return org.hl7.fhir.r4.model.Contract.ContractStatus.CANCELLED; - case DISPUTED: return org.hl7.fhir.r4.model.Contract.ContractStatus.DISPUTED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Contract.ContractStatus.ENTEREDINERROR; - case EXECUTABLE: return org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTABLE; - case EXECUTED: return org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTED; - case NEGOTIABLE: return org.hl7.fhir.r4.model.Contract.ContractStatus.NEGOTIABLE; - case OFFERED: return org.hl7.fhir.r4.model.Contract.ContractStatus.OFFERED; - case POLICY: return org.hl7.fhir.r4.model.Contract.ContractStatus.POLICY; - case REJECTED: return org.hl7.fhir.r4.model.Contract.ContractStatus.REJECTED; - case RENEWED: return org.hl7.fhir.r4.model.Contract.ContractStatus.RENEWED; - case REVOKED: return org.hl7.fhir.r4.model.Contract.ContractStatus.REVOKED; - case RESOLVED: return org.hl7.fhir.r4.model.Contract.ContractStatus.RESOLVED; - case TERMINATED: return org.hl7.fhir.r4.model.Contract.ContractStatus.TERMINATED; - default: return org.hl7.fhir.r4.model.Contract.ContractStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasPublisher()) - tgt.setPublisher(convertReference(src.getPublisher())); - if (src.hasPublicationDate()) - tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); - if (src.hasPublicationStatus()) - tgt.setPublicationStatus(convertContractPublicationStatus(src.getPublicationStatus())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasPublisher()) - tgt.setPublisher(convertReference(src.getPublisher())); - if (src.hasPublicationDate()) - tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); - if (src.hasPublicationStatus()) - tgt.setPublicationStatus(convertContractPublicationStatus(src.getPublicationStatus())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes convertContractPublicationStatus(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AMENDED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.AMENDED; - case APPENDED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.APPENDED; - case CANCELLED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED; - case DISPUTED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR; - case EXECUTABLE: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE; - case EXECUTED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED; - case NEGOTIABLE: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE; - case OFFERED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.OFFERED; - case POLICY: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.POLICY; - case REJECTED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REJECTED; - case RENEWED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RENEWED; - case REVOKED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REVOKED; - case RESOLVED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED; - case TERMINATED: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED; - default: return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Contract.ContractPublicationStatus convertContractPublicationStatus(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AMENDED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.AMENDED; - case APPENDED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.APPENDED; - case CANCELLED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.CANCELLED; - case DISPUTED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.DISPUTED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.ENTEREDINERROR; - case EXECUTABLE: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTABLE; - case EXECUTED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTED; - case NEGOTIABLE: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NEGOTIABLE; - case OFFERED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.OFFERED; - case POLICY: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.POLICY; - case REJECTED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REJECTED; - case RENEWED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RENEWED; - case REVOKED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REVOKED; - case RESOLVED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RESOLVED; - case TERMINATED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.TERMINATED; - default: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r4.model.Contract.TermComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.TermComponent tgt = new org.hl7.fhir.r5.model.Contract.TermComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasIssued()) - tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); - if (src.hasApplies()) - tgt.setApplies(convertPeriod(src.getApplies())); - if (src.hasTopic()) - tgt.setTopic(convertType(src.getTopic())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r4.model.Contract.SecurityLabelComponent t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertSecurityLabelComponent(t)); - if (src.hasOffer()) - tgt.setOffer(convertContractOfferComponent(src.getOffer())); - for (org.hl7.fhir.r4.model.Contract.ContractAssetComponent t : src.getAsset()) - tgt.addAsset(convertContractAssetComponent(t)); - for (org.hl7.fhir.r4.model.Contract.ActionComponent t : src.getAction()) - tgt.addAction(convertActionComponent(t)); - for (org.hl7.fhir.r4.model.Contract.TermComponent t : src.getGroup()) - tgt.addGroup(convertTermComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r5.model.Contract.TermComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.TermComponent tgt = new org.hl7.fhir.r4.model.Contract.TermComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasIssued()) - tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); - if (src.hasApplies()) - tgt.setApplies(convertPeriod(src.getApplies())); - if (src.hasTopic()) - tgt.setTopic(convertType(src.getTopic())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r5.model.Contract.SecurityLabelComponent t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertSecurityLabelComponent(t)); - if (src.hasOffer()) - tgt.setOffer(convertContractOfferComponent(src.getOffer())); - for (org.hl7.fhir.r5.model.Contract.ContractAssetComponent t : src.getAsset()) - tgt.addAsset(convertContractAssetComponent(t)); - for (org.hl7.fhir.r5.model.Contract.ActionComponent t : src.getAction()) - tgt.addAction(convertActionComponent(t)); - for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getGroup()) - tgt.addGroup(convertTermComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r4.model.Contract.SecurityLabelComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r5.model.Contract.SecurityLabelComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getNumber()) - tgt.getNumber().add(convertUnsignedInt(t)); - if (src.hasClassification()) - tgt.setClassification(convertCoding(src.getClassification())); - for (org.hl7.fhir.r4.model.Coding t : src.getCategory()) - tgt.addCategory(convertCoding(t)); - for (org.hl7.fhir.r4.model.Coding t : src.getControl()) - tgt.addControl(convertCoding(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r5.model.Contract.SecurityLabelComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r4.model.Contract.SecurityLabelComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getNumber()) - tgt.getNumber().add(convertUnsignedInt(t)); - if (src.hasClassification()) - tgt.setClassification(convertCoding(src.getClassification())); - for (org.hl7.fhir.r5.model.Coding t : src.getCategory()) - tgt.addCategory(convertCoding(t)); - for (org.hl7.fhir.r5.model.Coding t : src.getControl()) - tgt.addControl(convertCoding(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r4.model.Contract.ContractOfferComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractOfferComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Contract.ContractPartyComponent t : src.getParty()) - tgt.addParty(convertContractPartyComponent(t)); - if (src.hasTopic()) - tgt.setTopic(convertReference(src.getTopic())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasDecision()) - tgt.setDecision(convertCodeableConcept(src.getDecision())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDecisionMode()) - tgt.addDecisionMode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Contract.AnswerComponent t : src.getAnswer()) - tgt.addAnswer(convertAnswerComponent(t)); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r5.model.Contract.ContractOfferComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractOfferComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Contract.ContractPartyComponent t : src.getParty()) - tgt.addParty(convertContractPartyComponent(t)); - if (src.hasTopic()) - tgt.setTopic(convertReference(src.getTopic())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasDecision()) - tgt.setDecision(convertCodeableConcept(src.getDecision())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDecisionMode()) - tgt.addDecisionMode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) - tgt.addAnswer(convertAnswerComponent(t)); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r4.model.Contract.ContractPartyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractPartyComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Reference t : src.getReference()) - tgt.addReference(convertReference(t)); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r5.model.Contract.ContractPartyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractPartyComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Reference t : src.getReference()) - tgt.addReference(convertReference(t)); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r4.model.Contract.AnswerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r5.model.Contract.AnswerComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r5.model.Contract.AnswerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r4.model.Contract.AnswerComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r4.model.Contract.ContractAssetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractAssetComponent(); - copyElement(src, tgt); - if (src.hasScope()) - tgt.setScope(convertCodeableConcept(src.getScope())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getTypeReference()) - tgt.addTypeReference(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubtype()) - tgt.addSubtype(convertCodeableConcept(t)); - if (src.hasRelationship()) - tgt.setRelationship(convertCoding(src.getRelationship())); - for (org.hl7.fhir.r4.model.Contract.AssetContextComponent t : src.getContext()) - tgt.addContext(convertAssetContextComponent(t)); - if (src.hasCondition()) - tgt.setConditionElement(convertString(src.getConditionElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPeriodType()) - tgt.addPeriodType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Period t : src.getPeriod()) - tgt.addPeriod(convertPeriod(t)); - for (org.hl7.fhir.r4.model.Period t : src.getUsePeriod()) - tgt.addUsePeriod(convertPeriod(t)); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - for (org.hl7.fhir.r4.model.Contract.AnswerComponent t : src.getAnswer()) - tgt.addAnswer(convertAnswerComponent(t)); - for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - for (org.hl7.fhir.r4.model.Contract.ValuedItemComponent t : src.getValuedItem()) - tgt.addValuedItem(convertValuedItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r5.model.Contract.ContractAssetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractAssetComponent(); - copyElement(src, tgt); - if (src.hasScope()) - tgt.setScope(convertCodeableConcept(src.getScope())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getTypeReference()) - tgt.addTypeReference(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubtype()) - tgt.addSubtype(convertCodeableConcept(t)); - if (src.hasRelationship()) - tgt.setRelationship(convertCoding(src.getRelationship())); - for (org.hl7.fhir.r5.model.Contract.AssetContextComponent t : src.getContext()) - tgt.addContext(convertAssetContextComponent(t)); - if (src.hasCondition()) - tgt.setConditionElement(convertString(src.getConditionElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPeriodType()) - tgt.addPeriodType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Period t : src.getPeriod()) - tgt.addPeriod(convertPeriod(t)); - for (org.hl7.fhir.r5.model.Period t : src.getUsePeriod()) - tgt.addUsePeriod(convertPeriod(t)); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) - tgt.addAnswer(convertAnswerComponent(t)); - for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - for (org.hl7.fhir.r5.model.Contract.ValuedItemComponent t : src.getValuedItem()) - tgt.addValuedItem(convertValuedItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r4.model.Contract.AssetContextComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r5.model.Contract.AssetContextComponent(); - copyElement(src, tgt); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r5.model.Contract.AssetContextComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r4.model.Contract.AssetContextComponent(); - copyElement(src, tgt); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r4.model.Contract.ValuedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r5.model.Contract.ValuedItemComponent(); - copyElement(src, tgt); - if (src.hasEntity()) - tgt.setEntity(convertType(src.getEntity())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasEffectiveTime()) - tgt.setEffectiveTimeElement(convertDateTime(src.getEffectiveTimeElement())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasPoints()) - tgt.setPointsElement(convertDecimal(src.getPointsElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - if (src.hasPayment()) - tgt.setPaymentElement(convertString(src.getPaymentElement())); - if (src.hasPaymentDate()) - tgt.setPaymentDateElement(convertDateTime(src.getPaymentDateElement())); - if (src.hasResponsible()) - tgt.setResponsible(convertReference(src.getResponsible())); - if (src.hasRecipient()) - tgt.setRecipient(convertReference(src.getRecipient())); - for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r5.model.Contract.ValuedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r4.model.Contract.ValuedItemComponent(); - copyElement(src, tgt); - if (src.hasEntity()) - tgt.setEntity(convertType(src.getEntity())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasEffectiveTime()) - tgt.setEffectiveTimeElement(convertDateTime(src.getEffectiveTimeElement())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasPoints()) - tgt.setPointsElement(convertDecimal(src.getPointsElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - if (src.hasPayment()) - tgt.setPaymentElement(convertString(src.getPaymentElement())); - if (src.hasPaymentDate()) - tgt.setPaymentDateElement(convertDateTime(src.getPaymentDateElement())); - if (src.hasResponsible()) - tgt.setResponsible(convertReference(src.getResponsible())); - if (src.hasRecipient()) - tgt.setRecipient(convertReference(src.getRecipient())); - for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r4.model.Contract.ActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ActionComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionComponent(); - copyElement(src, tgt); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.Contract.ActionSubjectComponent t : src.getSubject()) - tgt.addSubject(convertActionSubjectComponent(t)); - if (src.hasIntent()) - tgt.setIntent(convertCodeableConcept(src.getIntent())); - for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - if (src.hasStatus()) - tgt.setStatus(convertCodeableConcept(src.getStatus())); - if (src.hasContext()) - tgt.setContext(convertReference(src.getContext())); - for (org.hl7.fhir.r4.model.StringType t : src.getContextLinkId()) - tgt.getContextLinkId().add(convertString(t)); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - for (org.hl7.fhir.r4.model.Reference t : src.getRequester()) - tgt.addRequester(convertReference(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getRequesterLinkId()) - tgt.getRequesterLinkId().add(convertString(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPerformerType()) - tgt.addPerformerType(convertCodeableConcept(t)); - if (src.hasPerformerRole()) - tgt.setPerformerRole(convertCodeableConcept(src.getPerformerRole())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (org.hl7.fhir.r4.model.StringType t : src.getPerformerLinkId()) - tgt.getPerformerLinkId().add(convertString(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getReasonLinkId()) - tgt.getReasonLinkId().add(convertString(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r5.model.Contract.ActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ActionComponent tgt = new org.hl7.fhir.r4.model.Contract.ActionComponent(); - copyElement(src, tgt); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.Contract.ActionSubjectComponent t : src.getSubject()) - tgt.addSubject(convertActionSubjectComponent(t)); - if (src.hasIntent()) - tgt.setIntent(convertCodeableConcept(src.getIntent())); - for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) - tgt.getLinkId().add(convertString(t)); - if (src.hasStatus()) - tgt.setStatus(convertCodeableConcept(src.getStatus())); - if (src.hasContext()) - tgt.setContext(convertReference(src.getContext())); - for (org.hl7.fhir.r5.model.StringType t : src.getContextLinkId()) - tgt.getContextLinkId().add(convertString(t)); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - for (org.hl7.fhir.r5.model.Reference t : src.getRequester()) - tgt.addRequester(convertReference(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getRequesterLinkId()) - tgt.getRequesterLinkId().add(convertString(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType()) - tgt.addPerformerType(convertCodeableConcept(t)); - if (src.hasPerformerRole()) - tgt.setPerformerRole(convertCodeableConcept(src.getPerformerRole())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (org.hl7.fhir.r5.model.StringType t : src.getPerformerLinkId()) - tgt.getPerformerLinkId().add(convertString(t)); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId()) - tgt.getReason().add(convertString(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId()) - tgt.getReasonLinkId().add(convertString(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) - tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r4.model.Contract.ActionSubjectComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionSubjectComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Reference t : src.getReference()) - tgt.addReference(convertReference(t)); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r5.model.Contract.ActionSubjectComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r4.model.Contract.ActionSubjectComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Reference t : src.getReference()) - tgt.addReference(convertReference(t)); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r4.model.Contract.SignatoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r5.model.Contract.SignatoryComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - for (org.hl7.fhir.r4.model.Signature t : src.getSignature()) - tgt.addSignature(convertSignature(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r5.model.Contract.SignatoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r4.model.Contract.SignatoryComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) - tgt.addSignature(convertSignature(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent(); - copyElement(src, tgt); - if (src.hasContent()) - tgt.setContent(convertType(src.getContent())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent(); - copyElement(src, tgt); - if (src.hasContent()) - tgt.setContent(convertType(src.getContent())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r4.model.Contract.LegalLanguageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.LegalLanguageComponent(); - copyElement(src, tgt); - if (src.hasContent()) - tgt.setContent(convertType(src.getContent())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r5.model.Contract.LegalLanguageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.LegalLanguageComponent(); - copyElement(src, tgt); - if (src.hasContent()) - tgt.setContent(convertType(src.getContent())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent(); - copyElement(src, tgt); - if (src.hasContent()) - tgt.setContent(convertType(src.getContent())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent(); - copyElement(src, tgt); - if (src.hasContent()) - tgt.setContent(convertType(src.getContent())); - return tgt; - } + public static org.hl7.fhir.r5.model.Contract convertContract(org.hl7.fhir.r4.model.Contract src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract tgt = new org.hl7.fhir.r5.model.Contract(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasStatus()) + tgt.setStatus(convertContractStatus(src.getStatus())); + if (src.hasLegalState()) + tgt.setLegalState(convertCodeableConcept(src.getLegalState())); + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonical(convertReference(src.getInstantiatesCanonical())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); + if (src.hasContentDerivative()) + tgt.setContentDerivative(convertCodeableConcept(src.getContentDerivative())); + if (src.hasIssued()) + tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(convertPeriod(src.getApplies())); + if (src.hasExpirationType()) + tgt.setExpirationType(convertCodeableConcept(src.getExpirationType())); + if (src.hasSubject()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSubject()) tgt.addSubject(convertReference(t)); + } + if (src.hasAuthority()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthority()) tgt.addAuthority(convertReference(t)); + } + if (src.hasDomain()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDomain()) tgt.addDomain(convertReference(t)); + } + if (src.hasSite()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSite()) tgt.addSite(convertReference(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasScope()) + tgt.setScope(convertCodeableConcept(src.getScope())); + if (src.hasTopic()) + tgt.setTopic(convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubType()) tgt.addSubType(convertCodeableConcept(t)); + } + if (src.hasContentDefinition()) + tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition())); + if (src.hasTerm()) { + for (org.hl7.fhir.r4.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + if (src.hasSigner()) { + for (org.hl7.fhir.r4.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t)); + } + if (src.hasFriendly()) { + for (org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t)); + } + if (src.hasLegal()) { + for (org.hl7.fhir.r4.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t)); + } + if (src.hasLegallyBinding()) + tgt.setLegallyBinding(convertType(src.getLegallyBinding())); + return tgt; + } + public static org.hl7.fhir.r4.model.Contract convertContract(org.hl7.fhir.r5.model.Contract src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract tgt = new org.hl7.fhir.r4.model.Contract(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasStatus()) + tgt.setStatus(convertContractStatus(src.getStatus())); + if (src.hasLegalState()) + tgt.setLegalState(convertCodeableConcept(src.getLegalState())); + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonical(convertReference(src.getInstantiatesCanonical())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); + if (src.hasContentDerivative()) + tgt.setContentDerivative(convertCodeableConcept(src.getContentDerivative())); + if (src.hasIssued()) + tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(convertPeriod(src.getApplies())); + if (src.hasExpirationType()) + tgt.setExpirationType(convertCodeableConcept(src.getExpirationType())); + if (src.hasSubject()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) tgt.addSubject(convertReference(t)); + } + if (src.hasAuthority()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthority()) tgt.addAuthority(convertReference(t)); + } + if (src.hasDomain()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDomain()) tgt.addDomain(convertReference(t)); + } + if (src.hasSite()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSite()) tgt.addSite(convertReference(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasScope()) + tgt.setScope(convertCodeableConcept(src.getScope())); + if (src.hasTopic()) + tgt.setTopic(convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubType()) tgt.addSubType(convertCodeableConcept(t)); + } + if (src.hasContentDefinition()) + tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition())); + if (src.hasTerm()) { + for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + if (src.hasSigner()) { + for (org.hl7.fhir.r5.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t)); + } + if (src.hasFriendly()) { + for (org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t)); + } + if (src.hasLegal()) { + for (org.hl7.fhir.r5.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t)); + } + if (src.hasLegallyBinding()) + tgt.setLegallyBinding(convertType(src.getLegallyBinding())); + return tgt; + } + public static org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes convertContractStatus(org.hl7.fhir.r4.model.Contract.ContractStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AMENDED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.AMENDED; + case APPENDED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.APPENDED; + case CANCELLED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.CANCELLED; + case DISPUTED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.DISPUTED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR; + case EXECUTABLE: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTABLE; + case EXECUTED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTED; + case NEGOTIABLE: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NEGOTIABLE; + case OFFERED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.OFFERED; + case POLICY: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.POLICY; + case REJECTED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REJECTED; + case RENEWED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RENEWED; + case REVOKED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REVOKED; + case RESOLVED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RESOLVED; + case TERMINATED: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.TERMINATED; + default: + return org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Contract.ContractStatus convertContractStatus(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AMENDED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.AMENDED; + case APPENDED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.APPENDED; + case CANCELLED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.CANCELLED; + case DISPUTED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.DISPUTED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Contract.ContractStatus.ENTEREDINERROR; + case EXECUTABLE: + return org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTABLE; + case EXECUTED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTED; + case NEGOTIABLE: + return org.hl7.fhir.r4.model.Contract.ContractStatus.NEGOTIABLE; + case OFFERED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.OFFERED; + case POLICY: + return org.hl7.fhir.r4.model.Contract.ContractStatus.POLICY; + case REJECTED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.REJECTED; + case RENEWED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.RENEWED; + case REVOKED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.REVOKED; + case RESOLVED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.RESOLVED; + case TERMINATED: + return org.hl7.fhir.r4.model.Contract.ContractStatus.TERMINATED; + default: + return org.hl7.fhir.r4.model.Contract.ContractStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasPublisher()) + tgt.setPublisher(convertReference(src.getPublisher())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); + if (src.hasPublicationStatus()) + tgt.setPublicationStatus(convertContractPublicationStatus(src.getPublicationStatus())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasPublisher()) + tgt.setPublisher(convertReference(src.getPublisher())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); + if (src.hasPublicationStatus()) + tgt.setPublicationStatus(convertContractPublicationStatus(src.getPublicationStatus())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes convertContractPublicationStatus(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AMENDED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.AMENDED; + case APPENDED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.APPENDED; + case CANCELLED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED; + case DISPUTED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR; + case EXECUTABLE: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE; + case EXECUTED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED; + case NEGOTIABLE: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE; + case OFFERED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.OFFERED; + case POLICY: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.POLICY; + case REJECTED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REJECTED; + case RENEWED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RENEWED; + case REVOKED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REVOKED; + case RESOLVED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED; + case TERMINATED: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED; + default: + return org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Contract.ContractPublicationStatus convertContractPublicationStatus(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AMENDED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.AMENDED; + case APPENDED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.APPENDED; + case CANCELLED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.CANCELLED; + case DISPUTED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.DISPUTED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.ENTEREDINERROR; + case EXECUTABLE: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTABLE; + case EXECUTED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTED; + case NEGOTIABLE: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NEGOTIABLE; + case OFFERED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.OFFERED; + case POLICY: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.POLICY; + case REJECTED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REJECTED; + case RENEWED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RENEWED; + case REVOKED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REVOKED; + case RESOLVED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RESOLVED; + case TERMINATED: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.TERMINATED; + default: + return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r4.model.Contract.TermComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.TermComponent tgt = new org.hl7.fhir.r5.model.Contract.TermComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasIssued()) + tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(convertPeriod(src.getApplies())); + if (src.hasTopic()) + tgt.setTopic(convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.Contract.SecurityLabelComponent t : src.getSecurityLabel()) tgt.addSecurityLabel(convertSecurityLabelComponent(t)); + } + if (src.hasOffer()) + tgt.setOffer(convertContractOfferComponent(src.getOffer())); + if (src.hasAsset()) { + for (org.hl7.fhir.r4.model.Contract.ContractAssetComponent t : src.getAsset()) tgt.addAsset(convertContractAssetComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.Contract.ActionComponent t : src.getAction()) tgt.addAction(convertActionComponent(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r5.model.Contract.TermComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.TermComponent tgt = new org.hl7.fhir.r4.model.Contract.TermComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasIssued()) + tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(convertPeriod(src.getApplies())); + if (src.hasTopic()) + tgt.setTopic(convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.Contract.SecurityLabelComponent t : src.getSecurityLabel()) tgt.addSecurityLabel(convertSecurityLabelComponent(t)); + } + if (src.hasOffer()) + tgt.setOffer(convertContractOfferComponent(src.getOffer())); + if (src.hasAsset()) { + for (org.hl7.fhir.r5.model.Contract.ContractAssetComponent t : src.getAsset()) tgt.addAsset(convertContractAssetComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.Contract.ActionComponent t : src.getAction()) tgt.addAction(convertActionComponent(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r4.model.Contract.SecurityLabelComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r5.model.Contract.SecurityLabelComponent(); + copyElement(src, tgt); + if (src.hasNumber()) { + for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getNumber()) tgt.getNumber().add(convertUnsignedInt(t)); + } + if (src.hasClassification()) + tgt.setClassification(convertCoding(src.getClassification())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCategory()) tgt.addCategory(convertCoding(t)); + } + if (src.hasControl()) { + for (org.hl7.fhir.r4.model.Coding t : src.getControl()) tgt.addControl(convertCoding(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r5.model.Contract.SecurityLabelComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r4.model.Contract.SecurityLabelComponent(); + copyElement(src, tgt); + if (src.hasNumber()) { + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getNumber()) tgt.getNumber().add(convertUnsignedInt(t)); + } + if (src.hasClassification()) + tgt.setClassification(convertCoding(src.getClassification())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCategory()) tgt.addCategory(convertCoding(t)); + } + if (src.hasControl()) { + for (org.hl7.fhir.r5.model.Coding t : src.getControl()) tgt.addControl(convertCoding(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r4.model.Contract.ContractOfferComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractOfferComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasParty()) { + for (org.hl7.fhir.r4.model.Contract.ContractPartyComponent t : src.getParty()) tgt.addParty(convertContractPartyComponent(t)); + } + if (src.hasTopic()) + tgt.setTopic(convertReference(src.getTopic())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDecision()) + tgt.setDecision(convertCodeableConcept(src.getDecision())); + if (src.hasDecisionMode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDecisionMode()) tgt.addDecisionMode(convertCodeableConcept(t)); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.r4.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + } + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r5.model.Contract.ContractOfferComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractOfferComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasParty()) { + for (org.hl7.fhir.r5.model.Contract.ContractPartyComponent t : src.getParty()) tgt.addParty(convertContractPartyComponent(t)); + } + if (src.hasTopic()) + tgt.setTopic(convertReference(src.getTopic())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDecision()) + tgt.setDecision(convertCodeableConcept(src.getDecision())); + if (src.hasDecisionMode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDecisionMode()) tgt.addDecisionMode(convertCodeableConcept(t)); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + } + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r4.model.Contract.ContractPartyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractPartyComponent(); + copyElement(src, tgt); + if (src.hasReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReference()) tgt.addReference(convertReference(t)); + } + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r5.model.Contract.ContractPartyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractPartyComponent(); + copyElement(src, tgt); + if (src.hasReference()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(convertReference(t)); + } + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r4.model.Contract.AnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r5.model.Contract.AnswerComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r5.model.Contract.AnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r4.model.Contract.AnswerComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r4.model.Contract.ContractAssetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractAssetComponent(); + copyElement(src, tgt); + if (src.hasScope()) + tgt.setScope(convertCodeableConcept(src.getScope())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasTypeReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getTypeReference()) tgt.addTypeReference(convertReference(t)); + } + if (src.hasSubtype()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubtype()) tgt.addSubtype(convertCodeableConcept(t)); + } + if (src.hasRelationship()) + tgt.setRelationship(convertCoding(src.getRelationship())); + if (src.hasContext()) { + for (org.hl7.fhir.r4.model.Contract.AssetContextComponent t : src.getContext()) tgt.addContext(convertAssetContextComponent(t)); + } + if (src.hasCondition()) + tgt.setConditionElement(convertString(src.getConditionElement())); + if (src.hasPeriodType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPeriodType()) tgt.addPeriodType(convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + for (org.hl7.fhir.r4.model.Period t : src.getPeriod()) tgt.addPeriod(convertPeriod(t)); + } + if (src.hasUsePeriod()) { + for (org.hl7.fhir.r4.model.Period t : src.getUsePeriod()) tgt.addUsePeriod(convertPeriod(t)); + } + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.r4.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + if (src.hasValuedItem()) { + for (org.hl7.fhir.r4.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r5.model.Contract.ContractAssetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractAssetComponent(); + copyElement(src, tgt); + if (src.hasScope()) + tgt.setScope(convertCodeableConcept(src.getScope())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasTypeReference()) { + for (org.hl7.fhir.r5.model.Reference t : src.getTypeReference()) tgt.addTypeReference(convertReference(t)); + } + if (src.hasSubtype()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubtype()) tgt.addSubtype(convertCodeableConcept(t)); + } + if (src.hasRelationship()) + tgt.setRelationship(convertCoding(src.getRelationship())); + if (src.hasContext()) { + for (org.hl7.fhir.r5.model.Contract.AssetContextComponent t : src.getContext()) tgt.addContext(convertAssetContextComponent(t)); + } + if (src.hasCondition()) + tgt.setConditionElement(convertString(src.getConditionElement())); + if (src.hasPeriodType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPeriodType()) tgt.addPeriodType(convertCodeableConcept(t)); + } + if (src.hasPeriod()) { + for (org.hl7.fhir.r5.model.Period t : src.getPeriod()) tgt.addPeriod(convertPeriod(t)); + } + if (src.hasUsePeriod()) { + for (org.hl7.fhir.r5.model.Period t : src.getUsePeriod()) tgt.addUsePeriod(convertPeriod(t)); + } + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasAnswer()) { + for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + if (src.hasValuedItem()) { + for (org.hl7.fhir.r5.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r4.model.Contract.AssetContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r5.model.Contract.AssetContextComponent(); + copyElement(src, tgt); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r5.model.Contract.AssetContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r4.model.Contract.AssetContextComponent(); + copyElement(src, tgt); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r4.model.Contract.ValuedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r5.model.Contract.ValuedItemComponent(); + copyElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(convertType(src.getEntity())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasEffectiveTime()) + tgt.setEffectiveTimeElement(convertDateTime(src.getEffectiveTimeElement())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasPoints()) + tgt.setPointsElement(convertDecimal(src.getPointsElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasPayment()) + tgt.setPaymentElement(convertString(src.getPaymentElement())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(convertDateTime(src.getPaymentDateElement())); + if (src.hasResponsible()) + tgt.setResponsible(convertReference(src.getResponsible())); + if (src.hasRecipient()) + tgt.setRecipient(convertReference(src.getRecipient())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r5.model.Contract.ValuedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r4.model.Contract.ValuedItemComponent(); + copyElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(convertType(src.getEntity())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasEffectiveTime()) + tgt.setEffectiveTimeElement(convertDateTime(src.getEffectiveTimeElement())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasPoints()) + tgt.setPointsElement(convertDecimal(src.getPointsElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasPayment()) + tgt.setPaymentElement(convertString(src.getPaymentElement())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(convertDateTime(src.getPaymentDateElement())); + if (src.hasResponsible()) + tgt.setResponsible(convertReference(src.getResponsible())); + if (src.hasRecipient()) + tgt.setRecipient(convertReference(src.getRecipient())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r4.model.Contract.ActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ActionComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionComponent(); + copyElement(src, tgt); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) { + for (org.hl7.fhir.r4.model.Contract.ActionSubjectComponent t : src.getSubject()) tgt.addSubject(convertActionSubjectComponent(t)); + } + if (src.hasIntent()) + tgt.setIntent(convertCodeableConcept(src.getIntent())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCodeableConcept(src.getStatus())); + if (src.hasContext()) + tgt.setContext(convertReference(src.getContext())); + if (src.hasContextLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getContextLinkId()) tgt.getContextLinkId().add(convertString(t)); + } + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasRequester()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRequester()) tgt.addRequester(convertReference(t)); + } + if (src.hasRequesterLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getRequesterLinkId()) tgt.getRequesterLinkId().add(convertString(t)); + } + if (src.hasPerformerType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPerformerType()) tgt.addPerformerType(convertCodeableConcept(t)); + } + if (src.hasPerformerRole()) + tgt.setPerformerRole(convertCodeableConcept(src.getPerformerRole())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasPerformerLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getPerformerLinkId()) tgt.getPerformerLinkId().add(convertString(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasReasonLinkId()) { + for (org.hl7.fhir.r4.model.StringType t : src.getReasonLinkId()) tgt.getReasonLinkId().add(convertString(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r5.model.Contract.ActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ActionComponent tgt = new org.hl7.fhir.r4.model.Contract.ActionComponent(); + copyElement(src, tgt); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) { + for (org.hl7.fhir.r5.model.Contract.ActionSubjectComponent t : src.getSubject()) tgt.addSubject(convertActionSubjectComponent(t)); + } + if (src.hasIntent()) + tgt.setIntent(convertCodeableConcept(src.getIntent())); + if (src.hasLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(convertString(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCodeableConcept(src.getStatus())); + if (src.hasContext()) + tgt.setContext(convertReference(src.getContext())); + if (src.hasContextLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getContextLinkId()) tgt.getContextLinkId().add(convertString(t)); + } + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasRequester()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRequester()) tgt.addRequester(convertReference(t)); + } + if (src.hasRequesterLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getRequesterLinkId()) tgt.getRequesterLinkId().add(convertString(t)); + } + if (src.hasPerformerType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType()) tgt.addPerformerType(convertCodeableConcept(t)); + } + if (src.hasPerformerRole()) + tgt.setPerformerRole(convertCodeableConcept(src.getPerformerRole())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasPerformerLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getPerformerLinkId()) tgt.getPerformerLinkId().add(convertString(t)); + } + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasReasonLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId()) tgt.getReason().add(convertString(t)); + } + if (src.hasReasonLinkId()) { + for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId()) tgt.getReasonLinkId().add(convertString(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasSecurityLabelNumber()) { + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) tgt.getSecurityLabelNumber().add(convertUnsignedInt(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r4.model.Contract.ActionSubjectComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionSubjectComponent(); + copyElement(src, tgt); + if (src.hasReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReference()) tgt.addReference(convertReference(t)); + } + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r5.model.Contract.ActionSubjectComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r4.model.Contract.ActionSubjectComponent(); + copyElement(src, tgt); + if (src.hasReference()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(convertReference(t)); + } + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r4.model.Contract.SignatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r5.model.Contract.SignatoryComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + if (src.hasSignature()) { + for (org.hl7.fhir.r4.model.Signature t : src.getSignature()) tgt.addSignature(convertSignature(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r5.model.Contract.SignatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r4.model.Contract.SignatoryComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + if (src.hasSignature()) { + for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) tgt.addSignature(convertSignature(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent(); + copyElement(src, tgt); + if (src.hasContent()) + tgt.setContent(convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent(); + copyElement(src, tgt); + if (src.hasContent()) + tgt.setContent(convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r4.model.Contract.LegalLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.LegalLanguageComponent(); + copyElement(src, tgt); + if (src.hasContent()) + tgt.setContent(convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r5.model.Contract.LegalLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.LegalLanguageComponent(); + copyElement(src, tgt); + if (src.hasContent()) + tgt.setContent(convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent(); + copyElement(src, tgt); + if (src.hasContent()) + tgt.setContent(convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent(); + copyElement(src, tgt); + if (src.hasContent()) + tgt.setContent(convertType(src.getContent())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Coverage.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Coverage.java index 21afaf051..358187064 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Coverage.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Coverage.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,199 +50,216 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Coverage extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Coverage convertCoverage(org.hl7.fhir.r4.model.Coverage src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Coverage tgt = new org.hl7.fhir.r5.model.Coverage(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertCoverageStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasPolicyHolder()) - tgt.setPolicyHolder(convertReference(src.getPolicyHolder())); - if (src.hasSubscriber()) - tgt.setSubscriber(convertReference(src.getSubscriber())); - if (src.hasSubscriberId()) - tgt.getSubscriberId().setValueElement(convertString(src.getSubscriberIdElement())); - if (src.hasBeneficiary()) - tgt.setBeneficiary(convertReference(src.getBeneficiary())); - if (src.hasDependent()) - tgt.setDependentElement(convertString(src.getDependentElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getPayor()) - tgt.addPayor(convertReference(t)); - for (org.hl7.fhir.r4.model.Coverage.ClassComponent t : src.getClass_()) - tgt.addClass_(convertClassComponent(t)); - if (src.hasOrder()) - tgt.setOrderElement(convertPositiveInt(src.getOrderElement())); - if (src.hasNetwork()) - tgt.setNetworkElement(convertString(src.getNetworkElement())); - for (org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary()) - tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t)); - if (src.hasSubrogation()) - tgt.setSubrogationElement(convertBoolean(src.getSubrogationElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getContract()) - tgt.addContract(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Coverage convertCoverage(org.hl7.fhir.r5.model.Coverage src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Coverage tgt = new org.hl7.fhir.r4.model.Coverage(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertCoverageStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasPolicyHolder()) - tgt.setPolicyHolder(convertReference(src.getPolicyHolder())); - if (src.hasSubscriber()) - tgt.setSubscriber(convertReference(src.getSubscriber())); - if (src.hasSubscriberId()) - tgt.setSubscriberIdElement(convertString(src.getSubscriberId().getValueElement())); - if (src.hasBeneficiary()) - tgt.setBeneficiary(convertReference(src.getBeneficiary())); - if (src.hasDependent()) - tgt.setDependentElement(convertString(src.getDependentElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getPayor()) - tgt.addPayor(convertReference(t)); - for (org.hl7.fhir.r5.model.Coverage.ClassComponent t : src.getClass_()) - tgt.addClass_(convertClassComponent(t)); - if (src.hasOrder()) - tgt.setOrderElement(convertPositiveInt(src.getOrderElement())); - if (src.hasNetwork()) - tgt.setNetworkElement(convertString(src.getNetworkElement())); - for (org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary()) - tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t)); - if (src.hasSubrogation()) - tgt.setSubrogationElement(convertBoolean(src.getSubrogationElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getContract()) - tgt.addContract(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertCoverageStatus(org.hl7.fhir.r4.model.Coverage.CoverageStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Coverage.CoverageStatus convertCoverageStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r4.model.Coverage.ClassComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r5.model.Coverage.ClassComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r5.model.Coverage.ClassComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r4.model.Coverage.ClassComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - for (org.hl7.fhir.r4.model.Coverage.ExemptionComponent t : src.getException()) - tgt.addException(convertExemptionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - for (org.hl7.fhir.r5.model.Coverage.ExemptionComponent t : src.getException()) - tgt.addException(convertExemptionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r4.model.Coverage.ExemptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r5.model.Coverage.ExemptionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r5.model.Coverage.ExemptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r4.model.Coverage.ExemptionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } + public static org.hl7.fhir.r5.model.Coverage convertCoverage(org.hl7.fhir.r4.model.Coverage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage tgt = new org.hl7.fhir.r5.model.Coverage(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCoverageStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasPolicyHolder()) + tgt.setPolicyHolder(convertReference(src.getPolicyHolder())); + if (src.hasSubscriber()) + tgt.setSubscriber(convertReference(src.getSubscriber())); + if (src.hasSubscriberId()) + tgt.getSubscriberId().setValueElement(convertString(src.getSubscriberIdElement())); + if (src.hasBeneficiary()) + tgt.setBeneficiary(convertReference(src.getBeneficiary())); + if (src.hasDependent()) + tgt.setDependentElement(convertString(src.getDependentElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasPayor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPayor()) tgt.addPayor(convertReference(t)); + } + if (src.hasClass_()) { + for (org.hl7.fhir.r4.model.Coverage.ClassComponent t : src.getClass_()) tgt.addClass_(convertClassComponent(t)); + } + if (src.hasOrder()) + tgt.setOrderElement(convertPositiveInt(src.getOrderElement())); + if (src.hasNetwork()) + tgt.setNetworkElement(convertString(src.getNetworkElement())); + if (src.hasCostToBeneficiary()) { + for (org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary()) tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t)); + } + if (src.hasSubrogation()) + tgt.setSubrogationElement(convertBoolean(src.getSubrogationElement())); + if (src.hasContract()) { + for (org.hl7.fhir.r4.model.Reference t : src.getContract()) tgt.addContract(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Coverage convertCoverage(org.hl7.fhir.r5.model.Coverage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Coverage tgt = new org.hl7.fhir.r4.model.Coverage(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertCoverageStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasPolicyHolder()) + tgt.setPolicyHolder(convertReference(src.getPolicyHolder())); + if (src.hasSubscriber()) + tgt.setSubscriber(convertReference(src.getSubscriber())); + if (src.hasSubscriberId()) + tgt.setSubscriberIdElement(convertString(src.getSubscriberId().getValueElement())); + if (src.hasBeneficiary()) + tgt.setBeneficiary(convertReference(src.getBeneficiary())); + if (src.hasDependent()) + tgt.setDependentElement(convertString(src.getDependentElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasPayor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPayor()) tgt.addPayor(convertReference(t)); + } + if (src.hasClass_()) { + for (org.hl7.fhir.r5.model.Coverage.ClassComponent t : src.getClass_()) tgt.addClass_(convertClassComponent(t)); + } + if (src.hasOrder()) + tgt.setOrderElement(convertPositiveInt(src.getOrderElement())); + if (src.hasNetwork()) + tgt.setNetworkElement(convertString(src.getNetworkElement())); + if (src.hasCostToBeneficiary()) { + for (org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary()) tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t)); + } + if (src.hasSubrogation()) + tgt.setSubrogationElement(convertBoolean(src.getSubrogationElement())); + if (src.hasContract()) { + for (org.hl7.fhir.r5.model.Reference t : src.getContract()) tgt.addContract(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertCoverageStatus(org.hl7.fhir.r4.model.Coverage.CoverageStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Coverage.CoverageStatus convertCoverageStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Coverage.CoverageStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.Coverage.CoverageStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.Coverage.CoverageStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Coverage.CoverageStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Coverage.CoverageStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r4.model.Coverage.ClassComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r5.model.Coverage.ClassComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r5.model.Coverage.ClassComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r4.model.Coverage.ClassComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasException()) { + for (org.hl7.fhir.r4.model.Coverage.ExemptionComponent t : src.getException()) tgt.addException(convertExemptionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasException()) { + for (org.hl7.fhir.r5.model.Coverage.ExemptionComponent t : src.getException()) tgt.addException(convertExemptionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r4.model.Coverage.ExemptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r5.model.Coverage.ExemptionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r5.model.Coverage.ExemptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r4.model.Coverage.ExemptionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java index 969fa6323..0f10f9910 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,263 +50,296 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CoverageEligibilityRequest extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r4.model.CoverageEligibilityRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEligibilityRequestStatus(src.getStatus())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getPurpose()) - copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityRequestPurpose(t.getValue()))); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertSupportingInformationComponent(t)); - for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem()) - tgt.addItem(convertDetailsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r5.model.CoverageEligibilityRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEligibilityRequestStatus(src.getStatus())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getPurpose()) - copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityRequestPurpose(t.getValue()))); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertSupportingInformationComponent(t)); - for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem()) - tgt.addItem(convertDetailsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEligibilityRequestStatus(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus convertEligibilityRequestStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose convertEligibilityRequestPurpose(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AUTHREQUIREMENTS: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS; - case BENEFITS: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS; - case DISCOVERY: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY; - case VALIDATION: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION; - default: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL; - } -} - - public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose convertEligibilityRequestPurpose(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AUTHREQUIREMENTS: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS; - case BENEFITS: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS; - case DISCOVERY: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY; - case VALIDATION: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION; - default: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL; - } -} - - public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasInformation()) - tgt.setInformation(convertReference(src.getInformation())); - if (src.hasAppliesToAll()) - tgt.setAppliesToAllElement(convertBoolean(src.getAppliesToAllElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasInformation()) - tgt.setInformation(convertReference(src.getInformation())); - if (src.hasAppliesToAll()) - tgt.setAppliesToAllElement(convertBoolean(src.getAppliesToAllElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasBusinessArrangement()) - tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasBusinessArrangement()) - tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSupportingInfoSequence()) - tgt.getSupportingInfoSequence().add(convertPositiveInt(t)); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSupportingInfoSequence()) - tgt.getSupportingInfoSequence().add(convertPositiveInt(t)); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasDiagnosis()) - tgt.setDiagnosis(convertType(src.getDiagnosis())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasDiagnosis()) - tgt.setDiagnosis(convertType(src.getDiagnosis())); - return tgt; - } + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r4.model.CoverageEligibilityRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEligibilityRequestStatus(src.getStatus())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasPurpose()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getPurpose()) copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityRequestPurpose(t.getValue()))); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo()) tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem()) tgt.addItem(convertDetailsComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r5.model.CoverageEligibilityRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEligibilityRequestStatus(src.getStatus())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasPurpose()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getPurpose()) copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityRequestPurpose(t.getValue()))); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo()) tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem()) tgt.addItem(convertDetailsComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEligibilityRequestStatus(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus convertEligibilityRequestStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose convertEligibilityRequestPurpose(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AUTHREQUIREMENTS: + return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS; + case BENEFITS: + return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS; + case DISCOVERY: + return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY; + case VALIDATION: + return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION; + default: + return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL; + } + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose convertEligibilityRequestPurpose(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AUTHREQUIREMENTS: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS; + case BENEFITS: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS; + case DISCOVERY: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY; + case VALIDATION: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION; + default: + return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL; + } + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasInformation()) + tgt.setInformation(convertReference(src.getInformation())); + if (src.hasAppliesToAll()) + tgt.setAppliesToAllElement(convertBoolean(src.getAppliesToAllElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasInformation()) + tgt.setInformation(convertReference(src.getInformation())); + if (src.hasAppliesToAll()) + tgt.setAppliesToAllElement(convertBoolean(src.getAppliesToAllElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent(); + copyElement(src, tgt); + if (src.hasSupportingInfoSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSupportingInfoSequence()) tgt.getSupportingInfoSequence().add(convertPositiveInt(t)); + } + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent(); + copyElement(src, tgt); + if (src.hasSupportingInfoSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSupportingInfoSequence()) tgt.getSupportingInfoSequence().add(convertPositiveInt(t)); + } + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasDiagnosis()) + tgt.setDiagnosis(convertType(src.getDiagnosis())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasDiagnosis()) + tgt.setDiagnosis(convertType(src.getDiagnosis())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java index eaf9bb1ea..8edbf96df 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,311 +50,352 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class CoverageEligibilityResponse extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.CoverageEligibilityResponse convertCoverageEligibilityResponse(org.hl7.fhir.r4.model.CoverageEligibilityResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityResponse tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEligibilityResponseStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getPurpose()) - copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityResponsePurpose(t.getValue()))); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasRequestor()) - tgt.setRequestor(convertReference(src.getRequestor())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - if (src.hasPreAuthRef()) - tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); - if (src.hasForm()) - tgt.setForm(convertCodeableConcept(src.getForm())); - for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent t : src.getError()) - tgt.addError(convertErrorsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityResponse convertCoverageEligibilityResponse(org.hl7.fhir.r5.model.CoverageEligibilityResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityResponse tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEligibilityResponseStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getPurpose()) - copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityResponsePurpose(t.getValue()))); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasRequestor()) - tgt.setRequestor(convertReference(src.getRequestor())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - if (src.hasPreAuthRef()) - tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); - if (src.hasForm()) - tgt.setForm(convertCodeableConcept(src.getForm())); - for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent t : src.getError()) - tgt.addError(convertErrorsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEligibilityResponseStatus(org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus convertEligibilityResponseStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose convertEligibilityResponsePurpose(org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AUTHREQUIREMENTS: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.AUTHREQUIREMENTS; - case BENEFITS: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.BENEFITS; - case DISCOVERY: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.DISCOVERY; - case VALIDATION: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.VALIDATION; - default: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.NULL; - } -} - - public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose convertEligibilityResponsePurpose(org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AUTHREQUIREMENTS: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.AUTHREQUIREMENTS; - case BENEFITS: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.BENEFITS; - case DISCOVERY: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.DISCOVERY; - case VALIDATION: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.VALIDATION; - default: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; - case COMPLETE: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; - case ERROR: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; - case PARTIAL: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; - default: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED; - case COMPLETE: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE; - case ERROR: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR; - case PARTIAL: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL; - default: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL; - } -} - - public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasInforce()) - tgt.setInforceElement(convertBoolean(src.getInforceElement())); - if (src.hasBenefitPeriod()) - tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); - for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent t : src.getItem()) - tgt.addItem(convertItemsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - if (src.hasInforce()) - tgt.setInforceElement(convertBoolean(src.getInforceElement())); - if (src.hasBenefitPeriod()) - tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); - for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent t : src.getItem()) - tgt.addItem(convertItemsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent convertItemsComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasExcluded()) - tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasNetwork()) - tgt.setNetwork(convertCodeableConcept(src.getNetwork())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasTerm()) - tgt.setTerm(convertCodeableConcept(src.getTerm())); - for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent t : src.getBenefit()) - tgt.addBenefit(convertBenefitComponent(t)); - if (src.hasAuthorizationRequired()) - tgt.setAuthorizationRequiredElement(convertBoolean(src.getAuthorizationRequiredElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAuthorizationSupporting()) - tgt.addAuthorizationSupporting(convertCodeableConcept(t)); - if (src.hasAuthorizationUrl()) - tgt.setAuthorizationUrlElement(convertUri(src.getAuthorizationUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent convertItemsComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasExcluded()) - tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasNetwork()) - tgt.setNetwork(convertCodeableConcept(src.getNetwork())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasTerm()) - tgt.setTerm(convertCodeableConcept(src.getTerm())); - for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent t : src.getBenefit()) - tgt.addBenefit(convertBenefitComponent(t)); - if (src.hasAuthorizationRequired()) - tgt.setAuthorizationRequiredElement(convertBoolean(src.getAuthorizationRequiredElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorizationSupporting()) - tgt.addAuthorizationSupporting(convertCodeableConcept(t)); - if (src.hasAuthorizationUrl()) - tgt.setAuthorizationUrlElement(convertUri(src.getAuthorizationUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent convertBenefitComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAllowed()) - tgt.setAllowed(convertType(src.getAllowed())); - if (src.hasUsed()) - tgt.setUsed(convertType(src.getUsed())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent convertBenefitComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAllowed()) - tgt.setAllowed(convertType(src.getAllowed())); - if (src.hasUsed()) - tgt.setUsed(convertType(src.getUsed())); - return tgt; - } - - public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent convertErrorsComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - return tgt; - } - - public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent convertErrorsComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - return tgt; - } + public static org.hl7.fhir.r5.model.CoverageEligibilityResponse convertCoverageEligibilityResponse(org.hl7.fhir.r4.model.CoverageEligibilityResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityResponse tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEligibilityResponseStatus(src.getStatus())); + if (src.hasPurpose()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getPurpose()) copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityResponsePurpose(t.getValue()))); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasRequestor()) + tgt.setRequestor(convertReference(src.getRequestor())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasPreAuthRef()) + tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); + if (src.hasForm()) + tgt.setForm(convertCodeableConcept(src.getForm())); + if (src.hasError()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent t : src.getError()) tgt.addError(convertErrorsComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.CoverageEligibilityResponse convertCoverageEligibilityResponse(org.hl7.fhir.r5.model.CoverageEligibilityResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityResponse tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEligibilityResponseStatus(src.getStatus())); + if (src.hasPurpose()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getPurpose()) copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityResponsePurpose(t.getValue()))); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasRequestor()) + tgt.setRequestor(convertReference(src.getRequestor())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasPreAuthRef()) + tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement())); + if (src.hasForm()) + tgt.setForm(convertCodeableConcept(src.getForm())); + if (src.hasError()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent t : src.getError()) tgt.addError(convertErrorsComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEligibilityResponseStatus(org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus convertEligibilityResponseStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose convertEligibilityResponsePurpose(org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AUTHREQUIREMENTS: + return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.AUTHREQUIREMENTS; + case BENEFITS: + return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.BENEFITS; + case DISCOVERY: + return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.DISCOVERY; + case VALIDATION: + return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.VALIDATION; + default: + return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.NULL; + } + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose convertEligibilityResponsePurpose(org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AUTHREQUIREMENTS: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.AUTHREQUIREMENTS; + case BENEFITS: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.BENEFITS; + case DISCOVERY: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.DISCOVERY; + case VALIDATION: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.VALIDATION; + default: + return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; + case COMPLETE: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; + case ERROR: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; + case PARTIAL: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; + default: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED; + case COMPLETE: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE; + case ERROR: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR; + case PARTIAL: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL; + default: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL; + } + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasInforce()) + tgt.setInforceElement(convertBoolean(src.getInforceElement())); + if (src.hasBenefitPeriod()) + tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent t : src.getItem()) tgt.addItem(convertItemsComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasInforce()) + tgt.setInforceElement(convertBoolean(src.getInforceElement())); + if (src.hasBenefitPeriod()) + tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent t : src.getItem()) tgt.addItem(convertItemsComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent convertItemsComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasExcluded()) + tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasNetwork()) + tgt.setNetwork(convertCodeableConcept(src.getNetwork())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasTerm()) + tgt.setTerm(convertCodeableConcept(src.getTerm())); + if (src.hasBenefit()) { + for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent t : src.getBenefit()) tgt.addBenefit(convertBenefitComponent(t)); + } + if (src.hasAuthorizationRequired()) + tgt.setAuthorizationRequiredElement(convertBoolean(src.getAuthorizationRequiredElement())); + if (src.hasAuthorizationSupporting()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAuthorizationSupporting()) tgt.addAuthorizationSupporting(convertCodeableConcept(t)); + } + if (src.hasAuthorizationUrl()) + tgt.setAuthorizationUrlElement(convertUri(src.getAuthorizationUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent convertItemsComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasExcluded()) + tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasNetwork()) + tgt.setNetwork(convertCodeableConcept(src.getNetwork())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasTerm()) + tgt.setTerm(convertCodeableConcept(src.getTerm())); + if (src.hasBenefit()) { + for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent t : src.getBenefit()) tgt.addBenefit(convertBenefitComponent(t)); + } + if (src.hasAuthorizationRequired()) + tgt.setAuthorizationRequiredElement(convertBoolean(src.getAuthorizationRequiredElement())); + if (src.hasAuthorizationSupporting()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorizationSupporting()) tgt.addAuthorizationSupporting(convertCodeableConcept(t)); + } + if (src.hasAuthorizationUrl()) + tgt.setAuthorizationUrlElement(convertUri(src.getAuthorizationUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent convertBenefitComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowed(convertType(src.getAllowed())); + if (src.hasUsed()) + tgt.setUsed(convertType(src.getUsed())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent convertBenefitComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowed(convertType(src.getAllowed())); + if (src.hasUsed()) + tgt.setUsed(convertType(src.getUsed())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent convertErrorsComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + return tgt; + } + + public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent convertErrorsComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DetectedIssue.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DetectedIssue.java index 8e800f29f..51cb01a50 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DetectedIssue.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DetectedIssue.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,181 +50,214 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DetectedIssue extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r4.model.DetectedIssue src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DetectedIssue tgt = new org.hl7.fhir.r5.model.DetectedIssue(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertDetectedIssueStatus(src.getStatus())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSeverity()) - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasIdentified()) - tgt.setIdentified(convertType(src.getIdentified())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (org.hl7.fhir.r4.model.Reference t : src.getImplicated()) - tgt.addImplicated(convertReference(t)); - for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence()) - tgt.addEvidence(convertDetectedIssueEvidenceComponent(t)); - if (src.hasDetail()) - tgt.setDetailElement(convertString(src.getDetailElement())); - if (src.hasReference()) - tgt.setReferenceElement(convertUri(src.getReferenceElement())); - for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) - tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r5.model.DetectedIssue src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DetectedIssue tgt = new org.hl7.fhir.r4.model.DetectedIssue(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertDetectedIssueStatus(src.getStatus())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSeverity()) - tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasIdentified()) - tgt.setIdentified(convertType(src.getIdentified())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) - tgt.addImplicated(convertReference(t)); - for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence()) - tgt.addEvidence(convertDetectedIssueEvidenceComponent(t)); - if (src.hasDetail()) - tgt.setDetailElement(convertString(src.getDetailElement())); - if (src.hasReference()) - tgt.setReferenceElement(convertUri(src.getReferenceElement())); - for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) - tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ObservationStatus convertDetectedIssueStatus(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED; - case PRELIMINARY: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL; - case AMENDED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus convertDetectedIssueStatus(org.hl7.fhir.r5.model.Enumerations.ObservationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.REGISTERED; - case PRELIMINARY: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.FINAL; - case AMENDED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CORRECTED; - case CANCELLED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity convertDetectedIssueSeverity(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case HIGH: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH; - case MODERATE: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE; - case LOW: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW; - default: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL; - } -} - - public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity convertDetectedIssueSeverity(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case HIGH: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH; - case MODERATE: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE; - case LOW: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW; - default: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL; - } -} - - public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) - tgt.addDetail(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent(); - copyElement(src, tgt); - if (src.hasAction()) - tgt.setAction(convertCodeableConcept(src.getAction())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent(); - copyElement(src, tgt); - if (src.hasAction()) - tgt.setAction(convertCodeableConcept(src.getAction())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - return tgt; - } + public static org.hl7.fhir.r5.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r4.model.DetectedIssue src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DetectedIssue tgt = new org.hl7.fhir.r5.model.DetectedIssue(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertDetectedIssueStatus(src.getStatus())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSeverity()) + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasIdentified()) + tgt.setIdentified(convertType(src.getIdentified())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasImplicated()) { + for (org.hl7.fhir.r4.model.Reference t : src.getImplicated()) tgt.addImplicated(convertReference(t)); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertDetectedIssueEvidenceComponent(t)); + } + if (src.hasDetail()) + tgt.setDetailElement(convertString(src.getDetailElement())); + if (src.hasReference()) + tgt.setReferenceElement(convertUri(src.getReferenceElement())); + if (src.hasMitigation()) { + for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r5.model.DetectedIssue src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DetectedIssue tgt = new org.hl7.fhir.r4.model.DetectedIssue(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertDetectedIssueStatus(src.getStatus())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSeverity()) + tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasIdentified()) + tgt.setIdentified(convertType(src.getIdentified())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasImplicated()) { + for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) tgt.addImplicated(convertReference(t)); + } + if (src.hasEvidence()) { + for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertDetectedIssueEvidenceComponent(t)); + } + if (src.hasDetail()) + tgt.setDetailElement(convertString(src.getDetailElement())); + if (src.hasReference()) + tgt.setReferenceElement(convertUri(src.getReferenceElement())); + if (src.hasMitigation()) { + for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.ObservationStatus convertDetectedIssueStatus(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED; + case PRELIMINARY: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus convertDetectedIssueStatus(org.hl7.fhir.r5.model.Enumerations.ObservationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.REGISTERED; + case PRELIMINARY: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CORRECTED; + case CANCELLED: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity convertDetectedIssueSeverity(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case HIGH: + return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH; + case MODERATE: + return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE; + case LOW: + return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW; + default: + return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL; + } + } + + public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity convertDetectedIssueSeverity(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case HIGH: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH; + case MODERATE: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE; + case LOW: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW; + default: + return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL; + } + } + + public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent(); + copyElement(src, tgt); + if (src.hasAction()) + tgt.setAction(convertCodeableConcept(src.getAction())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent(); + copyElement(src, tgt); + if (src.hasAction()) + tgt.setAction(convertCodeableConcept(src.getAction())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Device.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Device.java index 04af5df23..f0018b5be 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Device.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Device.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,355 +50,412 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Device extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Device convertDevice(org.hl7.fhir.r4.model.Device src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Device tgt = new org.hl7.fhir.r5.model.Device(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasDefinition()) - tgt.setDefinition(convertReference(src.getDefinition())); - for (org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier()) - tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t)); - if (src.hasStatus()) - tgt.setStatus(convertFHIRDeviceStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason()) - tgt.addStatusReason(convertCodeableConcept(t)); - if (src.hasDistinctIdentifier()) - tgt.setDistinctIdentifierElement(convertString(src.getDistinctIdentifierElement())); - if (src.hasManufacturer()) - tgt.setManufacturerElement(convertString(src.getManufacturerElement())); - if (src.hasManufactureDate()) - tgt.setManufactureDateElement(convertDateTime(src.getManufactureDateElement())); - if (src.hasExpirationDate()) - tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); - if (src.hasLotNumber()) - tgt.setLotNumberElement(convertString(src.getLotNumberElement())); - if (src.hasSerialNumber()) - tgt.setSerialNumberElement(convertString(src.getSerialNumberElement())); - for (org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent t : src.getDeviceName()) - tgt.addDeviceName(convertDeviceDeviceNameComponent(t)); - if (src.hasModelNumber()) - tgt.setModelNumberElement(convertString(src.getModelNumberElement())); - if (src.hasPartNumber()) - tgt.setPartNumberElement(convertString(src.getPartNumberElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent t : src.getSpecialization()) - tgt.addSpecialization(convertDeviceSpecializationComponent(t)); - for (org.hl7.fhir.r4.model.Device.DeviceVersionComponent t : src.getVersion()) - tgt.addVersion(convertDeviceVersionComponent(t)); - for (org.hl7.fhir.r4.model.Device.DevicePropertyComponent t : src.getProperty()) - tgt.addProperty(convertDevicePropertyComponent(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) - tgt.addContact(convertContactPoint(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSafety()) - tgt.addSafety(convertCodeableConcept(t)); - if (src.hasParent()) - tgt.setParent(convertReference(src.getParent())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Device convertDevice(org.hl7.fhir.r5.model.Device src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Device tgt = new org.hl7.fhir.r4.model.Device(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasDefinition()) - tgt.setDefinition(convertReference(src.getDefinition())); - for (org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier()) - tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t)); - if (src.hasStatus()) - tgt.setStatus(convertFHIRDeviceStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) - tgt.addStatusReason(convertCodeableConcept(t)); - if (src.hasDistinctIdentifier()) - tgt.setDistinctIdentifierElement(convertString(src.getDistinctIdentifierElement())); - if (src.hasManufacturer()) - tgt.setManufacturerElement(convertString(src.getManufacturerElement())); - if (src.hasManufactureDate()) - tgt.setManufactureDateElement(convertDateTime(src.getManufactureDateElement())); - if (src.hasExpirationDate()) - tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); - if (src.hasLotNumber()) - tgt.setLotNumberElement(convertString(src.getLotNumberElement())); - if (src.hasSerialNumber()) - tgt.setSerialNumberElement(convertString(src.getSerialNumberElement())); - for (org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent t : src.getDeviceName()) - tgt.addDeviceName(convertDeviceDeviceNameComponent(t)); - if (src.hasModelNumber()) - tgt.setModelNumberElement(convertString(src.getModelNumberElement())); - if (src.hasPartNumber()) - tgt.setPartNumberElement(convertString(src.getPartNumberElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent t : src.getSpecialization()) - tgt.addSpecialization(convertDeviceSpecializationComponent(t)); - for (org.hl7.fhir.r5.model.Device.DeviceVersionComponent t : src.getVersion()) - tgt.addVersion(convertDeviceVersionComponent(t)); - for (org.hl7.fhir.r5.model.Device.DevicePropertyComponent t : src.getProperty()) - tgt.addProperty(convertDevicePropertyComponent(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) - tgt.addContact(convertContactPoint(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety()) - tgt.addSafety(convertCodeableConcept(t)); - if (src.hasParent()) - tgt.setParent(convertReference(src.getParent())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Device.FHIRDeviceStatus convertFHIRDeviceStatus(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Device.FHIRDeviceStatus convertFHIRDeviceStatus(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent(); - copyElement(src, tgt); - if (src.hasDeviceIdentifier()) - tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); - if (src.hasIssuer()) - tgt.setIssuerElement(convertUri(src.getIssuerElement())); - if (src.hasJurisdiction()) - tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); - if (src.hasCarrierAIDC()) - tgt.setCarrierAIDCElement(convertBase64Binary(src.getCarrierAIDCElement())); - if (src.hasCarrierHRF()) - tgt.setCarrierHRFElement(convertString(src.getCarrierHRFElement())); - if (src.hasEntryType()) - tgt.setEntryType(convertUDIEntryType(src.getEntryType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent(); - copyElement(src, tgt); - if (src.hasDeviceIdentifier()) - tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); - if (src.hasIssuer()) - tgt.setIssuerElement(convertUri(src.getIssuerElement())); - if (src.hasJurisdiction()) - tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); - if (src.hasCarrierAIDC()) - tgt.setCarrierAIDCElement(convertBase64Binary(src.getCarrierAIDCElement())); - if (src.hasCarrierHRF()) - tgt.setCarrierHRFElement(convertString(src.getCarrierHRFElement())); - if (src.hasEntryType()) - tgt.setEntryType(convertUDIEntryType(src.getEntryType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Device.UDIEntryType convertUDIEntryType(org.hl7.fhir.r4.model.Device.UDIEntryType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BARCODE: return org.hl7.fhir.r5.model.Device.UDIEntryType.BARCODE; - case RFID: return org.hl7.fhir.r5.model.Device.UDIEntryType.RFID; - case MANUAL: return org.hl7.fhir.r5.model.Device.UDIEntryType.MANUAL; - case CARD: return org.hl7.fhir.r5.model.Device.UDIEntryType.CARD; - case SELFREPORTED: return org.hl7.fhir.r5.model.Device.UDIEntryType.SELFREPORTED; - case UNKNOWN: return org.hl7.fhir.r5.model.Device.UDIEntryType.UNKNOWN; - default: return org.hl7.fhir.r5.model.Device.UDIEntryType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Device.UDIEntryType convertUDIEntryType(org.hl7.fhir.r5.model.Device.UDIEntryType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BARCODE: return org.hl7.fhir.r4.model.Device.UDIEntryType.BARCODE; - case RFID: return org.hl7.fhir.r4.model.Device.UDIEntryType.RFID; - case MANUAL: return org.hl7.fhir.r4.model.Device.UDIEntryType.MANUAL; - case CARD: return org.hl7.fhir.r4.model.Device.UDIEntryType.CARD; - case SELFREPORTED: return org.hl7.fhir.r4.model.Device.UDIEntryType.SELFREPORTED; - case UNKNOWN: return org.hl7.fhir.r4.model.Device.UDIEntryType.UNKNOWN; - default: return org.hl7.fhir.r4.model.Device.UDIEntryType.NULL; - } -} - - public static org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertDeviceNameType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertDeviceNameType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.DeviceNameType convertDeviceNameType(org.hl7.fhir.r4.model.Device.DeviceNameType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UDILABELNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.UDILABELNAME; - case USERFRIENDLYNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME; - case PATIENTREPORTEDNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME; - case MANUFACTURERNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MANUFACTURERNAME; - case MODELNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MODELNAME; - case OTHER: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.OTHER; - default: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Device.DeviceNameType convertDeviceNameType(org.hl7.fhir.r5.model.Enumerations.DeviceNameType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UDILABELNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.UDILABELNAME; - case USERFRIENDLYNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.USERFRIENDLYNAME; - case PATIENTREPORTEDNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.PATIENTREPORTEDNAME; - case MANUFACTURERNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.MANUFACTURERNAME; - case MODELNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.MODELNAME; - case OTHER: return org.hl7.fhir.r4.model.Device.DeviceNameType.OTHER; - default: return org.hl7.fhir.r4.model.Device.DeviceNameType.NULL; - } -} - - public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent(); - copyElement(src, tgt); - if (src.hasSystemType()) - tgt.setSystemType(convertCodeableConcept(src.getSystemType())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent(); - copyElement(src, tgt); - if (src.hasSystemType()) - tgt.setSystemType(convertCodeableConcept(src.getSystemType())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r4.model.Device.DeviceVersionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceVersionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasComponent()) - tgt.setComponent(convertIdentifier(src.getComponent())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r5.model.Device.DeviceVersionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceVersionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasComponent()) - tgt.setComponent(convertIdentifier(src.getComponent())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r4.model.Device.DevicePropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r5.model.Device.DevicePropertyComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.Quantity t : src.getValueQuantity()) - tgt.addValueQuantity(convertQuantity(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValueCode()) - tgt.addValueCode(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r5.model.Device.DevicePropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r4.model.Device.DevicePropertyComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.Quantity t : src.getValueQuantity()) - tgt.addValueQuantity(convertQuantity(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValueCode()) - tgt.addValueCode(convertCodeableConcept(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Device convertDevice(org.hl7.fhir.r4.model.Device src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device tgt = new org.hl7.fhir.r5.model.Device(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasDefinition()) + tgt.setDefinition(convertReference(src.getDefinition())); + if (src.hasUdiCarrier()) { + for (org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier()) tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFHIRDeviceStatus(src.getStatus())); + if (src.hasStatusReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason()) tgt.addStatusReason(convertCodeableConcept(t)); + } + if (src.hasDistinctIdentifier()) + tgt.setDistinctIdentifierElement(convertString(src.getDistinctIdentifierElement())); + if (src.hasManufacturer()) + tgt.setManufacturerElement(convertString(src.getManufacturerElement())); + if (src.hasManufactureDate()) + tgt.setManufactureDateElement(convertDateTime(src.getManufactureDateElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(convertString(src.getLotNumberElement())); + if (src.hasSerialNumber()) + tgt.setSerialNumberElement(convertString(src.getSerialNumberElement())); + if (src.hasDeviceName()) { + for (org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent t : src.getDeviceName()) tgt.addDeviceName(convertDeviceDeviceNameComponent(t)); + } + if (src.hasModelNumber()) + tgt.setModelNumberElement(convertString(src.getModelNumberElement())); + if (src.hasPartNumber()) + tgt.setPartNumberElement(convertString(src.getPartNumberElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSpecialization()) { + for (org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent t : src.getSpecialization()) tgt.addSpecialization(convertDeviceSpecializationComponent(t)); + } + if (src.hasVersion()) { + for (org.hl7.fhir.r4.model.Device.DeviceVersionComponent t : src.getVersion()) tgt.addVersion(convertDeviceVersionComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.Device.DevicePropertyComponent t : src.getProperty()) tgt.addProperty(convertDevicePropertyComponent(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(convertContactPoint(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasSafety()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSafety()) tgt.addSafety(convertCodeableConcept(t)); + } + if (src.hasParent()) + tgt.setParent(convertReference(src.getParent())); + return tgt; + } + public static org.hl7.fhir.r4.model.Device convertDevice(org.hl7.fhir.r5.model.Device src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Device tgt = new org.hl7.fhir.r4.model.Device(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasDefinition()) + tgt.setDefinition(convertReference(src.getDefinition())); + if (src.hasUdiCarrier()) { + for (org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier()) tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFHIRDeviceStatus(src.getStatus())); + if (src.hasStatusReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) tgt.addStatusReason(convertCodeableConcept(t)); + } + if (src.hasDistinctIdentifier()) + tgt.setDistinctIdentifierElement(convertString(src.getDistinctIdentifierElement())); + if (src.hasManufacturer()) + tgt.setManufacturerElement(convertString(src.getManufacturerElement())); + if (src.hasManufactureDate()) + tgt.setManufactureDateElement(convertDateTime(src.getManufactureDateElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(convertString(src.getLotNumberElement())); + if (src.hasSerialNumber()) + tgt.setSerialNumberElement(convertString(src.getSerialNumberElement())); + if (src.hasDeviceName()) { + for (org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent t : src.getDeviceName()) tgt.addDeviceName(convertDeviceDeviceNameComponent(t)); + } + if (src.hasModelNumber()) + tgt.setModelNumberElement(convertString(src.getModelNumberElement())); + if (src.hasPartNumber()) + tgt.setPartNumberElement(convertString(src.getPartNumberElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSpecialization()) { + for (org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent t : src.getSpecialization()) tgt.addSpecialization(convertDeviceSpecializationComponent(t)); + } + if (src.hasVersion()) { + for (org.hl7.fhir.r5.model.Device.DeviceVersionComponent t : src.getVersion()) tgt.addVersion(convertDeviceVersionComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.Device.DevicePropertyComponent t : src.getProperty()) tgt.addProperty(convertDevicePropertyComponent(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) tgt.addContact(convertContactPoint(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasSafety()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety()) tgt.addSafety(convertCodeableConcept(t)); + } + if (src.hasParent()) + tgt.setParent(convertReference(src.getParent())); + return tgt; + } + public static org.hl7.fhir.r5.model.Device.FHIRDeviceStatus convertFHIRDeviceStatus(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Device.FHIRDeviceStatus convertFHIRDeviceStatus(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent(); + copyElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); + if (src.hasCarrierAIDC()) + tgt.setCarrierAIDCElement(convertBase64Binary(src.getCarrierAIDCElement())); + if (src.hasCarrierHRF()) + tgt.setCarrierHRFElement(convertString(src.getCarrierHRFElement())); + if (src.hasEntryType()) + tgt.setEntryType(convertUDIEntryType(src.getEntryType())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent(); + copyElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); + if (src.hasCarrierAIDC()) + tgt.setCarrierAIDCElement(convertBase64Binary(src.getCarrierAIDCElement())); + if (src.hasCarrierHRF()) + tgt.setCarrierHRFElement(convertString(src.getCarrierHRFElement())); + if (src.hasEntryType()) + tgt.setEntryType(convertUDIEntryType(src.getEntryType())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Device.UDIEntryType convertUDIEntryType(org.hl7.fhir.r4.model.Device.UDIEntryType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BARCODE: + return org.hl7.fhir.r5.model.Device.UDIEntryType.BARCODE; + case RFID: + return org.hl7.fhir.r5.model.Device.UDIEntryType.RFID; + case MANUAL: + return org.hl7.fhir.r5.model.Device.UDIEntryType.MANUAL; + case CARD: + return org.hl7.fhir.r5.model.Device.UDIEntryType.CARD; + case SELFREPORTED: + return org.hl7.fhir.r5.model.Device.UDIEntryType.SELFREPORTED; + case UNKNOWN: + return org.hl7.fhir.r5.model.Device.UDIEntryType.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Device.UDIEntryType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Device.UDIEntryType convertUDIEntryType(org.hl7.fhir.r5.model.Device.UDIEntryType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BARCODE: + return org.hl7.fhir.r4.model.Device.UDIEntryType.BARCODE; + case RFID: + return org.hl7.fhir.r4.model.Device.UDIEntryType.RFID; + case MANUAL: + return org.hl7.fhir.r4.model.Device.UDIEntryType.MANUAL; + case CARD: + return org.hl7.fhir.r4.model.Device.UDIEntryType.CARD; + case SELFREPORTED: + return org.hl7.fhir.r4.model.Device.UDIEntryType.SELFREPORTED; + case UNKNOWN: + return org.hl7.fhir.r4.model.Device.UDIEntryType.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Device.UDIEntryType.NULL; + } + } + + public static org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertDeviceNameType(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertDeviceNameType(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.DeviceNameType convertDeviceNameType(org.hl7.fhir.r4.model.Device.DeviceNameType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UDILABELNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.UDILABELNAME; + case USERFRIENDLYNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME; + case PATIENTREPORTEDNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME; + case MANUFACTURERNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MANUFACTURERNAME; + case MODELNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MODELNAME; + case OTHER: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.OTHER; + default: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Device.DeviceNameType convertDeviceNameType(org.hl7.fhir.r5.model.Enumerations.DeviceNameType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UDILABELNAME: + return org.hl7.fhir.r4.model.Device.DeviceNameType.UDILABELNAME; + case USERFRIENDLYNAME: + return org.hl7.fhir.r4.model.Device.DeviceNameType.USERFRIENDLYNAME; + case PATIENTREPORTEDNAME: + return org.hl7.fhir.r4.model.Device.DeviceNameType.PATIENTREPORTEDNAME; + case MANUFACTURERNAME: + return org.hl7.fhir.r4.model.Device.DeviceNameType.MANUFACTURERNAME; + case MODELNAME: + return org.hl7.fhir.r4.model.Device.DeviceNameType.MODELNAME; + case OTHER: + return org.hl7.fhir.r4.model.Device.DeviceNameType.OTHER; + default: + return org.hl7.fhir.r4.model.Device.DeviceNameType.NULL; + } + } + + public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent(); + copyElement(src, tgt); + if (src.hasSystemType()) + tgt.setSystemType(convertCodeableConcept(src.getSystemType())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent(); + copyElement(src, tgt); + if (src.hasSystemType()) + tgt.setSystemType(convertCodeableConcept(src.getSystemType())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r4.model.Device.DeviceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceVersionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasComponent()) + tgt.setComponent(convertIdentifier(src.getComponent())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r5.model.Device.DeviceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceVersionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasComponent()) + tgt.setComponent(convertIdentifier(src.getComponent())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r4.model.Device.DevicePropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r5.model.Device.DevicePropertyComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValueQuantity()) { + for (org.hl7.fhir.r4.model.Quantity t : src.getValueQuantity()) tgt.addValueQuantity(convertQuantity(t)); + } + if (src.hasValueCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValueCode()) tgt.addValueCode(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r5.model.Device.DevicePropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r4.model.Device.DevicePropertyComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValueQuantity()) { + for (org.hl7.fhir.r5.model.Quantity t : src.getValueQuantity()) tgt.addValueQuantity(convertQuantity(t)); + } + if (src.hasValueCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValueCode()) tgt.addValueCode(convertCodeableConcept(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceDefinition.java index 9345c2dc2..3027947b4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,299 +50,340 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DeviceDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r4.model.DeviceDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceDefinition tgt = new org.hl7.fhir.r5.model.DeviceDefinition(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier()) - tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t)); - if (src.hasManufacturer()) - tgt.setManufacturer(convertType(src.getManufacturer())); - for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName()) - tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t)); - if (src.hasModelNumber()) - tgt.setModelNumberElement(convertString(src.getModelNumberElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization()) - tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getVersion()) - tgt.getVersion().add(convertString(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSafety()) - tgt.addSafety(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ProductShelfLife t : src.getShelfLifeStorage()) - tgt.addShelfLifeStorage(convertProductShelfLife(t)); - if (src.hasPhysicalCharacteristics()) - tgt.setPhysicalCharacteristics(convertProdCharacteristic(src.getPhysicalCharacteristics())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLanguageCode()) - tgt.addLanguageCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability()) - tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t)); - for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty()) - tgt.addProperty(convertDeviceDefinitionPropertyComponent(t)); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) - tgt.addContact(convertContactPoint(t)); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasOnlineInformation()) - tgt.setOnlineInformationElement(convertUri(src.getOnlineInformationElement())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - if (src.hasParentDevice()) - tgt.setParentDevice(convertReference(src.getParentDevice())); - for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial()) - tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r4.model.DeviceDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition tgt = new org.hl7.fhir.r5.model.DeviceDefinition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasUdiDeviceIdentifier()) { + for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier()) tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t)); + } + if (src.hasManufacturer()) + tgt.setManufacturer(convertType(src.getManufacturer())); + if (src.hasDeviceName()) { + for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName()) tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t)); + } + if (src.hasModelNumber()) + tgt.setModelNumberElement(convertString(src.getModelNumberElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSpecialization()) { + for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization()) tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t)); + } + if (src.hasVersion()) { + for (org.hl7.fhir.r4.model.StringType t : src.getVersion()) tgt.getVersion().add(convertString(t)); + } + if (src.hasSafety()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSafety()) tgt.addSafety(convertCodeableConcept(t)); + } + if (src.hasShelfLifeStorage()) { + for (org.hl7.fhir.r4.model.ProductShelfLife t : src.getShelfLifeStorage()) tgt.addShelfLifeStorage(convertProductShelfLife(t)); + } + if (src.hasPhysicalCharacteristics()) + tgt.setPhysicalCharacteristics(convertProdCharacteristic(src.getPhysicalCharacteristics())); + if (src.hasLanguageCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLanguageCode()) tgt.addLanguageCode(convertCodeableConcept(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability()) tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertDeviceDefinitionPropertyComponent(t)); + } + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(convertContactPoint(t)); + } + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasOnlineInformation()) + tgt.setOnlineInformationElement(convertUri(src.getOnlineInformationElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasParentDevice()) + tgt.setParentDevice(convertReference(src.getParentDevice())); + if (src.hasMaterial()) { + for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial()) tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r5.model.DeviceDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceDefinition tgt = new org.hl7.fhir.r4.model.DeviceDefinition(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier()) - tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t)); - if (src.hasManufacturer()) - tgt.setManufacturer(convertType(src.getManufacturer())); - for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName()) - tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t)); - if (src.hasModelNumber()) - tgt.setModelNumberElement(convertString(src.getModelNumberElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization()) - tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getVersion()) - tgt.getVersion().add(convertString(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety()) - tgt.addSafety(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ProductShelfLife t : src.getShelfLifeStorage()) - tgt.addShelfLifeStorage(convertProductShelfLife(t)); - if (src.hasPhysicalCharacteristics()) - tgt.setPhysicalCharacteristics(convertProdCharacteristic(src.getPhysicalCharacteristics())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLanguageCode()) - tgt.addLanguageCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability()) - tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t)); - for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty()) - tgt.addProperty(convertDeviceDefinitionPropertyComponent(t)); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) - tgt.addContact(convertContactPoint(t)); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasOnlineInformation()) - tgt.setOnlineInformationElement(convertUri(src.getOnlineInformationElement())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - if (src.hasParentDevice()) - tgt.setParentDevice(convertReference(src.getParentDevice())); - for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial()) - tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r5.model.DeviceDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceDefinition tgt = new org.hl7.fhir.r4.model.DeviceDefinition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasUdiDeviceIdentifier()) { + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier()) tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t)); + } + if (src.hasManufacturer()) + tgt.setManufacturer(convertType(src.getManufacturer())); + if (src.hasDeviceName()) { + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName()) tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t)); + } + if (src.hasModelNumber()) + tgt.setModelNumberElement(convertString(src.getModelNumberElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSpecialization()) { + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization()) tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t)); + } + if (src.hasVersion()) { + for (org.hl7.fhir.r5.model.StringType t : src.getVersion()) tgt.getVersion().add(convertString(t)); + } + if (src.hasSafety()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety()) tgt.addSafety(convertCodeableConcept(t)); + } + if (src.hasShelfLifeStorage()) { + for (org.hl7.fhir.r5.model.ProductShelfLife t : src.getShelfLifeStorage()) tgt.addShelfLifeStorage(convertProductShelfLife(t)); + } + if (src.hasPhysicalCharacteristics()) + tgt.setPhysicalCharacteristics(convertProdCharacteristic(src.getPhysicalCharacteristics())); + if (src.hasLanguageCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLanguageCode()) tgt.addLanguageCode(convertCodeableConcept(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability()) tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertDeviceDefinitionPropertyComponent(t)); + } + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) tgt.addContact(convertContactPoint(t)); + } + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasOnlineInformation()) + tgt.setOnlineInformationElement(convertUri(src.getOnlineInformationElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasParentDevice()) + tgt.setParentDevice(convertReference(src.getParentDevice())); + if (src.hasMaterial()) { + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial()) tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent(); - copyElement(src, tgt); - if (src.hasDeviceIdentifier()) - tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); - if (src.hasIssuer()) - tgt.setIssuerElement(convertUri(src.getIssuerElement())); - if (src.hasJurisdiction()) - tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent(); + copyElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent(); - copyElement(src, tgt); - if (src.hasDeviceIdentifier()) - tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); - if (src.hasIssuer()) - tgt.setIssuerElement(convertUri(src.getIssuerElement())); - if (src.hasJurisdiction()) - tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent(); + copyElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertDeviceNameType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertDeviceNameType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.DeviceNameType convertDeviceNameType(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UDILABELNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.UDILABELNAME; - case USERFRIENDLYNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME; - case PATIENTREPORTEDNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME; - case MANUFACTURERNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MANUFACTURERNAME; - case MODELNAME: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MODELNAME; - case OTHER: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.OTHER; - default: return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType convertDeviceNameType(org.hl7.fhir.r5.model.Enumerations.DeviceNameType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UDILABELNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.UDILABELNAME; - case USERFRIENDLYNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.USERFRIENDLYNAME; - case PATIENTREPORTEDNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.PATIENTREPORTEDNAME; - case MANUFACTURERNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MANUFACTURERNAME; - case MODELNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MODELNAME; - case OTHER: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.OTHER; - default: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.NULL; - } -} - - public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent(); - copyElement(src, tgt); - if (src.hasSystemType()) - tgt.setSystemTypeElement(convertString(src.getSystemTypeElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent(); - copyElement(src, tgt); - if (src.hasSystemType()) - tgt.setSystemTypeElement(convertString(src.getSystemTypeElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDescription()) - tgt.addDescription(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDescription()) - tgt.addDescription(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.Quantity t : src.getValueQuantity()) - tgt.addValueQuantity(convertQuantity(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValueCode()) - tgt.addValueCode(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.Quantity t : src.getValueQuantity()) - tgt.addValueQuantity(convertQuantity(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValueCode()) - tgt.addValueCode(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent(); - copyElement(src, tgt); - if (src.hasSubstance()) - tgt.setSubstance(convertCodeableConcept(src.getSubstance())); - if (src.hasAlternate()) - tgt.setAlternateElement(convertBoolean(src.getAlternateElement())); - if (src.hasAllergenicIndicator()) - tgt.setAllergenicIndicatorElement(convertBoolean(src.getAllergenicIndicatorElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent(); - copyElement(src, tgt); - if (src.hasSubstance()) - tgt.setSubstance(convertCodeableConcept(src.getSubstance())); - if (src.hasAlternate()) - tgt.setAlternateElement(convertBoolean(src.getAlternateElement())); - if (src.hasAllergenicIndicator()) - tgt.setAllergenicIndicatorElement(convertBoolean(src.getAllergenicIndicatorElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertDeviceNameType(src.getType())); + return tgt; + } + public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertDeviceNameType(src.getType())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.DeviceNameType convertDeviceNameType(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UDILABELNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.UDILABELNAME; + case USERFRIENDLYNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME; + case PATIENTREPORTEDNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME; + case MANUFACTURERNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MANUFACTURERNAME; + case MODELNAME: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MODELNAME; + case OTHER: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.OTHER; + default: + return org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType convertDeviceNameType(org.hl7.fhir.r5.model.Enumerations.DeviceNameType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UDILABELNAME: + return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.UDILABELNAME; + case USERFRIENDLYNAME: + return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.USERFRIENDLYNAME; + case PATIENTREPORTEDNAME: + return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.PATIENTREPORTEDNAME; + case MANUFACTURERNAME: + return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MANUFACTURERNAME; + case MODELNAME: + return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MODELNAME; + case OTHER: + return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.OTHER; + default: + return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.NULL; + } + } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent(); + copyElement(src, tgt); + if (src.hasSystemType()) + tgt.setSystemTypeElement(convertString(src.getSystemTypeElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent(); + copyElement(src, tgt); + if (src.hasSystemType()) + tgt.setSystemTypeElement(convertString(src.getSystemTypeElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDescription()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDescription()) tgt.addDescription(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDescription()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDescription()) tgt.addDescription(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValueQuantity()) { + for (org.hl7.fhir.r4.model.Quantity t : src.getValueQuantity()) tgt.addValueQuantity(convertQuantity(t)); + } + if (src.hasValueCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValueCode()) tgt.addValueCode(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValueQuantity()) { + for (org.hl7.fhir.r5.model.Quantity t : src.getValueQuantity()) tgt.addValueQuantity(convertQuantity(t)); + } + if (src.hasValueCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValueCode()) tgt.addValueCode(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent(); + copyElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(convertCodeableConcept(src.getSubstance())); + if (src.hasAlternate()) + tgt.setAlternateElement(convertBoolean(src.getAlternateElement())); + if (src.hasAllergenicIndicator()) + tgt.setAllergenicIndicatorElement(convertBoolean(src.getAllergenicIndicatorElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent(); + copyElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(convertCodeableConcept(src.getSubstance())); + if (src.hasAlternate()) + tgt.setAlternateElement(convertBoolean(src.getAlternateElement())); + if (src.hasAllergenicIndicator()) + tgt.setAllergenicIndicatorElement(convertBoolean(src.getAllergenicIndicatorElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceMetric.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceMetric.java index 144f39a9e..7c169088e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceMetric.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceMetric.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,223 +50,280 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DeviceMetric extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r4.model.DeviceMetric src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceMetric tgt = new org.hl7.fhir.r5.model.DeviceMetric(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasParent()) - tgt.setParent(convertReference(src.getParent())); - if (src.hasOperationalStatus()) - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - if (src.hasColor()) - tgt.setColor(convertDeviceMetricColor(src.getColor())); - if (src.hasCategory()) - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - if (src.hasMeasurementPeriod()) - tgt.setMeasurementPeriod(convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) - tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r5.model.DeviceMetric src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceMetric tgt = new org.hl7.fhir.r4.model.DeviceMetric(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasParent()) - tgt.setParent(convertReference(src.getParent())); - if (src.hasOperationalStatus()) - tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); - if (src.hasColor()) - tgt.setColor(convertDeviceMetricColor(src.getColor())); - if (src.hasCategory()) - tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); - if (src.hasMeasurementPeriod()) - tgt.setMeasurementPeriod(convertTiming(src.getMeasurementPeriod())); - for (org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) - tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus convertDeviceMetricOperationalStatus(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ON: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON; - case OFF: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF; - case STANDBY: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus convertDeviceMetricOperationalStatus(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ON: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ON; - case OFF: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.OFF; - case STANDBY: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor convertDeviceMetricColor(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BLACK: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLACK; - case RED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.RED; - case GREEN: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.GREEN; - case YELLOW: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.YELLOW; - case BLUE: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLUE; - case MAGENTA: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.MAGENTA; - case CYAN: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.CYAN; - case WHITE: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.WHITE; - default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor convertDeviceMetricColor(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BLACK: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLACK; - case RED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.RED; - case GREEN: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.GREEN; - case YELLOW: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.YELLOW; - case BLUE: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLUE; - case MAGENTA: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.MAGENTA; - case CYAN: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.CYAN; - case WHITE: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.WHITE; - default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.NULL; - } -} - - public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory convertDeviceMetricCategory(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MEASUREMENT: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT; - case SETTING: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING; - case CALCULATION: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION; - case UNSPECIFIED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED; - default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory convertDeviceMetricCategory(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MEASUREMENT: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT; - case SETTING: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.SETTING; - case CALCULATION: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.CALCULATION; - case UNSPECIFIED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED; - default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.NULL; - } -} - - public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - if (src.hasState()) - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - if (src.hasTime()) - tgt.setTimeElement(convertInstant(src.getTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertDeviceMetricCalibrationType(src.getType())); - if (src.hasState()) - tgt.setState(convertDeviceMetricCalibrationState(src.getState())); - if (src.hasTime()) - tgt.setTimeElement(convertInstant(src.getTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType convertDeviceMetricCalibrationType(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UNSPECIFIED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED; - case OFFSET: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET; - case GAIN: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN; - case TWOPOINT: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT; - default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType convertDeviceMetricCalibrationType(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UNSPECIFIED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED; - case OFFSET: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET; - case GAIN: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.GAIN; - case TWOPOINT: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT; - default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.NULL; - } -} - - public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState convertDeviceMetricCalibrationState(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTCALIBRATED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED; - case CALIBRATIONREQUIRED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED; - case CALIBRATED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED; - case UNSPECIFIED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED; - default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState convertDeviceMetricCalibrationState(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTCALIBRATED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED; - case CALIBRATIONREQUIRED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED; - case CALIBRATED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED; - case UNSPECIFIED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED; - default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NULL; - } -} + public static org.hl7.fhir.r5.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r4.model.DeviceMetric src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceMetric tgt = new org.hl7.fhir.r5.model.DeviceMetric(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasParent()) + tgt.setParent(convertReference(src.getParent())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + if (src.hasColor()) + tgt.setColor(convertDeviceMetricColor(src.getColor())); + if (src.hasCategory()) + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + if (src.hasMeasurementPeriod()) + tgt.setMeasurementPeriod(convertTiming(src.getMeasurementPeriod())); + if (src.hasCalibration()) { + for (org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r5.model.DeviceMetric src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceMetric tgt = new org.hl7.fhir.r4.model.DeviceMetric(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasParent()) + tgt.setParent(convertReference(src.getParent())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus())); + if (src.hasColor()) + tgt.setColor(convertDeviceMetricColor(src.getColor())); + if (src.hasCategory()) + tgt.setCategory(convertDeviceMetricCategory(src.getCategory())); + if (src.hasMeasurementPeriod()) + tgt.setMeasurementPeriod(convertTiming(src.getMeasurementPeriod())); + if (src.hasCalibration()) { + for (org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus convertDeviceMetricOperationalStatus(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ON: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON; + case OFF: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF; + case STANDBY: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus convertDeviceMetricOperationalStatus(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ON: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ON; + case OFF: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.OFF; + case STANDBY: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor convertDeviceMetricColor(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BLACK: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLACK; + case RED: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.RED; + case GREEN: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.GREEN; + case YELLOW: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.YELLOW; + case BLUE: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLUE; + case MAGENTA: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.MAGENTA; + case CYAN: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.CYAN; + case WHITE: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.WHITE; + default: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor convertDeviceMetricColor(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BLACK: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLACK; + case RED: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.RED; + case GREEN: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.GREEN; + case YELLOW: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.YELLOW; + case BLUE: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLUE; + case MAGENTA: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.MAGENTA; + case CYAN: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.CYAN; + case WHITE: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.WHITE; + default: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.NULL; + } + } + + public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory convertDeviceMetricCategory(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MEASUREMENT: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT; + case SETTING: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING; + case CALCULATION: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION; + case UNSPECIFIED: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED; + default: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory convertDeviceMetricCategory(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MEASUREMENT: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT; + case SETTING: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.SETTING; + case CALCULATION: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.CALCULATION; + case UNSPECIFIED: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED; + default: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.NULL; + } + } + + public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + if (src.hasState()) + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + if (src.hasTime()) + tgt.setTimeElement(convertInstant(src.getTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertDeviceMetricCalibrationType(src.getType())); + if (src.hasState()) + tgt.setState(convertDeviceMetricCalibrationState(src.getState())); + if (src.hasTime()) + tgt.setTimeElement(convertInstant(src.getTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType convertDeviceMetricCalibrationType(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UNSPECIFIED: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED; + case OFFSET: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET; + case GAIN: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN; + case TWOPOINT: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT; + default: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType convertDeviceMetricCalibrationType(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UNSPECIFIED: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED; + case OFFSET: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET; + case GAIN: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.GAIN; + case TWOPOINT: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT; + default: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.NULL; + } + } + + public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState convertDeviceMetricCalibrationState(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTCALIBRATED: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED; + case CALIBRATIONREQUIRED: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED; + case CALIBRATED: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED; + case UNSPECIFIED: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED; + default: + return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState convertDeviceMetricCalibrationState(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTCALIBRATED: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED; + case CALIBRATIONREQUIRED: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED; + case CALIBRATED: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED; + case UNSPECIFIED: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED; + default: + return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceRequest.java index 25506385c..f7bc0f8c6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceRequest.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,237 +51,298 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DeviceRequest extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r4.model.DeviceRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceRequest tgt = new org.hl7.fhir.r5.model.DeviceRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPriorRequest()) - tgt.addPriorRequest(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertDeviceRequestStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertRequestIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasCode()) - tgt.setCode(convertType(src.getCode())); - for (org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter()) - tgt.addParameter(convertDeviceRequestParameterComponent(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - if (src.hasPerformerType()) - tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r5.model.DeviceRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceRequest tgt = new org.hl7.fhir.r4.model.DeviceRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPriorRequest()) - tgt.addPriorRequest(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertDeviceRequestStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertRequestIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasCode()) - tgt.setCode(convertType(src.getCode())); - for (org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter()) - tgt.addParameter(convertDeviceRequestParameterComponent(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - if (src.hasPerformerType()) - tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertDeviceRequestStatus(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus convertDeviceRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; - default: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceRequest.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.OPTION; - default: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceRequest.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.STAT; - default: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r5.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r4.model.DeviceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceRequest tgt = new org.hl7.fhir.r5.model.DeviceRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPriorRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPriorRequest()) tgt.addPriorRequest(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertDeviceRequestStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertRequestIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) + tgt.setCode(convertType(src.getCode())); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter()) tgt.addParameter(convertDeviceRequestParameterComponent(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r5.model.DeviceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceRequest tgt = new org.hl7.fhir.r4.model.DeviceRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPriorRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPriorRequest()) tgt.addPriorRequest(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertDeviceRequestStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertRequestIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) + tgt.setCode(convertType(src.getCode())); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter()) tgt.addParameter(convertDeviceRequestParameterComponent(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertDeviceRequestStatus(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus convertDeviceRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceRequest.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.OPTION; + default: + return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceRequest.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.STAT; + default: + return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceUseStatement.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceUseStatement.java index 49e4c52b4..f2d84b558 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceUseStatement.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DeviceUseStatement.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,109 +51,126 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DeviceUseStatement extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r4.model.DeviceUseStatement src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DeviceUseStatement tgt = new org.hl7.fhir.r5.model.DeviceUseStatement(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) - tgt.addDerivedFrom(convertReference(t)); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasRecordedOn()) - tgt.setRecordedOnElement(convertDateTime(src.getRecordedOnElement())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasDevice()) - tgt.setDevice(convertReference(src.getDevice())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r5.model.DeviceUseStatement src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DeviceUseStatement tgt = new org.hl7.fhir.r4.model.DeviceUseStatement(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) - tgt.addDerivedFrom(convertReference(t)); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasRecordedOn()) - tgt.setRecordedOnElement(convertDateTime(src.getRecordedOnElement())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasDevice()) - tgt.setDevice(convertReference(src.getDevice())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus convertDeviceUseStatementStatus(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE; - case COMPLETED: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR; - case INTENDED: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED; - case STOPPED: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED; - case ONHOLD: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD; - default: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus convertDeviceUseStatementStatus(org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE; - case COMPLETED: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR; - case INTENDED: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED; - case STOPPED: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED; - case ONHOLD: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD; - default: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r4.model.DeviceUseStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceUseStatement tgt = new org.hl7.fhir.r5.model.DeviceUseStatement(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(convertReference(t)); + } + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasRecordedOn()) + tgt.setRecordedOnElement(convertDateTime(src.getRecordedOnElement())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasDevice()) + tgt.setDevice(convertReference(src.getDevice())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r5.model.DeviceUseStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DeviceUseStatement tgt = new org.hl7.fhir.r4.model.DeviceUseStatement(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(convertReference(t)); + } + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasRecordedOn()) + tgt.setRecordedOnElement(convertDateTime(src.getRecordedOnElement())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasDevice()) + tgt.setDevice(convertReference(src.getDevice())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus convertDeviceUseStatementStatus(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE; + case COMPLETED: + return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR; + case INTENDED: + return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED; + case STOPPED: + return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED; + case ONHOLD: + return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD; + default: + return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus convertDeviceUseStatementStatus(org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE; + case COMPLETED: + return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR; + case INTENDED: + return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED; + case STOPPED: + return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED; + case ONHOLD: + return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD; + default: + return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DiagnosticReport.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DiagnosticReport.java index a7d45a135..a2bd32610 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DiagnosticReport.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DiagnosticReport.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,159 +50,198 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DiagnosticReport extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DiagnosticReport tgt = new org.hl7.fhir.r5.model.DiagnosticReport(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasIssued()) - tgt.setIssuedElement(convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getResultsInterpreter()) - tgt.addResultsInterpreter(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) - tgt.addSpecimen(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getResult()) - tgt.addResult(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getImagingStudy()) - tgt.addImagingStudy(convertReference(t)); - for (org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) - tgt.addMedia(convertDiagnosticReportMediaComponent(t)); - if (src.hasConclusion()) - tgt.setConclusionElement(convertString(src.getConclusionElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getConclusionCode()) - tgt.addConclusionCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Attachment t : src.getPresentedForm()) - tgt.addPresentedForm(convertAttachment(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r5.model.DiagnosticReport src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DiagnosticReport tgt = new org.hl7.fhir.r4.model.DiagnosticReport(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasIssued()) - tgt.setIssuedElement(convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getResultsInterpreter()) - tgt.addResultsInterpreter(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) - tgt.addSpecimen(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getResult()) - tgt.addResult(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy()) - tgt.addImagingStudy(convertReference(t)); - for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) - tgt.addMedia(convertDiagnosticReportMediaComponent(t)); - if (src.hasConclusion()) - tgt.setConclusionElement(convertString(src.getConclusionElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode()) - tgt.addConclusionCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm()) - tgt.addPresentedForm(convertAttachment(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus convertDiagnosticReportStatus(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED; - case PARTIAL: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL; - case PRELIMINARY: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.FINAL; - case AMENDED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED; - case APPENDED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.APPENDED; - case CANCELLED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus convertDiagnosticReportStatus(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED; - case PARTIAL: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL; - case PRELIMINARY: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL; - case AMENDED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED; - case APPENDED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.APPENDED; - case CANCELLED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent(); - copyElement(src, tgt); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasLink()) - tgt.setLink(convertReference(src.getLink())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent(); - copyElement(src, tgt); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasLink()) - tgt.setLink(convertReference(src.getLink())); - return tgt; - } + public static org.hl7.fhir.r5.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DiagnosticReport tgt = new org.hl7.fhir.r5.model.DiagnosticReport(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasResultsInterpreter()) { + for (org.hl7.fhir.r4.model.Reference t : src.getResultsInterpreter()) tgt.addResultsInterpreter(convertReference(t)); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.r4.model.Reference t : src.getResult()) tgt.addResult(convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.r4.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(convertReference(t)); + } + if (src.hasMedia()) { + for (org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addMedia(convertDiagnosticReportMediaComponent(t)); + } + if (src.hasConclusion()) + tgt.setConclusionElement(convertString(src.getConclusionElement())); + if (src.hasConclusionCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getConclusionCode()) tgt.addConclusionCode(convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(convertAttachment(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r5.model.DiagnosticReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DiagnosticReport tgt = new org.hl7.fhir.r4.model.DiagnosticReport(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertDiagnosticReportStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasResultsInterpreter()) { + for (org.hl7.fhir.r5.model.Reference t : src.getResultsInterpreter()) tgt.addResultsInterpreter(convertReference(t)); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(convertReference(t)); + } + if (src.hasResult()) { + for (org.hl7.fhir.r5.model.Reference t : src.getResult()) tgt.addResult(convertReference(t)); + } + if (src.hasImagingStudy()) { + for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy()) tgt.addImagingStudy(convertReference(t)); + } + if (src.hasMedia()) { + for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) tgt.addMedia(convertDiagnosticReportMediaComponent(t)); + } + if (src.hasConclusion()) + tgt.setConclusionElement(convertString(src.getConclusionElement())); + if (src.hasConclusionCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode()) tgt.addConclusionCode(convertCodeableConcept(t)); + } + if (src.hasPresentedForm()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm()) tgt.addPresentedForm(convertAttachment(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus convertDiagnosticReportStatus(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED; + case PARTIAL: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL; + case PRELIMINARY: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED; + case APPENDED: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.APPENDED; + case CANCELLED: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus convertDiagnosticReportStatus(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED; + case PARTIAL: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL; + case PRELIMINARY: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED; + case APPENDED: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.APPENDED; + case CANCELLED: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent(); + copyElement(src, tgt); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasLink()) + tgt.setLink(convertReference(src.getLink())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent(); + copyElement(src, tgt); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasLink()) + tgt.setLink(convertReference(src.getLink())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentManifest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentManifest.java index 6e86cf5f2..074ad9b09 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentManifest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentManifest.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,99 +50,104 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DocumentManifest extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r4.model.DocumentManifest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DocumentManifest tgt = new org.hl7.fhir.r5.model.DocumentManifest(); - copyDomainResource(src, tgt); - if (src.hasMasterIdentifier()) - tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - if (src.hasSource()) - tgt.setSourceElement(convertUri(src.getSourceElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getContent()) - tgt.addContent(convertReference(t)); - for (org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) - tgt.addRelated(convertDocumentManifestRelatedComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r4.model.DocumentManifest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentManifest tgt = new org.hl7.fhir.r5.model.DocumentManifest(); + copyDomainResource(src, tgt); + if (src.hasMasterIdentifier()) + tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + if (src.hasSource()) + tgt.setSourceElement(convertUri(src.getSourceElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasContent()) { + for (org.hl7.fhir.r4.model.Reference t : src.getContent()) tgt.addContent(convertReference(t)); + } + if (src.hasRelated()) { + for (org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r5.model.DocumentManifest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DocumentManifest tgt = new org.hl7.fhir.r4.model.DocumentManifest(); - copyDomainResource(src, tgt); - if (src.hasMasterIdentifier()) - tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - if (src.hasSource()) - tgt.setSourceElement(convertUri(src.getSourceElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getContent()) - tgt.addContent(convertReference(t)); - for (org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) - tgt.addRelated(convertDocumentManifestRelatedComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasRef()) - tgt.setRef(convertReference(src.getRef())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasRef()) - tgt.setRef(convertReference(src.getRef())); - return tgt; - } + public static org.hl7.fhir.r4.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r5.model.DocumentManifest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DocumentManifest tgt = new org.hl7.fhir.r4.model.DocumentManifest(); + copyDomainResource(src, tgt); + if (src.hasMasterIdentifier()) + tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasRecipient()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + if (src.hasSource()) + tgt.setSourceElement(convertUri(src.getSourceElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasContent()) { + for (org.hl7.fhir.r5.model.Reference t : src.getContent()) tgt.addContent(convertReference(t)); + } + if (src.hasRelated()) { + for (org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasRef()) + tgt.setRef(convertReference(src.getRef())); + return tgt; + } + public static org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasRef()) + tgt.setRef(convertReference(src.getRef())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentReference.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentReference.java index f49bee734..905778029 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentReference.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/DocumentReference.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,231 +50,264 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class DocumentReference extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DocumentReference convertDocumentReference(org.hl7.fhir.r4.model.DocumentReference src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference(); - copyDomainResource(src, tgt); - if (src.hasMasterIdentifier()) - tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); - if (src.hasDocStatus()) - tgt.setDocStatus(convertReferredDocumentStatus(src.getDocStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertInstant(src.getDateElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - if (src.hasAuthenticator()) - tgt.setAuthenticator(convertReference(src.getAuthenticator())); - if (src.hasCustodian()) - tgt.setCustodian(convertReference(src.getCustodian())); - for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) - tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) - tgt.addContent(convertDocumentReferenceContentComponent(t)); - if (src.hasContext()) - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DocumentReference convertDocumentReference(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DocumentReference tgt = new org.hl7.fhir.r4.model.DocumentReference(); - copyDomainResource(src, tgt); - if (src.hasMasterIdentifier()) - tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); - if (src.hasDocStatus()) - tgt.setDocStatus(convertReferredDocumentStatus(src.getDocStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertInstant(src.getDateElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) - tgt.addAuthor(convertReference(t)); - if (src.hasAuthenticator()) - tgt.setAuthenticator(convertReference(src.getAuthenticator())); - if (src.hasCustodian()) - tgt.setCustodian(convertReference(src.getCustodian())); - for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) - tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) - tgt.addSecurityLabel(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) - tgt.addContent(convertDocumentReferenceContentComponent(t)); - if (src.hasContext()) - tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.CompositionStatus convertReferredDocumentStatus(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRELIMINARY: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL; - case AMENDED: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus convertReferredDocumentStatus(org.hl7.fhir.r5.model.Enumerations.CompositionStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRELIMINARY: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.FINAL; - case AMENDED: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.AMENDED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - if (src.hasTarget()) - tgt.setTarget(convertReference(src.getTarget())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertDocumentRelationshipType(src.getCode())); - if (src.hasTarget()) - tgt.setTarget(convertReference(src.getTarget())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REPLACES: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES; - case TRANSFORMS: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS; - case SIGNS: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS; - case APPENDS: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS; - default: return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL; - } -} - - public static org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REPLACES: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES; - case TRANSFORMS: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS; - case SIGNS: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS; - case APPENDS: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS; - default: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL; - } -} - - public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent(); - copyElement(src, tgt); - if (src.hasAttachment()) - tgt.setAttachment(convertAttachment(src.getAttachment())); - if (src.hasFormat()) - tgt.setFormat(convertCoding(src.getFormat())); - return tgt; - } - - public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent(); - copyElement(src, tgt); - if (src.hasAttachment()) - tgt.setAttachment(convertAttachment(src.getAttachment())); - if (src.hasFormat()) - tgt.setFormat(convertCoding(src.getFormat())); - return tgt; - } - - public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Reference t : src.getEncounter()) - tgt.addEncounter(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent()) - tgt.addEvent(convertCodeableConcept(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasFacilityType()) - tgt.setFacilityType(convertCodeableConcept(src.getFacilityType())); - if (src.hasPracticeSetting()) - tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting())); - if (src.hasSourcePatientInfo()) - tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.r4.model.Reference t : src.getRelated()) - tgt.addRelated(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) - tgt.addEncounter(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getEvent()) - tgt.addEvent(convertCodeableConcept(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasFacilityType()) - tgt.setFacilityType(convertCodeableConcept(src.getFacilityType())); - if (src.hasPracticeSetting()) - tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting())); - if (src.hasSourcePatientInfo()) - tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo())); - for (org.hl7.fhir.r5.model.Reference t : src.getRelated()) - tgt.addRelated(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.DocumentReference convertDocumentReference(org.hl7.fhir.r4.model.DocumentReference src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference(); + copyDomainResource(src, tgt); + if (src.hasMasterIdentifier()) + tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); + if (src.hasDocStatus()) + tgt.setDocStatus(convertReferredDocumentStatus(src.getDocStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertInstant(src.getDateElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasAuthenticator()) + tgt.setAuthenticator(convertReference(src.getAuthenticator())); + if (src.hasCustodian()) + tgt.setCustodian(convertReference(src.getCustodian())); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + return tgt; + } + public static org.hl7.fhir.r4.model.DocumentReference convertDocumentReference(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DocumentReference tgt = new org.hl7.fhir.r4.model.DocumentReference(); + copyDomainResource(src, tgt); + if (src.hasMasterIdentifier()) + tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus())); + if (src.hasDocStatus()) + tgt.setDocStatus(convertReferredDocumentStatus(src.getDocStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertInstant(src.getDateElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(convertReference(t)); + } + if (src.hasAuthenticator()) + tgt.setAuthenticator(convertReference(src.getAuthenticator())); + if (src.hasCustodian()) + tgt.setCustodian(convertReference(src.getCustodian())); + if (src.hasRelatesTo()) { + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSecurityLabel()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(convertCodeableConcept(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t)); + } + if (src.hasContext()) + tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.CompositionStatus convertReferredDocumentStatus(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRELIMINARY: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus convertReferredDocumentStatus(org.hl7.fhir.r5.model.Enumerations.CompositionStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRELIMINARY: + return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.AMENDED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + if (src.hasTarget()) + tgt.setTarget(convertReference(src.getTarget())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertDocumentRelationshipType(src.getCode())); + if (src.hasTarget()) + tgt.setTarget(convertReference(src.getTarget())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REPLACES: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES; + case TRANSFORMS: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS; + case SIGNS: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS; + case APPENDS: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS; + default: + return org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL; + } + } + + public static org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REPLACES: + return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES; + case TRANSFORMS: + return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS; + case SIGNS: + return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS; + case APPENDS: + return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS; + default: + return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL; + } + } + + public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent(); + copyElement(src, tgt); + if (src.hasAttachment()) + tgt.setAttachment(convertAttachment(src.getAttachment())); + if (src.hasFormat()) + tgt.setFormat(convertCoding(src.getFormat())); + return tgt; + } + + public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent(); + copyElement(src, tgt); + if (src.hasAttachment()) + tgt.setAttachment(convertAttachment(src.getAttachment())); + if (src.hasFormat()) + tgt.setFormat(convertCoding(src.getFormat())); + return tgt; + } + + public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent(); + copyElement(src, tgt); + if (src.hasEncounter()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEncounter()) tgt.addEncounter(convertReference(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent()) tgt.addEvent(convertCodeableConcept(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasFacilityType()) + tgt.setFacilityType(convertCodeableConcept(src.getFacilityType())); + if (src.hasPracticeSetting()) + tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting())); + if (src.hasSourcePatientInfo()) + tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo())); + if (src.hasRelated()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRelated()) tgt.addRelated(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent(); + copyElement(src, tgt); + if (src.hasEncounter()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) tgt.addEncounter(convertReference(t)); + } + if (src.hasEvent()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getEvent()) tgt.addEvent(convertCodeableConcept(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasFacilityType()) + tgt.setFacilityType(convertCodeableConcept(src.getFacilityType())); + if (src.hasPracticeSetting()) + tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting())); + if (src.hasSourcePatientInfo()) + tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo())); + if (src.hasRelated()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRelated()) tgt.addRelated(convertReference(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Encounter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Encounter.java index 4ccd2d15b..64bb74044 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Encounter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Encounter.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,364 +51,416 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Encounter extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Encounter convertEncounter(org.hl7.fhir.r4.model.Encounter src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Encounter tgt = new org.hl7.fhir.r5.model.Encounter(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEncounterStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) - tgt.addStatusHistory(convertStatusHistoryComponent(t)); - if (src.hasClass_()) - tgt.setClass_(convertCoding(src.getClass_())); - for (org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) - tgt.addClassHistory(convertClassHistoryComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasServiceType()) - tgt.setServiceType(convertCodeableConcept(src.getServiceType())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getEpisodeOfCare()) - tgt.addEpisodeOfCare(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertEncounterParticipantComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAppointment()) - tgt.addAppointment(convertReference(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasLength()) - tgt.setLength(convertDuration(src.getLength())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) - tgt.addAccount(convertReference(t)); - if (src.hasHospitalization()) - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent t : src.getLocation()) - tgt.addLocation(convertEncounterLocationComponent(t)); - if (src.hasServiceProvider()) - tgt.setServiceProvider(convertReference(src.getServiceProvider())); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Encounter convertEncounter(org.hl7.fhir.r5.model.Encounter src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Encounter tgt = new org.hl7.fhir.r4.model.Encounter(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEncounterStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) - tgt.addStatusHistory(convertStatusHistoryComponent(t)); - if (src.hasClass_()) - tgt.setClass_(convertCoding(src.getClass_())); - for (org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) - tgt.addClassHistory(convertClassHistoryComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasServiceType()) - tgt.setServiceType(convertCodeableConcept(src.getServiceType())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare()) - tgt.addEpisodeOfCare(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertEncounterParticipantComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAppointment()) - tgt.addAppointment(convertReference(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasLength()) - tgt.setLength(convertDuration(src.getLength())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) - tgt.addAccount(convertReference(t)); - if (src.hasHospitalization()) - tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); - for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation()) - tgt.addLocation(convertEncounterLocationComponent(t)); - if (src.hasServiceProvider()) - tgt.setServiceProvider(convertReference(src.getServiceProvider())); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Encounter.EncounterStatus convertEncounterStatus(org.hl7.fhir.r4.model.Encounter.EncounterStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.PLANNED; - case ARRIVED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; - case TRIAGED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; - case INPROGRESS: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; - case ONLEAVE: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; - case FINISHED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.COMPLETED; - case CANCELLED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Encounter.EncounterStatus convertEncounterStatus(org.hl7.fhir.r5.model.Encounter.EncounterStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED; - case INPROGRESS: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS; - case CANCELLED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED; - case COMPLETED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent(); - copyElement(src, tgt); - if (src.hasStatus()) - tgt.setStatus(convertEncounterStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent(); - copyElement(src, tgt); - if (src.hasStatus()) - tgt.setStatus(convertEncounterStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent(); - copyElement(src, tgt); - if (src.hasClass_()) - tgt.setClass_(convertCoding(src.getClass_())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent(); - copyElement(src, tgt); - if (src.hasClass_()) - tgt.setClass_(convertCoding(src.getClass_())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasIndividual()) - tgt.setIndividual(convertReference(src.getIndividual())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasIndividual()) - tgt.setIndividual(convertReference(src.getIndividual())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.Encounter.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Encounter.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasCondition()) - tgt.setCondition(convertReference(src.getCondition())); - if (src.hasUse()) - tgt.setUse(convertCodeableConcept(src.getUse())); - if (src.hasRank()) - tgt.setRankElement(convertPositiveInt(src.getRankElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Encounter.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.Encounter.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasCondition()) - tgt.setCondition(convertReference(src.getCondition())); - if (src.hasUse()) - tgt.setUse(convertCodeableConcept(src.getUse())); - if (src.hasRank()) - tgt.setRankElement(convertPositiveInt(src.getRankElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent(); - copyElement(src, tgt); - if (src.hasPreAdmissionIdentifier()) - tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier())); - if (src.hasOrigin()) - tgt.setOrigin(convertReference(src.getOrigin())); - if (src.hasAdmitSource()) - tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource())); - if (src.hasReAdmission()) - tgt.setReAdmission(convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDietPreference()) - tgt.addDietPreference(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialCourtesy()) - tgt.addSpecialCourtesy(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialArrangement()) - tgt.addSpecialArrangement(convertCodeableConcept(t)); - if (src.hasDestination()) - tgt.setDestination(convertReference(src.getDestination())); - if (src.hasDischargeDisposition()) - tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent(); - copyElement(src, tgt); - if (src.hasPreAdmissionIdentifier()) - tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier())); - if (src.hasOrigin()) - tgt.setOrigin(convertReference(src.getOrigin())); - if (src.hasAdmitSource()) - tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource())); - if (src.hasReAdmission()) - tgt.setReAdmission(convertCodeableConcept(src.getReAdmission())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference()) - tgt.addDietPreference(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy()) - tgt.addSpecialCourtesy(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement()) - tgt.addSpecialArrangement(convertCodeableConcept(t)); - if (src.hasDestination()) - tgt.setDestination(convertReference(src.getDestination())); - if (src.hasDischargeDisposition()) - tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent(); - copyElement(src, tgt); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasStatus()) - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - if (src.hasPhysicalType()) - tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent(); - copyElement(src, tgt); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasStatus()) - tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); - if (src.hasPhysicalType()) - tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus convertEncounterLocationStatus(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED; - case ACTIVE: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE; - case RESERVED: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED; - case COMPLETED: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED; - default: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus convertEncounterLocationStatus(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED; - case ACTIVE: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE; - case RESERVED: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED; - case COMPLETED: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED; - default: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.Encounter convertEncounter(org.hl7.fhir.r4.model.Encounter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter tgt = new org.hl7.fhir.r5.model.Encounter(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEncounterStatus(src.getStatus())); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + } + if (src.hasClass_()) + tgt.setClass_(convertCoding(src.getClass_())); + if (src.hasClassHistory()) { + for (org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasServiceType()) + tgt.setServiceType(convertCodeableConcept(src.getServiceType())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(convertReference(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAppointment()) tgt.addAppointment(convertReference(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasLength()) + tgt.setLength(convertDuration(src.getLength())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r4.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(convertReference(t)); + } + if (src.hasHospitalization()) + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) + tgt.setServiceProvider(convertReference(src.getServiceProvider())); + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + return tgt; + } + public static org.hl7.fhir.r4.model.Encounter convertEncounter(org.hl7.fhir.r5.model.Encounter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Encounter tgt = new org.hl7.fhir.r4.model.Encounter(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEncounterStatus(src.getStatus())); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertStatusHistoryComponent(t)); + } + if (src.hasClass_()) + tgt.setClass_(convertCoding(src.getClass_())); + if (src.hasClassHistory()) { + for (org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) tgt.addClassHistory(convertClassHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasServiceType()) + tgt.setServiceType(convertCodeableConcept(src.getServiceType())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEpisodeOfCare()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare()) tgt.addEpisodeOfCare(convertReference(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertEncounterParticipantComponent(t)); + } + if (src.hasAppointment()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAppointment()) tgt.addAppointment(convertReference(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasLength()) + tgt.setLength(convertDuration(src.getLength())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r5.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(convertReference(t)); + } + if (src.hasHospitalization()) + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation()) tgt.addLocation(convertEncounterLocationComponent(t)); + } + if (src.hasServiceProvider()) + tgt.setServiceProvider(convertReference(src.getServiceProvider())); + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + return tgt; + } + public static org.hl7.fhir.r5.model.Encounter.EncounterStatus convertEncounterStatus(org.hl7.fhir.r4.model.Encounter.EncounterStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.PLANNED; + case ARRIVED: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; + case TRIAGED: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; + case INPROGRESS: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; + case ONLEAVE: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS; + case FINISHED: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.COMPLETED; + case CANCELLED: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Encounter.EncounterStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Encounter.EncounterStatus convertEncounterStatus(org.hl7.fhir.r5.model.Encounter.EncounterStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED; + case INPROGRESS: + return org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS; + case CANCELLED: + return org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED; + case COMPLETED: + return org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Encounter.EncounterStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent(); + copyElement(src, tgt); + if (src.hasStatus()) + tgt.setStatus(convertEncounterStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent(); + copyElement(src, tgt); + if (src.hasStatus()) + tgt.setStatus(convertEncounterStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent(); + copyElement(src, tgt); + if (src.hasClass_()) + tgt.setClass_(convertCoding(src.getClass_())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent(); + copyElement(src, tgt); + if (src.hasClass_()) + tgt.setClass_(convertCoding(src.getClass_())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasIndividual()) + tgt.setIndividual(convertReference(src.getIndividual())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasIndividual()) + tgt.setIndividual(convertReference(src.getIndividual())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.Encounter.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Encounter.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(convertReference(src.getCondition())); + if (src.hasUse()) + tgt.setUse(convertCodeableConcept(src.getUse())); + if (src.hasRank()) + tgt.setRankElement(convertPositiveInt(src.getRankElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Encounter.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.Encounter.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(convertReference(src.getCondition())); + if (src.hasUse()) + tgt.setUse(convertCodeableConcept(src.getUse())); + if (src.hasRank()) + tgt.setRankElement(convertPositiveInt(src.getRankElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent(); + copyElement(src, tgt); + if (src.hasPreAdmissionIdentifier()) + tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier())); + if (src.hasOrigin()) + tgt.setOrigin(convertReference(src.getOrigin())); + if (src.hasAdmitSource()) + tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource())); + if (src.hasReAdmission()) + tgt.setReAdmission(convertCodeableConcept(src.getReAdmission())); + if (src.hasDietPreference()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(convertCodeableConcept(t)); + } + if (src.hasDestination()) + tgt.setDestination(convertReference(src.getDestination())); + if (src.hasDischargeDisposition()) + tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent(); + copyElement(src, tgt); + if (src.hasPreAdmissionIdentifier()) + tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier())); + if (src.hasOrigin()) + tgt.setOrigin(convertReference(src.getOrigin())); + if (src.hasAdmitSource()) + tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource())); + if (src.hasReAdmission()) + tgt.setReAdmission(convertCodeableConcept(src.getReAdmission())); + if (src.hasDietPreference()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference()) tgt.addDietPreference(convertCodeableConcept(t)); + } + if (src.hasSpecialCourtesy()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy()) tgt.addSpecialCourtesy(convertCodeableConcept(t)); + } + if (src.hasSpecialArrangement()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement()) tgt.addSpecialArrangement(convertCodeableConcept(t)); + } + if (src.hasDestination()) + tgt.setDestination(convertReference(src.getDestination())); + if (src.hasDischargeDisposition()) + tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent(); + copyElement(src, tgt); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasStatus()) + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent(); + copyElement(src, tgt); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasStatus()) + tgt.setStatus(convertEncounterLocationStatus(src.getStatus())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus convertEncounterLocationStatus(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED; + case ACTIVE: + return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE; + case RESERVED: + return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED; + case COMPLETED: + return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED; + default: + return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus convertEncounterLocationStatus(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED; + case ACTIVE: + return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE; + case RESERVED: + return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED; + case COMPLETED: + return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED; + default: + return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Endpoint.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Endpoint.java index ba55d0624..e89311a8a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Endpoint.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Endpoint.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,99 +50,118 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Endpoint extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Endpoint convertEndpoint(org.hl7.fhir.r4.model.Endpoint src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Endpoint tgt = new org.hl7.fhir.r5.model.Endpoint(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEndpointStatus(src.getStatus())); - if (src.hasConnectionType()) - tgt.setConnectionType(convertCoding(src.getConnectionType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) - tgt.addContact(convertContactPoint(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPayloadType()) - tgt.addPayloadType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeType t : src.getPayloadMimeType()) - tgt.getPayloadMimeType().add(convertCode(t)); - if (src.hasAddress()) - tgt.setAddressElement(convertUrl(src.getAddressElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getHeader()) - tgt.getHeader().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Endpoint convertEndpoint(org.hl7.fhir.r5.model.Endpoint src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Endpoint tgt = new org.hl7.fhir.r4.model.Endpoint(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEndpointStatus(src.getStatus())); - if (src.hasConnectionType()) - tgt.setConnectionType(convertCoding(src.getConnectionType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) - tgt.addContact(convertContactPoint(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPayloadType()) - tgt.addPayloadType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeType t : src.getPayloadMimeType()) - tgt.getPayloadMimeType().add(convertCode(t)); - if (src.hasAddress()) - tgt.setAddressElement(convertUrl(src.getAddressElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getHeader()) - tgt.getHeader().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Endpoint.EndpointStatus convertEndpointStatus(org.hl7.fhir.r4.model.Endpoint.EndpointStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.SUSPENDED; - case ERROR: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ERROR; - case OFF: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.OFF; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ENTEREDINERROR; - case TEST: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.TEST; - default: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Endpoint.EndpointStatus convertEndpointStatus(org.hl7.fhir.r5.model.Endpoint.EndpointStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.SUSPENDED; - case ERROR: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ERROR; - case OFF: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.OFF; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ENTEREDINERROR; - case TEST: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.TEST; - default: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.Endpoint convertEndpoint(org.hl7.fhir.r4.model.Endpoint src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Endpoint tgt = new org.hl7.fhir.r5.model.Endpoint(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEndpointStatus(src.getStatus())); + if (src.hasConnectionType()) + tgt.setConnectionType(convertCoding(src.getConnectionType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact()) tgt.addContact(convertContactPoint(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasPayloadType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(convertCodeableConcept(t)); + } + if (src.hasPayloadMimeType()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getPayloadMimeType()) tgt.getPayloadMimeType().add(convertCode(t)); + } + if (src.hasAddress()) + tgt.setAddressElement(convertUrl(src.getAddressElement())); + if (src.hasHeader()) { + for (org.hl7.fhir.r4.model.StringType t : src.getHeader()) tgt.getHeader().add(convertString(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Endpoint convertEndpoint(org.hl7.fhir.r5.model.Endpoint src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Endpoint tgt = new org.hl7.fhir.r4.model.Endpoint(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEndpointStatus(src.getStatus())); + if (src.hasConnectionType()) + tgt.setConnectionType(convertCoding(src.getConnectionType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) tgt.addContact(convertContactPoint(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasPayloadType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPayloadType()) tgt.addPayloadType(convertCodeableConcept(t)); + } + if (src.hasPayloadMimeType()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getPayloadMimeType()) tgt.getPayloadMimeType().add(convertCode(t)); + } + if (src.hasAddress()) + tgt.setAddressElement(convertUrl(src.getAddressElement())); + if (src.hasHeader()) { + for (org.hl7.fhir.r5.model.StringType t : src.getHeader()) tgt.getHeader().add(convertString(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Endpoint.EndpointStatus convertEndpointStatus(org.hl7.fhir.r4.model.Endpoint.EndpointStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.SUSPENDED; + case ERROR: + return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ERROR; + case OFF: + return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.OFF; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ENTEREDINERROR; + case TEST: + return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.TEST; + default: + return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Endpoint.EndpointStatus convertEndpointStatus(org.hl7.fhir.r5.model.Endpoint.EndpointStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.SUSPENDED; + case ERROR: + return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ERROR; + case OFF: + return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.OFF; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ENTEREDINERROR; + case TEST: + return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.TEST; + default: + return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentRequest.java index af72b61cc..cd67c5c16 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentRequest.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,79 +50,86 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class EnrollmentRequest extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r4.model.EnrollmentRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.EnrollmentRequest tgt = new org.hl7.fhir.r5.model.EnrollmentRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEnrollmentRequestStatus(src.getStatus())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasCandidate()) - tgt.setCandidate(convertReference(src.getCandidate())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - return tgt; - } - - public static org.hl7.fhir.r4.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r5.model.EnrollmentRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.EnrollmentRequest tgt = new org.hl7.fhir.r4.model.EnrollmentRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEnrollmentRequestStatus(src.getStatus())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasCandidate()) - tgt.setCandidate(convertReference(src.getCandidate())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEnrollmentRequestStatus(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus convertEnrollmentRequestStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r4.model.EnrollmentRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EnrollmentRequest tgt = new org.hl7.fhir.r5.model.EnrollmentRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEnrollmentRequestStatus(src.getStatus())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasCandidate()) + tgt.setCandidate(convertReference(src.getCandidate())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + return tgt; + } + public static org.hl7.fhir.r4.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r5.model.EnrollmentRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.EnrollmentRequest tgt = new org.hl7.fhir.r4.model.EnrollmentRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEnrollmentRequestStatus(src.getStatus())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasCandidate()) + tgt.setCandidate(convertReference(src.getCandidate())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEnrollmentRequestStatus(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus convertEnrollmentRequestStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentResponse.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentResponse.java index af55da991..cc92ec611 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentResponse.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EnrollmentResponse.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,107 +50,124 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class EnrollmentResponse extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.r4.model.EnrollmentResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.EnrollmentResponse tgt = new org.hl7.fhir.r5.model.EnrollmentResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEnrollmentResponseStatus(src.getStatus())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasRequestProvider()) - tgt.setRequestProvider(convertReference(src.getRequestProvider())); - return tgt; - } - - public static org.hl7.fhir.r4.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.r5.model.EnrollmentResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.EnrollmentResponse tgt = new org.hl7.fhir.r4.model.EnrollmentResponse(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEnrollmentResponseStatus(src.getStatus())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasRequestProvider()) - tgt.setRequestProvider(convertReference(src.getRequestProvider())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEnrollmentResponseStatus(org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus convertEnrollmentResponseStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; - case COMPLETE: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; - case ERROR: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; - case PARTIAL: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; - default: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED; - case COMPLETE: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE; - case ERROR: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR; - case PARTIAL: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL; - default: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL; - } -} + public static org.hl7.fhir.r5.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.r4.model.EnrollmentResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EnrollmentResponse tgt = new org.hl7.fhir.r5.model.EnrollmentResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEnrollmentResponseStatus(src.getStatus())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasRequestProvider()) + tgt.setRequestProvider(convertReference(src.getRequestProvider())); + return tgt; + } + public static org.hl7.fhir.r4.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.r5.model.EnrollmentResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.EnrollmentResponse tgt = new org.hl7.fhir.r4.model.EnrollmentResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEnrollmentResponseStatus(src.getStatus())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasRequestProvider()) + tgt.setRequestProvider(convertReference(src.getRequestProvider())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertEnrollmentResponseStatus(org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus convertEnrollmentResponseStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; + case COMPLETE: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; + case ERROR: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; + case PARTIAL: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; + default: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED; + case COMPLETE: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE; + case ERROR: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR; + case PARTIAL: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL; + default: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Enumerations.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Enumerations.java index ad16ab097..b175b2aab 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Enumerations.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Enumerations.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,254 +50,380 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Enumerations extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Enumerations.BindingStrength convertBindingStrength(org.hl7.fhir.r4.model.Enumerations.BindingStrength src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REQUIRED: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED; - case EXTENSIBLE: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE; - case PREFERRED: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED; - case EXAMPLE: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE; - default: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL; - } -} + public static org.hl7.fhir.r5.model.Enumerations.BindingStrength convertBindingStrength(org.hl7.fhir.r4.model.Enumerations.BindingStrength src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REQUIRED: + return org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED; + case EXTENSIBLE: + return org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE; + case PREFERRED: + return org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED; + case EXAMPLE: + return org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE; + default: + return org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL; + } + } - public static org.hl7.fhir.r4.model.Enumerations.BindingStrength convertBindingStrength(org.hl7.fhir.r5.model.Enumerations.BindingStrength src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REQUIRED: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED; - case EXTENSIBLE: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE; - case PREFERRED: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED; - case EXAMPLE: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE; - default: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL; - } -} + public static org.hl7.fhir.r4.model.Enumerations.BindingStrength convertBindingStrength(org.hl7.fhir.r5.model.Enumerations.BindingStrength src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REQUIRED: + return org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED; + case EXTENSIBLE: + return org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE; + case PREFERRED: + return org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED; + case EXAMPLE: + return org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE; + default: + return org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL; + } + } - public static org.hl7.fhir.r5.model.Enumerations.PublicationStatus convertPublicationStatus(org.hl7.fhir.r4.model.Enumerations.PublicationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE; - case RETIRED: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.Enumerations.PublicationStatus convertPublicationStatus(org.hl7.fhir.r4.model.Enumerations.PublicationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE; + case RETIRED: + return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL; + } + } - public static org.hl7.fhir.r4.model.Enumerations.PublicationStatus convertPublicationStatus(org.hl7.fhir.r5.model.Enumerations.PublicationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE; - case RETIRED: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED; - case UNKNOWN: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL; - } -} + public static org.hl7.fhir.r4.model.Enumerations.PublicationStatus convertPublicationStatus(org.hl7.fhir.r5.model.Enumerations.PublicationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE; + case RETIRED: + return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED; + case UNKNOWN: + return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL; + } + } - public static org.hl7.fhir.r5.model.Enumerations.FHIRVersion convertFHIRVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case _0_01: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_01; - case _0_05: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_05; - case _0_06: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_06; - case _0_11: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_11; - case _0_0_80: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_80; - case _0_0_81: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_81; - case _0_0_82: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_82; - case _0_4_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_4_0; - case _0_5_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_5_0; - case _1_0_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_0; - case _1_0_1: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_1; - case _1_0_2: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_2; - case _1_1_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_1_0; - case _1_4_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_4_0; - case _1_6_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_6_0; - case _1_8_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_8_0; - case _3_0_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_0; - case _3_0_1: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_1; - case _3_0_2: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_2; - case _3_3_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_3_0; - case _3_5_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_5_0; - case _4_0_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_0; - case _4_0_1: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_1; - default: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL; - } -} + public static org.hl7.fhir.r5.model.Enumerations.FHIRVersion convertFHIRVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case _0_01: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_01; + case _0_05: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_05; + case _0_06: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_06; + case _0_11: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_11; + case _0_0_80: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_80; + case _0_0_81: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_81; + case _0_0_82: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_82; + case _0_4_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_4_0; + case _0_5_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_5_0; + case _1_0_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_0; + case _1_0_1: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_1; + case _1_0_2: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_2; + case _1_1_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_1_0; + case _1_4_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_4_0; + case _1_6_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_6_0; + case _1_8_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_8_0; + case _3_0_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_0; + case _3_0_1: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_1; + case _3_0_2: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_2; + case _3_3_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_3_0; + case _3_5_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_5_0; + case _4_0_0: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_0; + case _4_0_1: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_1; + default: + return org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL; + } + } - public static org.hl7.fhir.r4.model.Enumerations.FHIRVersion convertFHIRVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case _0_01: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_01; - case _0_05: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_05; - case _0_06: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_06; - case _0_11: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_11; - case _0_0_80: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_80; - case _0_0_81: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_81; - case _0_0_82: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_82; - case _0_4_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_4_0; - case _0_5_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_5_0; - case _1_0_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_0; - case _1_0_1: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_1; - case _1_0_2: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_2; - case _1_1_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_1_0; - case _1_4_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_4_0; - case _1_6_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_6_0; - case _1_8_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_8_0; - case _3_0_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_0; - case _3_0_1: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_1; - case _3_0_2: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_2; - case _3_3_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_3_0; - case _3_5_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_5_0; - case _4_0_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_0; - case _4_0_1: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_1; - default: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL; - } -} + public static org.hl7.fhir.r4.model.Enumerations.FHIRVersion convertFHIRVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case _0_01: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_01; + case _0_05: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_05; + case _0_06: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_06; + case _0_11: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_11; + case _0_0_80: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_80; + case _0_0_81: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_81; + case _0_0_82: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_82; + case _0_4_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_4_0; + case _0_5_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_5_0; + case _1_0_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_0; + case _1_0_1: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_1; + case _1_0_2: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_2; + case _1_1_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_1_0; + case _1_4_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_4_0; + case _1_6_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_6_0; + case _1_8_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_8_0; + case _3_0_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_0; + case _3_0_1: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_1; + case _3_0_2: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_2; + case _3_3_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_3_0; + case _3_5_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_5_0; + case _4_0_0: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_0; + case _4_0_1: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_1; + default: + return org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL; + } + } - public static org.hl7.fhir.r5.model.Enumerations.SearchParamType convertSearchParamType(org.hl7.fhir.r4.model.Enumerations.SearchParamType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NUMBER: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER; - case DATE: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE; - case STRING: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING; - case TOKEN: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN; - case REFERENCE: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE; - case COMPOSITE: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE; - case QUANTITY: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY; - case URI: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI; - case SPECIAL: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.SPECIAL; - default: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL; - } -} + public static org.hl7.fhir.r5.model.Enumerations.SearchParamType convertSearchParamType(org.hl7.fhir.r4.model.Enumerations.SearchParamType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NUMBER: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER; + case DATE: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE; + case STRING: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING; + case TOKEN: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN; + case REFERENCE: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE; + case COMPOSITE: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE; + case QUANTITY: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY; + case URI: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI; + case SPECIAL: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.SPECIAL; + default: + return org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL; + } + } - public static org.hl7.fhir.r4.model.Enumerations.SearchParamType convertSearchParamType(org.hl7.fhir.r5.model.Enumerations.SearchParamType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NUMBER: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER; - case DATE: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE; - case STRING: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING; - case TOKEN: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN; - case REFERENCE: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE; - case COMPOSITE: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE; - case QUANTITY: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY; - case URI: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI; - case SPECIAL: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.SPECIAL; - default: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL; - } -} + public static org.hl7.fhir.r4.model.Enumerations.SearchParamType convertSearchParamType(org.hl7.fhir.r5.model.Enumerations.SearchParamType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NUMBER: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER; + case DATE: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE; + case STRING: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING; + case TOKEN: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN; + case REFERENCE: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE; + case COMPOSITE: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE; + case QUANTITY: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY; + case URI: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI; + case SPECIAL: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.SPECIAL; + default: + return org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL; + } + } - public static org.hl7.fhir.r5.model.Enumerations.NoteType convertNoteType(org.hl7.fhir.r4.model.Enumerations.NoteType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DISPLAY: return org.hl7.fhir.r5.model.Enumerations.NoteType.DISPLAY; - case PRINT: return org.hl7.fhir.r5.model.Enumerations.NoteType.PRINT; - case PRINTOPER: return org.hl7.fhir.r5.model.Enumerations.NoteType.PRINTOPER; - default: return org.hl7.fhir.r5.model.Enumerations.NoteType.NULL; - } -} + public static org.hl7.fhir.r5.model.Enumerations.NoteType convertNoteType(org.hl7.fhir.r4.model.Enumerations.NoteType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DISPLAY: + return org.hl7.fhir.r5.model.Enumerations.NoteType.DISPLAY; + case PRINT: + return org.hl7.fhir.r5.model.Enumerations.NoteType.PRINT; + case PRINTOPER: + return org.hl7.fhir.r5.model.Enumerations.NoteType.PRINTOPER; + default: + return org.hl7.fhir.r5.model.Enumerations.NoteType.NULL; + } + } - public static org.hl7.fhir.r4.model.Enumerations.NoteType convertNoteType(org.hl7.fhir.r5.model.Enumerations.NoteType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DISPLAY: return org.hl7.fhir.r4.model.Enumerations.NoteType.DISPLAY; - case PRINT: return org.hl7.fhir.r4.model.Enumerations.NoteType.PRINT; - case PRINTOPER: return org.hl7.fhir.r4.model.Enumerations.NoteType.PRINTOPER; - default: return org.hl7.fhir.r4.model.Enumerations.NoteType.NULL; - } -} + public static org.hl7.fhir.r4.model.Enumerations.NoteType convertNoteType(org.hl7.fhir.r5.model.Enumerations.NoteType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DISPLAY: + return org.hl7.fhir.r4.model.Enumerations.NoteType.DISPLAY; + case PRINT: + return org.hl7.fhir.r4.model.Enumerations.NoteType.PRINT; + case PRINTOPER: + return org.hl7.fhir.r4.model.Enumerations.NoteType.PRINTOPER; + default: + return org.hl7.fhir.r4.model.Enumerations.NoteType.NULL; + } + } - public static org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship convertConceptMapRelationship(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case RELATEDTO: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO; - case EQUIVALENT: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT; - case EQUAL: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT; - case WIDER: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER; - case SUBSUMES: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER; - case NARROWER: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER; - case SPECIALIZES: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER; - case INEXACT: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO; - case UNMATCHED: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL; - case DISJOINT: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO; - default: return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL; - } -} + public static org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship convertConceptMapRelationship(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case RELATEDTO: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO; + case EQUIVALENT: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT; + case EQUAL: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT; + case WIDER: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER; + case SUBSUMES: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.BROADER; + case NARROWER: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER; + case SPECIALIZES: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NARROWER; + case INEXACT: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO; + case UNMATCHED: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL; + case DISJOINT: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO; + default: + return org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL; + } + } - public static org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence convertConceptMapEquivalence(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case RELATEDTO: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO; - case EQUIVALENT: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT; - case BROADER: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER; - case NARROWER: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER; - case NOTRELATEDTO: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT; - default: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL; - } -} + public static org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence convertConceptMapEquivalence(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case RELATEDTO: + return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO; + case EQUIVALENT: + return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT; + case BROADER: + return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER; + case NARROWER: + return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER; + case NOTRELATEDTO: + return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT; + default: + return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL; + } + } - public static org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CURRENT: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT; - case SUPERSEDED: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CURRENT: + return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT; + case SUPERSEDED: + return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL; + } + } - public static org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CURRENT: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT; - case SUPERSEDED: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.AdministrativeGender convertAdministrativeGender(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MALE: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE; - case FEMALE: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE; - case OTHER: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL; - } -} - - public static org.hl7.fhir.r4.model.Enumerations.AdministrativeGender convertAdministrativeGender(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MALE: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE; - case FEMALE: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE; - case OTHER: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER; - case UNKNOWN: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN; - default: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL; - } -} + public static org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CURRENT: + return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT; + case SUPERSEDED: + return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL; + } + } + public static org.hl7.fhir.r5.model.Enumerations.AdministrativeGender convertAdministrativeGender(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MALE: + return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE; + case FEMALE: + return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE; + case OTHER: + return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL; + } + } + public static org.hl7.fhir.r4.model.Enumerations.AdministrativeGender convertAdministrativeGender(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MALE: + return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE; + case FEMALE: + return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE; + case OTHER: + return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER; + case UNKNOWN: + return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EpisodeOfCare.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EpisodeOfCare.java index b656d3fdf..d36de2fa2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EpisodeOfCare.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EpisodeOfCare.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,157 +50,182 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class EpisodeOfCare extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r4.model.EpisodeOfCare src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.EpisodeOfCare tgt = new org.hl7.fhir.r5.model.EpisodeOfCare(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) - tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getReferralRequest()) - tgt.addReferralRequest(convertReference(t)); - if (src.hasCareManager()) - tgt.setCareManager(convertReference(src.getCareManager())); - for (org.hl7.fhir.r4.model.Reference t : src.getTeam()) - tgt.addTeam(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) - tgt.addAccount(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r5.model.EpisodeOfCare src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.EpisodeOfCare tgt = new org.hl7.fhir.r4.model.EpisodeOfCare(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) - tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest()) - tgt.addReferralRequest(convertReference(t)); - if (src.hasCareManager()) - tgt.setCareManager(convertReference(src.getCareManager())); - for (org.hl7.fhir.r5.model.Reference t : src.getTeam()) - tgt.addTeam(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) - tgt.addAccount(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus convertEpisodeOfCareStatus(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED; - case WAITLIST: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST; - case ACTIVE: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD; - case FINISHED: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED; - case CANCELLED: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus convertEpisodeOfCareStatus(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PLANNED: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED; - case WAITLIST: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST; - case ACTIVE: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD; - case FINISHED: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED; - case CANCELLED: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); - copyElement(src, tgt); - if (src.hasStatus()) - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); - copyElement(src, tgt); - if (src.hasStatus()) - tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasCondition()) - tgt.setCondition(convertReference(src.getCondition())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasRank()) - tgt.setRankElement(convertPositiveInt(src.getRankElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasCondition()) - tgt.setCondition(convertReference(src.getCondition())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasRank()) - tgt.setRankElement(convertPositiveInt(src.getRankElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r4.model.EpisodeOfCare src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EpisodeOfCare tgt = new org.hl7.fhir.r5.model.EpisodeOfCare(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasReferralRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(convertReference(t)); + } + if (src.hasCareManager()) + tgt.setCareManager(convertReference(src.getCareManager())); + if (src.hasTeam()) { + for (org.hl7.fhir.r4.model.Reference t : src.getTeam()) tgt.addTeam(convertReference(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r5.model.EpisodeOfCare src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.EpisodeOfCare tgt = new org.hl7.fhir.r4.model.EpisodeOfCare(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + if (src.hasStatusHistory()) { + for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasReferralRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest()) tgt.addReferralRequest(convertReference(t)); + } + if (src.hasCareManager()) + tgt.setCareManager(convertReference(src.getCareManager())); + if (src.hasTeam()) { + for (org.hl7.fhir.r5.model.Reference t : src.getTeam()) tgt.addTeam(convertReference(t)); + } + if (src.hasAccount()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus convertEpisodeOfCareStatus(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED; + case WAITLIST: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST; + case ACTIVE: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD; + case FINISHED: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED; + case CANCELLED: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus convertEpisodeOfCareStatus(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PLANNED: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED; + case WAITLIST: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST; + case ACTIVE: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD; + case FINISHED: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED; + case CANCELLED: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); + copyElement(src, tgt); + if (src.hasStatus()) + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); + copyElement(src, tgt); + if (src.hasStatus()) + tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(convertReference(src.getCondition())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasRank()) + tgt.setRankElement(convertPositiveInt(src.getRankElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(convertReference(src.getCondition())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasRank()) + tgt.setRankElement(convertPositiveInt(src.getRankElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EventDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EventDefinition.java index 9c594f049..1d6c822ad 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EventDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/EventDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,139 +50,156 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class EventDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.EventDefinition convertEventDefinition(org.hl7.fhir.r4.model.EventDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.EventDefinition tgt = new org.hl7.fhir.r5.model.EventDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger()) - tgt.addTrigger(convertTriggerDefinition(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.EventDefinition convertEventDefinition(org.hl7.fhir.r5.model.EventDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.EventDefinition tgt = new org.hl7.fhir.r4.model.EventDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) - tgt.addTrigger(convertTriggerDefinition(t)); - return tgt; - } - + public static org.hl7.fhir.r5.model.EventDefinition convertEventDefinition(org.hl7.fhir.r4.model.EventDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EventDefinition tgt = new org.hl7.fhir.r5.model.EventDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasTrigger()) { + for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger()) tgt.addTrigger(convertTriggerDefinition(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.EventDefinition convertEventDefinition(org.hl7.fhir.r5.model.EventDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.EventDefinition tgt = new org.hl7.fhir.r4.model.EventDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasTrigger()) { + for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) tgt.addTrigger(convertTriggerDefinition(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExampleScenario.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExampleScenario.java index c43baf356..79d59bf5e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExampleScenario.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExampleScenario.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,405 +50,432 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ExampleScenario extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r4.model.ExampleScenario src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario tgt = new org.hl7.fhir.r5.model.ExampleScenario(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor()) - tgt.addActor(convertExampleScenarioActorComponent(t)); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance()) - tgt.addInstance(convertExampleScenarioInstanceComponent(t)); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) - tgt.addProcess(convertExampleScenarioProcessComponent(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getWorkflow()) - tgt.getWorkflow().add(convertCanonical(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r4.model.ExampleScenario src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario tgt = new org.hl7.fhir.r5.model.ExampleScenario(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasActor()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor()) tgt.addActor(convertExampleScenarioActorComponent(t)); + } + if (src.hasInstance()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance()) tgt.addInstance(convertExampleScenarioInstanceComponent(t)); + } + if (src.hasProcess()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) tgt.addProcess(convertExampleScenarioProcessComponent(t)); + } + if (src.hasWorkflow()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getWorkflow()) tgt.getWorkflow().add(convertCanonical(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r5.model.ExampleScenario src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario tgt = new org.hl7.fhir.r4.model.ExampleScenario(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor()) - tgt.addActor(convertExampleScenarioActorComponent(t)); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance()) - tgt.addInstance(convertExampleScenarioInstanceComponent(t)); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) - tgt.addProcess(convertExampleScenarioProcessComponent(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getWorkflow()) - tgt.getWorkflow().add(convertCanonical(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r5.model.ExampleScenario src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario tgt = new org.hl7.fhir.r4.model.ExampleScenario(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasActor()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor()) tgt.addActor(convertExampleScenarioActorComponent(t)); + } + if (src.hasInstance()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance()) tgt.addInstance(convertExampleScenarioInstanceComponent(t)); + } + if (src.hasProcess()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) tgt.addProcess(convertExampleScenarioProcessComponent(t)); + } + if (src.hasWorkflow()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getWorkflow()) tgt.getWorkflow().add(convertCanonical(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent(); - copyElement(src, tgt); - if (src.hasActorId()) - tgt.setActorIdElement(convertString(src.getActorIdElement())); - if (src.hasType()) - tgt.setType(convertExampleScenarioActorType(src.getType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent(); - copyElement(src, tgt); - if (src.hasActorId()) - tgt.setActorIdElement(convertString(src.getActorIdElement())); - if (src.hasType()) - tgt.setType(convertExampleScenarioActorType(src.getType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType convertExampleScenarioActorType(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PERSON: return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.PERSON; - case ENTITY: return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.ENTITY; - default: return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.NULL; - } -} - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType convertExampleScenarioActorType(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PERSON: return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.PERSON; - case ENTITY: return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.ENTITY; - default: return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.NULL; - } -} - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent(); - copyElement(src, tgt); - if (src.hasResourceId()) - tgt.setResourceIdElement(convertString(src.getResourceIdElement())); - if (src.hasResourceType()) - tgt.setResourceTypeElement(convertFHIRResourceType(src.getResourceTypeElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion()) - tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t)); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance()) - tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent(); - copyElement(src, tgt); - if (src.hasResourceId()) - tgt.setResourceIdElement(convertString(src.getResourceIdElement())); - if (src.hasResourceType()) - tgt.setResourceTypeElement(convertFHIRResourceType(src.getResourceTypeElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion()) - tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t)); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance()) - tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.CodeType convertFHIRResourceType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.CodeType tgt = new org.hl7.fhir.r5.model.CodeType(src.asStringValue()); - copyElement(src, tgt); - return tgt; - } - - - public static org.hl7.fhir.r4.model.Enumeration convertFHIRResourceType(org.hl7.fhir.r5.model.CodeType src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration(new org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceTypeEnumFactory(), src.getCode()); - copyElement(src, tgt); - return tgt; - } - - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent(); - copyElement(src, tgt); - if (src.hasVersionId()) - tgt.setVersionIdElement(convertString(src.getVersionIdElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent(); - copyElement(src, tgt); - if (src.hasVersionId()) - tgt.setVersionIdElement(convertString(src.getVersionIdElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent(); - copyElement(src, tgt); - if (src.hasResourceId()) - tgt.setResourceIdElement(convertString(src.getResourceIdElement())); - if (src.hasVersionId()) - tgt.setVersionIdElement(convertString(src.getVersionIdElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent(); - copyElement(src, tgt); - if (src.hasResourceId()) - tgt.setResourceIdElement(convertString(src.getResourceIdElement())); - if (src.hasVersionId()) - tgt.setVersionIdElement(convertString(src.getVersionIdElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent(); - copyElement(src, tgt); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - if (src.hasPreConditions()) - tgt.setPreConditionsElement(convertMarkdown(src.getPreConditionsElement())); - if (src.hasPostConditions()) - tgt.setPostConditionsElement(convertMarkdown(src.getPostConditionsElement())); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) - tgt.addStep(convertExampleScenarioProcessStepComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent(); - copyElement(src, tgt); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - if (src.hasPreConditions()) - tgt.setPreConditionsElement(convertMarkdown(src.getPreConditionsElement())); - if (src.hasPostConditions()) - tgt.setPostConditionsElement(convertMarkdown(src.getPostConditionsElement())); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) - tgt.addStep(convertExampleScenarioProcessStepComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) - tgt.addProcess(convertExampleScenarioProcessComponent(t)); - if (src.hasPause()) - tgt.setPauseElement(convertBoolean(src.getPauseElement())); - if (src.hasOperation()) - tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation())); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative()) - tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) - tgt.addProcess(convertExampleScenarioProcessComponent(t)); - if (src.hasPause()) - tgt.setPauseElement(convertBoolean(src.getPauseElement())); - if (src.hasOperation()) - tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation())); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative()) - tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent(); - copyElement(src, tgt); - if (src.hasNumber()) - tgt.setNumberElement(convertString(src.getNumberElement())); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasInitiator()) - tgt.setInitiatorElement(convertString(src.getInitiatorElement())); - if (src.hasReceiver()) - tgt.setReceiverElement(convertString(src.getReceiverElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - if (src.hasInitiatorActive()) - tgt.setInitiatorActiveElement(convertBoolean(src.getInitiatorActiveElement())); - if (src.hasReceiverActive()) - tgt.setReceiverActiveElement(convertBoolean(src.getReceiverActiveElement())); - if (src.hasRequest()) - tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest())); - if (src.hasResponse()) - tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent(); - copyElement(src, tgt); - if (src.hasNumber()) - tgt.setNumberElement(convertString(src.getNumberElement())); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasInitiator()) - tgt.setInitiatorElement(convertString(src.getInitiatorElement())); - if (src.hasReceiver()) - tgt.setReceiverElement(convertString(src.getReceiverElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - if (src.hasInitiatorActive()) - tgt.setInitiatorActiveElement(convertBoolean(src.getInitiatorActiveElement())); - if (src.hasReceiverActive()) - tgt.setReceiverActiveElement(convertBoolean(src.getReceiverActiveElement())); - if (src.hasRequest()) - tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest())); - if (src.hasResponse()) - tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent(); - copyElement(src, tgt); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) - tgt.addStep(convertExampleScenarioProcessStepComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent(); - copyElement(src, tgt); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) - tgt.addStep(convertExampleScenarioProcessStepComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent(); + copyElement(src, tgt); + if (src.hasActorId()) + tgt.setActorIdElement(convertString(src.getActorIdElement())); + if (src.hasType()) + tgt.setType(convertExampleScenarioActorType(src.getType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent(); + copyElement(src, tgt); + if (src.hasActorId()) + tgt.setActorIdElement(convertString(src.getActorIdElement())); + if (src.hasType()) + tgt.setType(convertExampleScenarioActorType(src.getType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType convertExampleScenarioActorType(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PERSON: + return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.PERSON; + case ENTITY: + return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.ENTITY; + default: + return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.NULL; + } + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType convertExampleScenarioActorType(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PERSON: + return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.PERSON; + case ENTITY: + return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.ENTITY; + default: + return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.NULL; + } + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent(); + copyElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(convertString(src.getResourceIdElement())); + if (src.hasResourceType()) + tgt.setResourceTypeElement(convertFHIRResourceType(src.getResourceTypeElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasVersion()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion()) tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t)); + } + if (src.hasContainedInstance()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance()) tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent(); + copyElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(convertString(src.getResourceIdElement())); + if (src.hasResourceType()) + tgt.setResourceTypeElement(convertFHIRResourceType(src.getResourceTypeElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasVersion()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion()) tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t)); + } + if (src.hasContainedInstance()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance()) tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeType convertFHIRResourceType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeType tgt = new org.hl7.fhir.r5.model.CodeType(src.asStringValue()); + copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4.model.Enumeration convertFHIRResourceType(org.hl7.fhir.r5.model.CodeType src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration(new org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceTypeEnumFactory(), src.getCode()); + copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent(); + copyElement(src, tgt); + if (src.hasVersionId()) + tgt.setVersionIdElement(convertString(src.getVersionIdElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent(); + copyElement(src, tgt); + if (src.hasVersionId()) + tgt.setVersionIdElement(convertString(src.getVersionIdElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent(); + copyElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(convertString(src.getResourceIdElement())); + if (src.hasVersionId()) + tgt.setVersionIdElement(convertString(src.getVersionIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent(); + copyElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(convertString(src.getResourceIdElement())); + if (src.hasVersionId()) + tgt.setVersionIdElement(convertString(src.getVersionIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent(); + copyElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasPreConditions()) + tgt.setPreConditionsElement(convertMarkdown(src.getPreConditionsElement())); + if (src.hasPostConditions()) + tgt.setPostConditionsElement(convertMarkdown(src.getPostConditionsElement())); + if (src.hasStep()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent(); + copyElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasPreConditions()) + tgt.setPreConditionsElement(convertMarkdown(src.getPreConditionsElement())); + if (src.hasPostConditions()) + tgt.setPostConditionsElement(convertMarkdown(src.getPostConditionsElement())); + if (src.hasStep()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent(); + copyElement(src, tgt); + if (src.hasProcess()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) tgt.addProcess(convertExampleScenarioProcessComponent(t)); + } + if (src.hasPause()) + tgt.setPauseElement(convertBoolean(src.getPauseElement())); + if (src.hasOperation()) + tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation())); + if (src.hasAlternative()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative()) tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent(); + copyElement(src, tgt); + if (src.hasProcess()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) tgt.addProcess(convertExampleScenarioProcessComponent(t)); + } + if (src.hasPause()) + tgt.setPauseElement(convertBoolean(src.getPauseElement())); + if (src.hasOperation()) + tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation())); + if (src.hasAlternative()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative()) tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent(); + copyElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(convertString(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasInitiator()) + tgt.setInitiatorElement(convertString(src.getInitiatorElement())); + if (src.hasReceiver()) + tgt.setReceiverElement(convertString(src.getReceiverElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasInitiatorActive()) + tgt.setInitiatorActiveElement(convertBoolean(src.getInitiatorActiveElement())); + if (src.hasReceiverActive()) + tgt.setReceiverActiveElement(convertBoolean(src.getReceiverActiveElement())); + if (src.hasRequest()) + tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent(); + copyElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(convertString(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasInitiator()) + tgt.setInitiatorElement(convertString(src.getInitiatorElement())); + if (src.hasReceiver()) + tgt.setReceiverElement(convertString(src.getReceiverElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasInitiatorActive()) + tgt.setInitiatorActiveElement(convertBoolean(src.getInitiatorActiveElement())); + if (src.hasReceiverActive()) + tgt.setReceiverActiveElement(convertBoolean(src.getReceiverActiveElement())); + if (src.hasRequest()) + tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent(); + copyElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasStep()) { + for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent(); + copyElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasStep()) { + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExplanationOfBenefit.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExplanationOfBenefit.java index e6eb84aa2..2b04eedbd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExplanationOfBenefit.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ExplanationOfBenefit.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,1165 +50,1308 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ExplanationOfBenefit extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ExplanationOfBenefit convertExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertExplanationOfBenefitStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasUse()) - tgt.setUse(convertUse(src.getUse())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasBillablePeriod()) - tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasFundsReserveRequested()) - tgt.setFundsReserveRequested(convertCodeableConcept(src.getFundsReserveRequested())); - if (src.hasFundsReserve()) - tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent t : src.getRelated()) - tgt.addRelated(convertRelatedClaimComponent(t)); - if (src.hasPrescription()) - tgt.setPrescription(convertReference(src.getPrescription())); - if (src.hasOriginalPrescription()) - tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); - if (src.hasPayee()) - tgt.setPayee(convertPayeeComponent(src.getPayee())); - if (src.hasReferral()) - tgt.setReferral(convertReference(src.getReferral())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - if (src.hasClaim()) - tgt.setClaim(convertReference(src.getClaim())); - if (src.hasClaimResponse()) - tgt.setClaimResponse(convertReference(src.getClaimResponse())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getPreAuthRef()) - tgt.getPreAuthRef().add(convertString(t)); - for (org.hl7.fhir.r4.model.Period t : src.getPreAuthRefPeriod()) - tgt.addPreAuthRefPeriod(convertPeriod(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent t : src.getCareTeam()) - tgt.addCareTeam(convertCareTeamComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertSupportingInformationComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent t : src.getProcedure()) - tgt.addProcedure(convertProcedureComponent(t)); - if (src.hasPrecedence()) - tgt.setPrecedenceElement(convertPositiveInt(src.getPrecedenceElement())); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - if (src.hasAccident()) - tgt.setAccident(convertAccidentComponent(src.getAccident())); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent t : src.getItem()) - tgt.addItem(convertItemComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent t : src.getAddItem()) - tgt.addAddItem(convertAddedItemComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent t : src.getTotal()) - tgt.addTotal(convertTotalComponent(t)); - if (src.hasPayment()) - tgt.setPayment(convertPaymentComponent(src.getPayment())); - if (src.hasFormCode()) - tgt.setFormCode(convertCodeableConcept(src.getFormCode())); - if (src.hasForm()) - tgt.setForm(convertAttachment(src.getForm())); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent t : src.getProcessNote()) - tgt.addProcessNote(convertNoteComponent(t)); - if (src.hasBenefitPeriod()) - tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent t : src.getBenefitBalance()) - tgt.addBenefitBalance(convertBenefitBalanceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit convertExplanationOfBenefit(org.hl7.fhir.r5.model.ExplanationOfBenefit src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertExplanationOfBenefitStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubType()) - tgt.setSubType(convertCodeableConcept(src.getSubType())); - if (src.hasUse()) - tgt.setUse(convertUse(src.getUse())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasBillablePeriod()) - tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasInsurer()) - tgt.setInsurer(convertReference(src.getInsurer())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasFundsReserveRequested()) - tgt.setFundsReserveRequested(convertCodeableConcept(src.getFundsReserveRequested())); - if (src.hasFundsReserve()) - tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent t : src.getRelated()) - tgt.addRelated(convertRelatedClaimComponent(t)); - if (src.hasPrescription()) - tgt.setPrescription(convertReference(src.getPrescription())); - if (src.hasOriginalPrescription()) - tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); - if (src.hasPayee()) - tgt.setPayee(convertPayeeComponent(src.getPayee())); - if (src.hasReferral()) - tgt.setReferral(convertReference(src.getReferral())); - if (src.hasFacility()) - tgt.setFacility(convertReference(src.getFacility())); - if (src.hasClaim()) - tgt.setClaim(convertReference(src.getClaim())); - if (src.hasClaimResponse()) - tgt.setClaimResponse(convertReference(src.getClaimResponse())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) - tgt.getPreAuthRef().add(convertString(t)); - for (org.hl7.fhir.r5.model.Period t : src.getPreAuthRefPeriod()) - tgt.addPreAuthRefPeriod(convertPeriod(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent t : src.getCareTeam()) - tgt.addCareTeam(convertCareTeamComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertSupportingInformationComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent t : src.getDiagnosis()) - tgt.addDiagnosis(convertDiagnosisComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent t : src.getProcedure()) - tgt.addProcedure(convertProcedureComponent(t)); - if (src.hasPrecedence()) - tgt.setPrecedenceElement(convertPositiveInt(src.getPrecedenceElement())); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent t : src.getInsurance()) - tgt.addInsurance(convertInsuranceComponent(t)); - if (src.hasAccident()) - tgt.setAccident(convertAccidentComponent(src.getAccident())); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent t : src.getItem()) - tgt.addItem(convertItemComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent t : src.getAddItem()) - tgt.addAddItem(convertAddedItemComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent t : src.getTotal()) - tgt.addTotal(convertTotalComponent(t)); - if (src.hasPayment()) - tgt.setPayment(convertPaymentComponent(src.getPayment())); - if (src.hasFormCode()) - tgt.setFormCode(convertCodeableConcept(src.getFormCode())); - if (src.hasForm()) - tgt.setForm(convertAttachment(src.getForm())); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent t : src.getProcessNote()) - tgt.addProcessNote(convertNoteComponent(t)); - if (src.hasBenefitPeriod()) - tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent t : src.getBenefitBalance()) - tgt.addBenefitBalance(convertBenefitBalanceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus convertExplanationOfBenefitStatus(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus convertExplanationOfBenefitStatus(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.Use convertUse(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLAIM: return org.hl7.fhir.r5.model.Enumerations.Use.CLAIM; - case PREAUTHORIZATION: return org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION; - case PREDETERMINATION: return org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION; - default: return org.hl7.fhir.r5.model.Enumerations.Use.NULL; - } -} - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.Use convertUse(org.hl7.fhir.r5.model.Enumerations.Use src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CLAIM: return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.CLAIM; - case PREAUTHORIZATION: return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREAUTHORIZATION; - case PREDETERMINATION: return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREDETERMINATION; - default: return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; - case COMPLETE: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; - case ERROR: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; - case PARTIAL: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; - default: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.QUEUED; - case COMPLETE: return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.COMPLETE; - case ERROR: return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.ERROR; - case PARTIAL: return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.PARTIAL; - default: return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.NULL; - } -} - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent(); - copyElement(src, tgt); - if (src.hasClaim()) - tgt.setClaim(convertReference(src.getClaim())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasReference()) - tgt.setReference(convertIdentifier(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent(); - copyElement(src, tgt); - if (src.hasClaim()) - tgt.setClaim(convertReference(src.getClaim())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasReference()) - tgt.setReference(convertIdentifier(src.getReference())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasParty()) - tgt.setParty(convertReference(src.getParty())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasResponsible()) - tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasQualification()) - tgt.setQualification(convertCodeableConcept(src.getQualification())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasResponsible()) - tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasQualification()) - tgt.setQualification(convertCodeableConcept(src.getQualification())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasReason()) - tgt.setReason(convertCoding(src.getReason())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasReason()) - tgt.setReason(convertCoding(src.getReason())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasDiagnosis()) - tgt.setDiagnosis(convertType(src.getDiagnosis())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasOnAdmission()) - tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); - if (src.hasPackageCode()) - tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasDiagnosis()) - tgt.setDiagnosis(convertType(src.getDiagnosis())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasOnAdmission()) - tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); - if (src.hasPackageCode()) - tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertType(src.getProcedure())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertType(src.getProcedure())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - for (org.hl7.fhir.r4.model.StringType t : src.getPreAuthRef()) - tgt.getPreAuthRef().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent(); - copyElement(src, tgt); - if (src.hasFocal()) - tgt.setFocalElement(convertBoolean(src.getFocalElement())); - if (src.hasCoverage()) - tgt.setCoverage(convertReference(src.getCoverage())); - for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) - tgt.getPreAuthRef().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent(); - copyElement(src, tgt); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent(); - copyElement(src, tgt); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent convertItemComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getCareTeamSequence()) - tgt.getCareTeamSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDiagnosisSequence()) - tgt.getDiagnosisSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getProcedureSequence()) - tgt.getProcedureSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getInformationSequence()) - tgt.getInformationSequence().add(convertPositiveInt(t)); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEncounter()) - tgt.addEncounter(convertReference(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent t : src.getDetail()) - tgt.addDetail(convertDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence()) - tgt.getCareTeamSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence()) - tgt.getDiagnosisSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence()) - tgt.getProcedureSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence()) - tgt.getInformationSequence().add(convertPositiveInt(t)); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) - tgt.addEncounter(convertReference(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent t : src.getDetail()) - tgt.addDetail(convertDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasValue()) - tgt.setValueElement(convertDecimal(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasValue()) - tgt.setValueElement(convertDecimal(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent convertDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasRevenue()) - tgt.setRevenue(convertCodeableConcept(src.getRevenue())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) - tgt.addUdi(convertReference(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getItemSequence()) - tgt.getItemSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDetailSequence()) - tgt.getDetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSubDetailSequence()) - tgt.getSubDetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getProvider()) - tgt.addProvider(convertReference(t)); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent t : src.getDetail()) - tgt.addDetail(convertAddedItemDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence()) - tgt.getItemSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence()) - tgt.getDetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubDetailSequence()) - tgt.getSubDetailSequence().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) - tgt.addProvider(convertReference(t)); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) - tgt.addProgramCode(convertCodeableConcept(t)); - if (src.hasServiced()) - tgt.setServiced(convertType(src.getServiced())); - if (src.hasLocation()) - tgt.setLocation(convertType(src.getLocation())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) - tgt.addSubSite(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent t : src.getDetail()) - tgt.addDetail(convertAddedItemDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertAddedItemDetailSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent t : src.getSubDetail()) - tgt.addSubDetail(convertAddedItemDetailSubDetailComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent convertAddedItemDetailSubDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent convertAddedItemDetailSubDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent(); - copyElement(src, tgt); - if (src.hasProductOrService()) - tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) - tgt.addModifier(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasUnitPrice()) - tgt.setUnitPrice(convertMoney(src.getUnitPrice())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasNet()) - tgt.setNet(convertMoney(src.getNet())); - for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) - tgt.getNoteNumber().add(convertPositiveInt(t)); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) - tgt.addAdjudication(convertAdjudicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent convertTotalComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAdjustment()) - tgt.setAdjustment(convertMoney(src.getAdjustment())); - if (src.hasAdjustmentReason()) - tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAdjustment()) - tgt.setAdjustment(convertMoney(src.getAdjustment())); - if (src.hasAdjustmentReason()) - tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent convertNoteComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent(); - copyElement(src, tgt); - if (src.hasNumber()) - tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); - if (src.hasType()) - tgt.setType(Enumerations.convertNoteType(src.getType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent(); - copyElement(src, tgt); - if (src.hasNumber()) - tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); - if (src.hasType()) - tgt.setType(Enumerations.convertNoteType(src.getType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent convertBenefitBalanceComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasExcluded()) - tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasNetwork()) - tgt.setNetwork(convertCodeableConcept(src.getNetwork())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasTerm()) - tgt.setTerm(convertCodeableConcept(src.getTerm())); - for (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent t : src.getFinancial()) - tgt.addFinancial(convertBenefitComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent convertBenefitBalanceComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasExcluded()) - tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasNetwork()) - tgt.setNetwork(convertCodeableConcept(src.getNetwork())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasTerm()) - tgt.setTerm(convertCodeableConcept(src.getTerm())); - for (org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent t : src.getFinancial()) - tgt.addFinancial(convertBenefitComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent convertBenefitComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAllowed()) - tgt.setAllowed(convertType(src.getAllowed())); - if (src.hasUsed()) - tgt.setUsed(convertType(src.getUsed())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent convertBenefitComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAllowed()) - tgt.setAllowed(convertType(src.getAllowed())); - if (src.hasUsed()) - tgt.setUsed(convertType(src.getUsed())); - return tgt; - } + public static org.hl7.fhir.r5.model.ExplanationOfBenefit convertExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertExplanationOfBenefitStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUse(convertUse(src.getUse())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserveRequested()) + tgt.setFundsReserveRequested(convertCodeableConcept(src.getFundsReserveRequested())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); + if (src.hasRelated()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent t : src.getRelated()) tgt.addRelated(convertRelatedClaimComponent(t)); + } + if (src.hasPrescription()) + tgt.setPrescription(convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasClaim()) + tgt.setClaim(convertReference(src.getClaim())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(convertReference(src.getClaimResponse())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasPreAuthRef()) { + for (org.hl7.fhir.r4.model.StringType t : src.getPreAuthRef()) tgt.getPreAuthRef().add(convertString(t)); + } + if (src.hasPreAuthRefPeriod()) { + for (org.hl7.fhir.r4.model.Period t : src.getPreAuthRefPeriod()) tgt.addPreAuthRefPeriod(convertPeriod(t)); + } + if (src.hasCareTeam()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent t : src.getCareTeam()) tgt.addCareTeam(convertCareTeamComponent(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent t : src.getSupportingInfo()) tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasProcedure()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent t : src.getProcedure()) tgt.addProcedure(convertProcedureComponent(t)); + } + if (src.hasPrecedence()) + tgt.setPrecedenceElement(convertPositiveInt(src.getPrecedenceElement())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + } + if (src.hasAddItem()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent t : src.getAddItem()) tgt.addAddItem(convertAddedItemComponent(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasTotal()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t)); + } + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFormCode()) + tgt.setFormCode(convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(convertAttachment(src.getForm())); + if (src.hasProcessNote()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent t : src.getProcessNote()) tgt.addProcessNote(convertNoteComponent(t)); + } + if (src.hasBenefitPeriod()) + tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); + if (src.hasBenefitBalance()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent t : src.getBenefitBalance()) tgt.addBenefitBalance(convertBenefitBalanceComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ExplanationOfBenefit convertExplanationOfBenefit(org.hl7.fhir.r5.model.ExplanationOfBenefit src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertExplanationOfBenefitStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUse(convertUse(src.getUse())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserveRequested()) + tgt.setFundsReserveRequested(convertCodeableConcept(src.getFundsReserveRequested())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve())); + if (src.hasRelated()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent t : src.getRelated()) tgt.addRelated(convertRelatedClaimComponent(t)); + } + if (src.hasPrescription()) + tgt.setPrescription(convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(convertReference(src.getFacility())); + if (src.hasClaim()) + tgt.setClaim(convertReference(src.getClaim())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(convertReference(src.getClaimResponse())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasPreAuthRef()) { + for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) tgt.getPreAuthRef().add(convertString(t)); + } + if (src.hasPreAuthRefPeriod()) { + for (org.hl7.fhir.r5.model.Period t : src.getPreAuthRefPeriod()) tgt.addPreAuthRefPeriod(convertPeriod(t)); + } + if (src.hasCareTeam()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent t : src.getCareTeam()) tgt.addCareTeam(convertCareTeamComponent(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent t : src.getSupportingInfo()) tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + } + if (src.hasDiagnosis()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent t : src.getDiagnosis()) tgt.addDiagnosis(convertDiagnosisComponent(t)); + } + if (src.hasProcedure()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent t : src.getProcedure()) tgt.addProcedure(convertProcedureComponent(t)); + } + if (src.hasPrecedence()) + tgt.setPrecedenceElement(convertPositiveInt(src.getPrecedenceElement())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent t : src.getInsurance()) tgt.addInsurance(convertInsuranceComponent(t)); + } + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + } + if (src.hasAddItem()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent t : src.getAddItem()) tgt.addAddItem(convertAddedItemComponent(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasTotal()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t)); + } + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFormCode()) + tgt.setFormCode(convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(convertAttachment(src.getForm())); + if (src.hasProcessNote()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent t : src.getProcessNote()) tgt.addProcessNote(convertNoteComponent(t)); + } + if (src.hasBenefitPeriod()) + tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod())); + if (src.hasBenefitBalance()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent t : src.getBenefitBalance()) tgt.addBenefitBalance(convertBenefitBalanceComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus convertExplanationOfBenefitStatus(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus convertExplanationOfBenefitStatus(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.Use convertUse(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLAIM: + return org.hl7.fhir.r5.model.Enumerations.Use.CLAIM; + case PREAUTHORIZATION: + return org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION; + case PREDETERMINATION: + return org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION; + default: + return org.hl7.fhir.r5.model.Enumerations.Use.NULL; + } + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.Use convertUse(org.hl7.fhir.r5.model.Enumerations.Use src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CLAIM: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.CLAIM; + case PREAUTHORIZATION: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREAUTHORIZATION; + case PREDETERMINATION: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREDETERMINATION; + default: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; + case COMPLETE: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; + case ERROR: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; + case PARTIAL: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; + default: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.QUEUED; + case COMPLETE: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.COMPLETE; + case ERROR: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.ERROR; + case PARTIAL: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.PARTIAL; + default: + return org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.NULL; + } + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent(); + copyElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent(); + copyElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.PayeeComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.CareTeamComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(convertCoding(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(convertCoding(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(convertType(src.getDiagnosis())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasOnAdmission()) + tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(convertType(src.getDiagnosis())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasOnAdmission()) + tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertType(src.getProcedure())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.ProcedureComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertType(src.getProcedure())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasPreAuthRef()) { + for (org.hl7.fhir.r4.model.StringType t : src.getPreAuthRef()) tgt.getPreAuthRef().add(convertString(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.InsuranceComponent(); + copyElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(convertReference(src.getCoverage())); + if (src.hasPreAuthRef()) { + for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) tgt.getPreAuthRef().add(convertString(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent(); + copyElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AccidentComponent(); + copyElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent convertItemComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCareTeamSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getCareTeamSequence()) tgt.getCareTeamSequence().add(convertPositiveInt(t)); + } + if (src.hasDiagnosisSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDiagnosisSequence()) tgt.getDiagnosisSequence().add(convertPositiveInt(t)); + } + if (src.hasProcedureSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getProcedureSequence()) tgt.getProcedureSequence().add(convertPositiveInt(t)); + } + if (src.hasInformationSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getInformationSequence()) tgt.getInformationSequence().add(convertPositiveInt(t)); + } + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasEncounter()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEncounter()) tgt.addEncounter(convertReference(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasCareTeamSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence()) tgt.getCareTeamSequence().add(convertPositiveInt(t)); + } + if (src.hasDiagnosisSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence()) tgt.getDiagnosisSequence().add(convertPositiveInt(t)); + } + if (src.hasProcedureSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence()) tgt.getProcedureSequence().add(convertPositiveInt(t)); + } + if (src.hasInformationSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence()) tgt.getInformationSequence().add(convertPositiveInt(t)); + } + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasEncounter()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) tgt.addEncounter(convertReference(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent convertDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.DetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.SubDetailComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasUdi()) { + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(convertReference(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getItemSequence()) tgt.getItemSequence().add(convertPositiveInt(t)); + } + if (src.hasDetailSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDetailSequence()) tgt.getDetailSequence().add(convertPositiveInt(t)); + } + if (src.hasSubDetailSequence()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSubDetailSequence()) tgt.getSubDetailSequence().add(convertPositiveInt(t)); + } + if (src.hasProvider()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProvider()) tgt.addProvider(convertReference(t)); + } + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent t : src.getDetail()) tgt.addDetail(convertAddedItemDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemComponent(); + copyElement(src, tgt); + if (src.hasItemSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence()) tgt.getItemSequence().add(convertPositiveInt(t)); + } + if (src.hasDetailSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence()) tgt.getDetailSequence().add(convertPositiveInt(t)); + } + if (src.hasSubDetailSequence()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubDetailSequence()) tgt.getSubDetailSequence().add(convertPositiveInt(t)); + } + if (src.hasProvider()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) tgt.addProvider(convertReference(t)); + } + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasProgramCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) tgt.addProgramCode(convertCodeableConcept(t)); + } + if (src.hasServiced()) + tgt.setServiced(convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasSubSite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) tgt.addSubSite(convertCodeableConcept(t)); + } + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent t : src.getDetail()) tgt.addDetail(convertAddedItemDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertAddedItemDetailSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + if (src.hasSubDetail()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent t : src.getSubDetail()) tgt.addSubDetail(convertAddedItemDetailSubDetailComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent convertAddedItemDetailSubDetailComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent convertAddedItemDetailSubDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent(); + copyElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(convertCodeableConcept(src.getProductOrService())); + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) tgt.addModifier(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(convertMoney(src.getNet())); + if (src.hasNoteNumber()) { + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) tgt.getNoteNumber().add(convertPositiveInt(t)); + } + if (src.hasAdjudication()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) tgt.addAdjudication(convertAdjudicationComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent convertTotalComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.TotalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.PaymentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent convertNoteComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent(); + copyElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setType(Enumerations.convertNoteType(src.getType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.NoteComponent(); + copyElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setType(Enumerations.convertNoteType(src.getType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent convertBenefitBalanceComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasExcluded()) + tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasNetwork()) + tgt.setNetwork(convertCodeableConcept(src.getNetwork())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasTerm()) + tgt.setTerm(convertCodeableConcept(src.getTerm())); + if (src.hasFinancial()) { + for (org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent t : src.getFinancial()) tgt.addFinancial(convertBenefitComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent convertBenefitBalanceComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitBalanceComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasExcluded()) + tgt.setExcludedElement(convertBoolean(src.getExcludedElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasNetwork()) + tgt.setNetwork(convertCodeableConcept(src.getNetwork())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasTerm()) + tgt.setTerm(convertCodeableConcept(src.getTerm())); + if (src.hasFinancial()) { + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent t : src.getFinancial()) tgt.addFinancial(convertBenefitComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent convertBenefitComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowed(convertType(src.getAllowed())); + if (src.hasUsed()) + tgt.setUsed(convertType(src.getUsed())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent convertBenefitComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent tgt = new org.hl7.fhir.r4.model.ExplanationOfBenefit.BenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowed(convertType(src.getAllowed())); + if (src.hasUsed()) + tgt.setUsed(convertType(src.getUsed())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/FamilyMemberHistory.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/FamilyMemberHistory.java index 16d9a4c8a..a556e1440 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/FamilyMemberHistory.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/FamilyMemberHistory.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,161 +51,178 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class FamilyMemberHistory extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r4.model.FamilyMemberHistory src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.FamilyMemberHistory tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - if (src.hasStatus()) - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - if (src.hasDataAbsentReason()) - tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasSex()) - tgt.setSex(convertCodeableConcept(src.getSex())); - if (src.hasBorn()) - tgt.setBorn(convertType(src.getBorn())); - if (src.hasAge()) - tgt.setAge(convertType(src.getAge())); - if (src.hasEstimatedAge()) - tgt.setEstimatedAgeElement(convertBoolean(src.getEstimatedAgeElement())); - if (src.hasDeceased()) - tgt.setDeceased(convertType(src.getDeceased())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) - tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r5.model.FamilyMemberHistory src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.FamilyMemberHistory tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - if (src.hasStatus()) - tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); - if (src.hasDataAbsentReason()) - tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertCodeableConcept(src.getRelationship())); - if (src.hasSex()) - tgt.setSex(convertCodeableConcept(src.getSex())); - if (src.hasBorn()) - tgt.setBorn(convertType(src.getBorn())); - if (src.hasAge()) - tgt.setAge(convertType(src.getAge())); - if (src.hasEstimatedAge()) - tgt.setEstimatedAgeElement(convertBoolean(src.getEstimatedAgeElement())); - if (src.hasDeceased()) - tgt.setDeceased(convertType(src.getDeceased())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) - tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus convertFamilyHistoryStatus(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PARTIAL: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL; - case COMPLETED: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR; - case HEALTHUNKNOWN: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN; - default: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus convertFamilyHistoryStatus(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PARTIAL: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL; - case COMPLETED: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR; - case HEALTHUNKNOWN: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN; - default: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasOutcome()) - tgt.setOutcome(convertCodeableConcept(src.getOutcome())); - if (src.hasContributedToDeath()) - tgt.setContributedToDeathElement(convertBoolean(src.getContributedToDeathElement())); - if (src.hasOnset()) - tgt.setOnset(convertType(src.getOnset())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasOutcome()) - tgt.setOutcome(convertCodeableConcept(src.getOutcome())); - if (src.hasContributedToDeath()) - tgt.setContributedToDeathElement(convertBoolean(src.getContributedToDeathElement())); - if (src.hasOnset()) - tgt.setOnset(convertType(src.getOnset())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r4.model.FamilyMemberHistory src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.FamilyMemberHistory tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasSex()) + tgt.setSex(convertCodeableConcept(src.getSex())); + if (src.hasBorn()) + tgt.setBorn(convertType(src.getBorn())); + if (src.hasAge()) + tgt.setAge(convertType(src.getAge())); + if (src.hasEstimatedAge()) + tgt.setEstimatedAgeElement(convertBoolean(src.getEstimatedAgeElement())); + if (src.hasDeceased()) + tgt.setDeceased(convertType(src.getDeceased())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r5.model.FamilyMemberHistory src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.FamilyMemberHistory tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertCodeableConcept(src.getRelationship())); + if (src.hasSex()) + tgt.setSex(convertCodeableConcept(src.getSex())); + if (src.hasBorn()) + tgt.setBorn(convertType(src.getBorn())); + if (src.hasAge()) + tgt.setAge(convertType(src.getAge())); + if (src.hasEstimatedAge()) + tgt.setEstimatedAgeElement(convertBoolean(src.getEstimatedAgeElement())); + if (src.hasDeceased()) + tgt.setDeceased(convertType(src.getDeceased())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus convertFamilyHistoryStatus(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PARTIAL: + return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL; + case COMPLETED: + return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR; + case HEALTHUNKNOWN: + return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN; + default: + return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus convertFamilyHistoryStatus(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PARTIAL: + return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL; + case COMPLETED: + return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR; + case HEALTHUNKNOWN: + return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN; + default: + return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasOutcome()) + tgt.setOutcome(convertCodeableConcept(src.getOutcome())); + if (src.hasContributedToDeath()) + tgt.setContributedToDeathElement(convertBoolean(src.getContributedToDeathElement())); + if (src.hasOnset()) + tgt.setOnset(convertType(src.getOnset())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasOutcome()) + tgt.setOutcome(convertCodeableConcept(src.getOutcome())); + if (src.hasContributedToDeath()) + tgt.setContributedToDeathElement(convertBoolean(src.getContributedToDeathElement())); + if (src.hasOnset()) + tgt.setOnset(convertType(src.getOnset())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Flag.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Flag.java index 73c47fda6..b1c2974d3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Flag.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Flag.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,81 +50,88 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Flag extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Flag convertFlag(org.hl7.fhir.r4.model.Flag src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Flag tgt = new org.hl7.fhir.r5.model.Flag(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertFlagStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Flag convertFlag(org.hl7.fhir.r5.model.Flag src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Flag tgt = new org.hl7.fhir.r4.model.Flag(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertFlagStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Flag.FlagStatus convertFlagStatus(org.hl7.fhir.r4.model.Flag.FlagStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Flag.FlagStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Flag.FlagStatus convertFlagStatus(org.hl7.fhir.r5.model.Flag.FlagStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Flag.FlagStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.Flag convertFlag(org.hl7.fhir.r4.model.Flag src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Flag tgt = new org.hl7.fhir.r5.model.Flag(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFlagStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + return tgt; + } + public static org.hl7.fhir.r4.model.Flag convertFlag(org.hl7.fhir.r5.model.Flag src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Flag tgt = new org.hl7.fhir.r4.model.Flag(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFlagStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + return tgt; + } + public static org.hl7.fhir.r5.model.Flag.FlagStatus convertFlagStatus(org.hl7.fhir.r4.model.Flag.FlagStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Flag.FlagStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Flag.FlagStatus convertFlagStatus(org.hl7.fhir.r5.model.Flag.FlagStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Flag.FlagStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Goal.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Goal.java index 8d5d10473..26396b15c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Goal.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Goal.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,155 +51,180 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Goal extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Goal convertGoal(org.hl7.fhir.r4.model.Goal src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Goal tgt = new org.hl7.fhir.r5.model.Goal(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasLifecycleStatus()) - tgt.setLifecycleStatus(convertGoalLifecycleStatus(src.getLifecycleStatus())); - if (src.hasAchievementStatus()) - tgt.setAchievementStatus(convertCodeableConcept(src.getAchievementStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasDescription()) - tgt.setDescription(convertCodeableConcept(src.getDescription())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasStart()) - tgt.setStart(convertType(src.getStart())); - for (org.hl7.fhir.r4.model.Goal.GoalTargetComponent t : src.getTarget()) - tgt.addTarget(convertGoalTargetComponent(t)); - if (src.hasStatusDate()) - tgt.setStatusDateElement(convertDate(src.getStatusDateElement())); - if (src.hasStatusReason()) - tgt.setStatusReasonElement(convertString(src.getStatusReasonElement())); - if (src.hasExpressedBy()) - tgt.setExpressedBy(convertReference(src.getExpressedBy())); - for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) - tgt.addAddresses(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCode()) - tgt.addOutcome(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference()) - tgt.addOutcome(convertReferenceToCodeableReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Goal convertGoal(org.hl7.fhir.r5.model.Goal src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Goal tgt = new org.hl7.fhir.r4.model.Goal(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasLifecycleStatus()) - tgt.setLifecycleStatus(convertGoalLifecycleStatus(src.getLifecycleStatus())); - if (src.hasAchievementStatus()) - tgt.setAchievementStatus(convertCodeableConcept(src.getAchievementStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasDescription()) - tgt.setDescription(convertCodeableConcept(src.getDescription())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasStart()) - tgt.setStart(convertType(src.getStart())); - for (org.hl7.fhir.r5.model.Goal.GoalTargetComponent t : src.getTarget()) - tgt.addTarget(convertGoalTargetComponent(t)); - if (src.hasStatusDate()) - tgt.setStatusDateElement(convertDate(src.getStatusDateElement())); - if (src.hasStatusReason()) - tgt.setStatusReasonElement(convertString(src.getStatusReasonElement())); - if (src.hasExpressedBy()) - tgt.setExpressedBy(convertReference(src.getExpressedBy())); - for (org.hl7.fhir.r5.model.Reference t : src.getAddresses()) - tgt.addAddresses(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (CodeableReference t : src.getOutcome()) - if (t.hasConcept()) - tgt.addOutcomeCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getOutcome()) - if (t.hasReference()) - tgt.addOutcomeReference(convertReference(t.getReference())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus convertGoalLifecycleStatus(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PROPOSED; - case PLANNED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PLANNED; - case ACCEPTED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACCEPTED; - case ACTIVE: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ONHOLD; - case COMPLETED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.COMPLETED; - case CANCELLED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ENTEREDINERROR; - case REJECTED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.REJECTED; - default: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus convertGoalLifecycleStatus(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PROPOSED; - case PLANNED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PLANNED; - case ACCEPTED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACCEPTED; - case ACTIVE: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ONHOLD; - case COMPLETED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.COMPLETED; - case CANCELLED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ENTEREDINERROR; - case REJECTED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.REJECTED; - default: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r4.model.Goal.GoalTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r5.model.Goal.GoalTargetComponent(); - copyElement(src, tgt); - if (src.hasMeasure()) - tgt.setMeasure(convertCodeableConcept(src.getMeasure())); - if (src.hasDetail()) - tgt.setDetail(convertType(src.getDetail())); - if (src.hasDue()) - tgt.setDue(convertType(src.getDue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r5.model.Goal.GoalTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r4.model.Goal.GoalTargetComponent(); - copyElement(src, tgt); - if (src.hasMeasure()) - tgt.setMeasure(convertCodeableConcept(src.getMeasure())); - if (src.hasDetail()) - tgt.setDetail(convertType(src.getDetail())); - if (src.hasDue()) - tgt.setDue(convertType(src.getDue())); - return tgt; - } + public static org.hl7.fhir.r5.model.Goal convertGoal(org.hl7.fhir.r4.model.Goal src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Goal tgt = new org.hl7.fhir.r5.model.Goal(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasLifecycleStatus()) + tgt.setLifecycleStatus(convertGoalLifecycleStatus(src.getLifecycleStatus())); + if (src.hasAchievementStatus()) + tgt.setAchievementStatus(convertCodeableConcept(src.getAchievementStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasDescription()) + tgt.setDescription(convertCodeableConcept(src.getDescription())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasStart()) + tgt.setStart(convertType(src.getStart())); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.Goal.GoalTargetComponent t : src.getTarget()) tgt.addTarget(convertGoalTargetComponent(t)); + } + if (src.hasStatusDate()) + tgt.setStatusDateElement(convertDate(src.getStatusDateElement())); + if (src.hasStatusReason()) + tgt.setStatusReasonElement(convertString(src.getStatusReasonElement())); + if (src.hasExpressedBy()) + tgt.setExpressedBy(convertReference(src.getExpressedBy())); + if (src.hasAddresses()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAddresses()) tgt.addAddresses(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasOutcomeCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCode()) tgt.addOutcome(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasOutcomeReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference()) tgt.addOutcome(convertReferenceToCodeableReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Goal convertGoal(org.hl7.fhir.r5.model.Goal src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Goal tgt = new org.hl7.fhir.r4.model.Goal(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasLifecycleStatus()) + tgt.setLifecycleStatus(convertGoalLifecycleStatus(src.getLifecycleStatus())); + if (src.hasAchievementStatus()) + tgt.setAchievementStatus(convertCodeableConcept(src.getAchievementStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasDescription()) + tgt.setDescription(convertCodeableConcept(src.getDescription())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasStart()) + tgt.setStart(convertType(src.getStart())); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.Goal.GoalTargetComponent t : src.getTarget()) tgt.addTarget(convertGoalTargetComponent(t)); + } + if (src.hasStatusDate()) + tgt.setStatusDateElement(convertDate(src.getStatusDateElement())); + if (src.hasStatusReason()) + tgt.setStatusReasonElement(convertString(src.getStatusReasonElement())); + if (src.hasExpressedBy()) + tgt.setExpressedBy(convertReference(src.getExpressedBy())); + if (src.hasAddresses()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAddresses()) tgt.addAddresses(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + for (CodeableReference t : src.getOutcome()) if (t.hasConcept()) + tgt.addOutcomeCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getOutcome()) if (t.hasReference()) + tgt.addOutcomeReference(convertReference(t.getReference())); + return tgt; + } + public static org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus convertGoalLifecycleStatus(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSED: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PROPOSED; + case PLANNED: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PLANNED; + case ACCEPTED: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACCEPTED; + case ACTIVE: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ONHOLD; + case COMPLETED: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.COMPLETED; + case CANCELLED: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ENTEREDINERROR; + case REJECTED: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.REJECTED; + default: + return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus convertGoalLifecycleStatus(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSED: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PROPOSED; + case PLANNED: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PLANNED; + case ACCEPTED: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACCEPTED; + case ACTIVE: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ONHOLD; + case COMPLETED: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.COMPLETED; + case CANCELLED: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ENTEREDINERROR; + case REJECTED: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.REJECTED; + default: + return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r4.model.Goal.GoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r5.model.Goal.GoalTargetComponent(); + copyElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(convertType(src.getDue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r5.model.Goal.GoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r4.model.Goal.GoalTargetComponent(); + copyElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(convertType(src.getDue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GraphDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GraphDefinition.java index 43800e6f6..52b18c25a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GraphDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GraphDefinition.java @@ -19,15 +19,12 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Enumerations.ResourceTypeEnum; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -56,269 +53,306 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class GraphDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r4.model.GraphDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.GraphDefinition tgt = new org.hl7.fhir.r5.model.GraphDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasStart()) - tgt.setStartElement(convertResourceEnum(src.getStartElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) - tgt.addLink(convertGraphDefinitionLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r4.model.GraphDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition tgt = new org.hl7.fhir.r5.model.GraphDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasStart()) + tgt.setStartElement(convertResourceEnum(src.getStartElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r5.model.GraphDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.GraphDefinition tgt = new org.hl7.fhir.r4.model.GraphDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasStart()) - tgt.setStartElement(convertResourceEnum(src.getStartElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) - tgt.addLink(convertGraphDefinitionLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r5.model.GraphDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.GraphDefinition tgt = new org.hl7.fhir.r4.model.GraphDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasStart()) + tgt.setStartElement(convertResourceEnum(src.getStartElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent(); - copyElement(src, tgt); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasSliceName()) - tgt.setSliceNameElement(convertString(src.getSliceNameElement())); - if (src.hasMin()) - tgt.setMinElement(convertInteger(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) - tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent(); + copyElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasSliceName()) + tgt.setSliceNameElement(convertString(src.getSliceNameElement())); + if (src.hasMin()) + tgt.setMinElement(convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent(); - copyElement(src, tgt); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasSliceName()) - tgt.setSliceNameElement(convertString(src.getSliceNameElement())); - if (src.hasMin()) - tgt.setMinElement(convertInteger(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) - tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent(); + copyElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasSliceName()) + tgt.setSliceNameElement(convertString(src.getSliceNameElement())); + if (src.hasMin()) + tgt.setMinElement(convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); - if (src.hasParams()) - tgt.setParamsElement(convertString(src.getParamsElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) - tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); - for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) - tgt.addLink(convertGraphDefinitionLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); + if (src.hasParams()) + tgt.setParamsElement(convertString(src.getParamsElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasCompartment()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + } + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); - if (src.hasParams()) - tgt.setParamsElement(convertString(src.getParamsElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) - tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); - for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) - tgt.addLink(convertGraphDefinitionLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); + if (src.hasParams()) + tgt.setParamsElement(convertString(src.getParamsElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasCompartment()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + } + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) tgt.addLink(convertGraphDefinitionLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); - copyElement(src, tgt); - if (src.hasUse()) - tgt.setUse(convertGraphCompartmentUse(src.getUse())); - if (src.hasCode()) - tgt.setCode(convertCompartmentCode(src.getCode())); - if (src.hasRule()) - tgt.setRule(convertGraphCompartmentRule(src.getRule())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); - copyElement(src, tgt); - if (src.hasUse()) - tgt.setUse(convertGraphCompartmentUse(src.getUse())); - if (src.hasCode()) - tgt.setCode(convertCompartmentCode(src.getCode())); - if (src.hasRule()) - tgt.setRule(convertGraphCompartmentRule(src.getRule())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse convertGraphCompartmentUse(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CONDITION: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.CONDITION; - case REQUIREMENT: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT; - default: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.NULL; - } -} - - public static org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse convertGraphCompartmentUse(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CONDITION: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.CONDITION; - case REQUIREMENT: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT; - default: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.CompartmentType convertCompartmentCode(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT; - case ENCOUNTER: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER; - case RELATEDPERSON: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON; - case PRACTITIONER: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER; - case DEVICE: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE; - default: return org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL; - } -} - - public static org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode convertCompartmentCode(org.hl7.fhir.r5.model.Enumerations.CompartmentType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PATIENT; - case ENCOUNTER: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.ENCOUNTER; - case RELATEDPERSON: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.RELATEDPERSON; - case PRACTITIONER: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PRACTITIONER; - case DEVICE: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.DEVICE; - default: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.NULL; - } -} - - public static org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule convertGraphCompartmentRule(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case IDENTICAL: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.IDENTICAL; - case MATCHING: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.MATCHING; - case DIFFERENT: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.DIFFERENT; - case CUSTOM: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.CUSTOM; - default: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.NULL; - } -} - - public static org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule convertGraphCompartmentRule(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case IDENTICAL: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.IDENTICAL; - case MATCHING: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.MATCHING; - case DIFFERENT: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.DIFFERENT; - case CUSTOM: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.CUSTOM; - default: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.NULL; - } -} + public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); + copyElement(src, tgt); + if (src.hasUse()) + tgt.setUse(convertGraphCompartmentUse(src.getUse())); + if (src.hasCode()) + tgt.setCode(convertCompartmentCode(src.getCode())); + if (src.hasRule()) + tgt.setRule(convertGraphCompartmentRule(src.getRule())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); + copyElement(src, tgt); + if (src.hasUse()) + tgt.setUse(convertGraphCompartmentUse(src.getUse())); + if (src.hasCode()) + tgt.setCode(convertCompartmentCode(src.getCode())); + if (src.hasRule()) + tgt.setRule(convertGraphCompartmentRule(src.getRule())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse convertGraphCompartmentUse(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CONDITION: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.CONDITION; + case REQUIREMENT: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT; + default: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.NULL; + } + } + + public static org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse convertGraphCompartmentUse(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CONDITION: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.CONDITION; + case REQUIREMENT: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT; + default: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.CompartmentType convertCompartmentCode(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT; + case ENCOUNTER: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER; + case RELATEDPERSON: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON; + case PRACTITIONER: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER; + case DEVICE: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE; + default: + return org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL; + } + } + + public static org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode convertCompartmentCode(org.hl7.fhir.r5.model.Enumerations.CompartmentType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PATIENT; + case ENCOUNTER: + return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.ENCOUNTER; + case RELATEDPERSON: + return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.RELATEDPERSON; + case PRACTITIONER: + return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PRACTITIONER; + case DEVICE: + return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.DEVICE; + default: + return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.NULL; + } + } + + public static org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule convertGraphCompartmentRule(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case IDENTICAL: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.IDENTICAL; + case MATCHING: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.MATCHING; + case DIFFERENT: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.DIFFERENT; + case CUSTOM: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.CUSTOM; + default: + return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.NULL; + } + } + + public static org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule convertGraphCompartmentRule(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case IDENTICAL: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.IDENTICAL; + case MATCHING: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.MATCHING; + case DIFFERENT: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.DIFFERENT; + case CUSTOM: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.CUSTOM; + default: + return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Group.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Group.java index 923a922e2..67fb7af8b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Group.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Group.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,155 +50,170 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Group extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Group convertGroup(org.hl7.fhir.r4.model.Group src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Group tgt = new org.hl7.fhir.r5.model.Group(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasType()) - tgt.setType(convertGroupType(src.getType())); - if (src.hasActual()) - tgt.setActualElement(convertBoolean(src.getActualElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasQuantity()) - tgt.setQuantityElement(convertUnsignedInt(src.getQuantityElement())); - if (src.hasManagingEntity()) - tgt.setManagingEntity(convertReference(src.getManagingEntity())); - for (org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) - tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.r4.model.Group.GroupMemberComponent t : src.getMember()) - tgt.addMember(convertGroupMemberComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Group convertGroup(org.hl7.fhir.r5.model.Group src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Group tgt = new org.hl7.fhir.r4.model.Group(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasType()) - tgt.setType(convertGroupType(src.getType())); - if (src.hasActual()) - tgt.setActualElement(convertBoolean(src.getActualElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasQuantity()) - tgt.setQuantityElement(convertUnsignedInt(src.getQuantityElement())); - if (src.hasManagingEntity()) - tgt.setManagingEntity(convertReference(src.getManagingEntity())); - for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) - tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); - for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember()) - tgt.addMember(convertGroupMemberComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Group.GroupType convertGroupType(org.hl7.fhir.r4.model.Group.GroupType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PERSON: return org.hl7.fhir.r5.model.Group.GroupType.PERSON; - case ANIMAL: return org.hl7.fhir.r5.model.Group.GroupType.ANIMAL; - case PRACTITIONER: return org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER; - case DEVICE: return org.hl7.fhir.r5.model.Group.GroupType.DEVICE; - case MEDICATION: return org.hl7.fhir.r5.model.Group.GroupType.MEDICATION; - case SUBSTANCE: return org.hl7.fhir.r5.model.Group.GroupType.SUBSTANCE; - default: return org.hl7.fhir.r5.model.Group.GroupType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Group.GroupType convertGroupType(org.hl7.fhir.r5.model.Group.GroupType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PERSON: return org.hl7.fhir.r4.model.Group.GroupType.PERSON; - case ANIMAL: return org.hl7.fhir.r4.model.Group.GroupType.ANIMAL; - case PRACTITIONER: return org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER; - case DEVICE: return org.hl7.fhir.r4.model.Group.GroupType.DEVICE; - case MEDICATION: return org.hl7.fhir.r4.model.Group.GroupType.MEDICATION; - case SUBSTANCE: return org.hl7.fhir.r4.model.Group.GroupType.SUBSTANCE; - default: return org.hl7.fhir.r4.model.Group.GroupType.NULL; - } -} - - public static org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasExclude()) - tgt.setExcludeElement(convertBoolean(src.getExcludeElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasExclude()) - tgt.setExcludeElement(convertBoolean(src.getExcludeElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r4.model.Group.GroupMemberComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r5.model.Group.GroupMemberComponent(); - copyElement(src, tgt); - if (src.hasEntity()) - tgt.setEntity(convertReference(src.getEntity())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasInactive()) - tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r5.model.Group.GroupMemberComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r4.model.Group.GroupMemberComponent(); - copyElement(src, tgt); - if (src.hasEntity()) - tgt.setEntity(convertReference(src.getEntity())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasInactive()) - tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.Group convertGroup(org.hl7.fhir.r4.model.Group src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Group tgt = new org.hl7.fhir.r5.model.Group(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasType()) + tgt.setType(convertGroupType(src.getType())); + if (src.hasActual()) + tgt.setActualElement(convertBoolean(src.getActualElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasQuantity()) + tgt.setQuantityElement(convertUnsignedInt(src.getQuantityElement())); + if (src.hasManagingEntity()) + tgt.setManagingEntity(convertReference(src.getManagingEntity())); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.r4.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Group convertGroup(org.hl7.fhir.r5.model.Group src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Group tgt = new org.hl7.fhir.r4.model.Group(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasType()) + tgt.setType(convertGroupType(src.getType())); + if (src.hasActual()) + tgt.setActualElement(convertBoolean(src.getActualElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasQuantity()) + tgt.setQuantityElement(convertUnsignedInt(src.getQuantityElement())); + if (src.hasManagingEntity()) + tgt.setManagingEntity(convertReference(src.getManagingEntity())); + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + } + if (src.hasMember()) { + for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember()) tgt.addMember(convertGroupMemberComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Group.GroupType convertGroupType(org.hl7.fhir.r4.model.Group.GroupType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PERSON: + return org.hl7.fhir.r5.model.Group.GroupType.PERSON; + case ANIMAL: + return org.hl7.fhir.r5.model.Group.GroupType.ANIMAL; + case PRACTITIONER: + return org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER; + case DEVICE: + return org.hl7.fhir.r5.model.Group.GroupType.DEVICE; + case MEDICATION: + return org.hl7.fhir.r5.model.Group.GroupType.MEDICATION; + case SUBSTANCE: + return org.hl7.fhir.r5.model.Group.GroupType.SUBSTANCE; + default: + return org.hl7.fhir.r5.model.Group.GroupType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Group.GroupType convertGroupType(org.hl7.fhir.r5.model.Group.GroupType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PERSON: + return org.hl7.fhir.r4.model.Group.GroupType.PERSON; + case ANIMAL: + return org.hl7.fhir.r4.model.Group.GroupType.ANIMAL; + case PRACTITIONER: + return org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER; + case DEVICE: + return org.hl7.fhir.r4.model.Group.GroupType.DEVICE; + case MEDICATION: + return org.hl7.fhir.r4.model.Group.GroupType.MEDICATION; + case SUBSTANCE: + return org.hl7.fhir.r4.model.Group.GroupType.SUBSTANCE; + default: + return org.hl7.fhir.r4.model.Group.GroupType.NULL; + } + } + + public static org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasExclude()) + tgt.setExcludeElement(convertBoolean(src.getExcludeElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasExclude()) + tgt.setExcludeElement(convertBoolean(src.getExcludeElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r4.model.Group.GroupMemberComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r5.model.Group.GroupMemberComponent(); + copyElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(convertReference(src.getEntity())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasInactive()) + tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r5.model.Group.GroupMemberComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r4.model.Group.GroupMemberComponent(); + copyElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(convertReference(src.getEntity())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasInactive()) + tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GuidanceResponse.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GuidanceResponse.java index fafc4a37b..5ef91669e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GuidanceResponse.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/GuidanceResponse.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,117 +51,134 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class GuidanceResponse extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r4.model.GuidanceResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.GuidanceResponse tgt = new org.hl7.fhir.r5.model.GuidanceResponse(); - copyDomainResource(src, tgt); - if (src.hasRequestIdentifier()) - tgt.setRequestIdentifier(convertIdentifier(src.getRequestIdentifier())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasModule()) - tgt.setModule(convertType(src.getModule())); - if (src.hasStatus()) - tgt.setStatus(convertGuidanceResponseStatus(src.getStatus())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrenceDateTime()) - tgt.setOccurrenceDateTimeElement(convertDateTime(src.getOccurrenceDateTimeElement())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEvaluationMessage()) - tgt.addEvaluationMessage(convertReference(t)); - if (src.hasOutputParameters()) - tgt.setOutputParameters(convertReference(src.getOutputParameters())); - if (src.hasResult()) - tgt.setResult(convertReference(src.getResult())); - for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement()) - tgt.addDataRequirement(convertDataRequirement(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r5.model.GuidanceResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.GuidanceResponse tgt = new org.hl7.fhir.r4.model.GuidanceResponse(); - copyDomainResource(src, tgt); - if (src.hasRequestIdentifier()) - tgt.setRequestIdentifier(convertIdentifier(src.getRequestIdentifier())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasModule()) - tgt.setModule(convertType(src.getModule())); - if (src.hasStatus()) - tgt.setStatus(convertGuidanceResponseStatus(src.getStatus())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrenceDateTime()) - tgt.setOccurrenceDateTimeElement(convertDateTime(src.getOccurrenceDateTimeElement())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEvaluationMessage()) - tgt.addEvaluationMessage(convertReference(t)); - if (src.hasOutputParameters()) - tgt.setOutputParameters(convertReference(src.getOutputParameters())); - if (src.hasResult()) - tgt.setResult(convertReference(src.getResult())); - for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) - tgt.addDataRequirement(convertDataRequirement(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus convertGuidanceResponseStatus(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SUCCESS: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS; - case DATAREQUESTED: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED; - case DATAREQUIRED: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED; - case INPROGRESS: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS; - case FAILURE: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.FAILURE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus convertGuidanceResponseStatus(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SUCCESS: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS; - case DATAREQUESTED: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED; - case DATAREQUIRED: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED; - case INPROGRESS: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS; - case FAILURE: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.FAILURE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r4.model.GuidanceResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GuidanceResponse tgt = new org.hl7.fhir.r5.model.GuidanceResponse(); + copyDomainResource(src, tgt); + if (src.hasRequestIdentifier()) + tgt.setRequestIdentifier(convertIdentifier(src.getRequestIdentifier())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasModule()) + tgt.setModule(convertType(src.getModule())); + if (src.hasStatus()) + tgt.setStatus(convertGuidanceResponseStatus(src.getStatus())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrenceDateTime()) + tgt.setOccurrenceDateTimeElement(convertDateTime(src.getOccurrenceDateTimeElement())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasEvaluationMessage()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEvaluationMessage()) tgt.addEvaluationMessage(convertReference(t)); + } + if (src.hasOutputParameters()) + tgt.setOutputParameters(convertReference(src.getOutputParameters())); + if (src.hasResult()) + tgt.setResult(convertReference(src.getResult())); + if (src.hasDataRequirement()) { + for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(convertDataRequirement(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r5.model.GuidanceResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.GuidanceResponse tgt = new org.hl7.fhir.r4.model.GuidanceResponse(); + copyDomainResource(src, tgt); + if (src.hasRequestIdentifier()) + tgt.setRequestIdentifier(convertIdentifier(src.getRequestIdentifier())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasModule()) + tgt.setModule(convertType(src.getModule())); + if (src.hasStatus()) + tgt.setStatus(convertGuidanceResponseStatus(src.getStatus())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrenceDateTime()) + tgt.setOccurrenceDateTimeElement(convertDateTime(src.getOccurrenceDateTimeElement())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasEvaluationMessage()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEvaluationMessage()) tgt.addEvaluationMessage(convertReference(t)); + } + if (src.hasOutputParameters()) + tgt.setOutputParameters(convertReference(src.getOutputParameters())); + if (src.hasResult()) + tgt.setResult(convertReference(src.getResult())); + if (src.hasDataRequirement()) { + for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(convertDataRequirement(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus convertGuidanceResponseStatus(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SUCCESS: + return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS; + case DATAREQUESTED: + return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED; + case DATAREQUIRED: + return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED; + case INPROGRESS: + return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS; + case FAILURE: + return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.FAILURE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus convertGuidanceResponseStatus(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SUCCESS: + return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS; + case DATAREQUESTED: + return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED; + case DATAREQUIRED: + return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED; + case INPROGRESS: + return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS; + case FAILURE: + return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.FAILURE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java index ad7433037..d83f74e9d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,233 +50,278 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class HealthcareService extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.HealthcareService convertHealthcareService(org.hl7.fhir.r4.model.HealthcareService src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.HealthcareService tgt = new org.hl7.fhir.r5.model.HealthcareService(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasProvidedBy()) - tgt.setProvidedBy(convertReference(src.getProvidedBy())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) - tgt.addLocation(convertReference(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasExtraDetails()) - tgt.setExtraDetailsElement(convertMarkdown(src.getExtraDetailsElement())); - if (src.hasPhoto()) - tgt.setPhoto(convertAttachment(src.getPhoto())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) - tgt.addCoverageArea(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceProvisionCode()) - tgt.addServiceProvisionCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility()) - tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgram()) - tgt.addProgram(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic()) - tgt.addCharacteristic(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) - tgt.addCommunication(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReferralMethod()) - tgt.addReferralMethod(convertCodeableConcept(t)); - if (src.hasAppointmentRequired()) - tgt.setAppointmentRequiredElement(convertBoolean(src.getAppointmentRequiredElement())); - for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) - tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) - tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - if (src.hasAvailabilityExceptions()) - tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.HealthcareService convertHealthcareService(org.hl7.fhir.r4.model.HealthcareService src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService tgt = new org.hl7.fhir.r5.model.HealthcareService(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasProvidedBy()) + tgt.setProvidedBy(convertReference(src.getProvidedBy())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.addLocation(convertReference(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasExtraDetails()) + tgt.setExtraDetailsElement(convertMarkdown(src.getExtraDetailsElement())); + if (src.hasPhoto()) + tgt.setPhoto(convertAttachment(src.getPhoto())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(convertCodeableConcept(t)); + } + if (src.hasEligibility()) { + for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility()) tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t)); + } + if (src.hasProgram()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgram()) tgt.addProgram(convertCodeableConcept(t)); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(convertCodeableConcept(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) + tgt.setAppointmentRequiredElement(convertBoolean(src.getAppointmentRequiredElement())); + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.HealthcareService convertHealthcareService(org.hl7.fhir.r5.model.HealthcareService src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.HealthcareService tgt = new org.hl7.fhir.r4.model.HealthcareService(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasProvidedBy()) - tgt.setProvidedBy(convertReference(src.getProvidedBy())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) - tgt.addLocation(convertReference(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasExtraDetails()) - tgt.setExtraDetailsElement(convertMarkdown(src.getExtraDetailsElement())); - if (src.hasPhoto()) - tgt.setPhoto(convertAttachment(src.getPhoto())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) - tgt.addCoverageArea(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode()) - tgt.addServiceProvisionCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility()) - tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgram()) - tgt.addProgram(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic()) - tgt.addCharacteristic(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) - tgt.addCommunication(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod()) - tgt.addReferralMethod(convertCodeableConcept(t)); - if (src.hasAppointmentRequired()) - tgt.setAppointmentRequiredElement(convertBoolean(src.getAppointmentRequiredElement())); - for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) - tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); - for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) - tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); - if (src.hasAvailabilityExceptions()) - tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.HealthcareService convertHealthcareService(org.hl7.fhir.r5.model.HealthcareService src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.HealthcareService tgt = new org.hl7.fhir.r4.model.HealthcareService(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasProvidedBy()) + tgt.setProvidedBy(convertReference(src.getProvidedBy())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(convertReference(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasExtraDetails()) + tgt.setExtraDetailsElement(convertMarkdown(src.getExtraDetailsElement())); + if (src.hasPhoto()) + tgt.setPhoto(convertAttachment(src.getPhoto())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(convertReference(t)); + } + if (src.hasServiceProvisionCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode()) tgt.addServiceProvisionCode(convertCodeableConcept(t)); + } + if (src.hasEligibility()) { + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility()) tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t)); + } + if (src.hasProgram()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgram()) tgt.addProgram(convertCodeableConcept(t)); + } + if (src.hasCharacteristic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic()) tgt.addCharacteristic(convertCodeableConcept(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(convertCodeableConcept(t)); + } + if (src.hasReferralMethod()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod()) tgt.addReferralMethod(convertCodeableConcept(t)); + } + if (src.hasAppointmentRequired()) + tgt.setAppointmentRequiredElement(convertBoolean(src.getAppointmentRequiredElement())); + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasComment()) - tgt.setCommentElement(convertMarkdown(src.getCommentElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasComment()) + tgt.setCommentElement(convertMarkdown(src.getCommentElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasComment()) - tgt.setCommentElement(convertMarkdown(src.getCommentElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasComment()) + tgt.setCommentElement(convertMarkdown(src.getCommentElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - if (src.hasAllDay()) - tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); - if (src.hasAvailableStartTime()) - tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); - if (src.hasAvailableEndTime()) - tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - if (src.hasAllDay()) - tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); - if (src.hasAvailableStartTime()) - tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); - if (src.hasAvailableEndTime()) - tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MON: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON; - case TUE: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE; - case WED: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED; - case THU: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU; - case FRI: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI; - case SAT: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT; - case SUN: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN; - default: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL; - } -} - - public static org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MON: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.MON; - case TUE: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.TUE; - case WED: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.WED; - case THU: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.THU; - case FRI: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.FRI; - case SAT: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SAT; - case SUN: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SUN; - default: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.NULL; - } -} - - public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasDuring()) - tgt.setDuring(convertPeriod(src.getDuring())); - return tgt; - } - - public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasDuring()) - tgt.setDuring(convertPeriod(src.getDuring())); - return tgt; - } + public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); + copyElement(src, tgt); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) + tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); + copyElement(src, tgt); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) + tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MON: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON; + case TUE: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE; + case WED: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED; + case THU: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU; + case FRI: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI; + case SAT: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT; + case SUN: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN; + default: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL; + } + } + + public static org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MON: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.MON; + case TUE: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.TUE; + case WED: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.WED; + case THU: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.THU; + case FRI: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.FRI; + case SAT: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SAT; + case SUN: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SUN; + default: + return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.NULL; + } + } + + public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(convertPeriod(src.getDuring())); + return tgt; + } + + public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(convertPeriod(src.getDuring())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImagingStudy.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImagingStudy.java index 7bb2fcaf5..c71a3d86b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImagingStudy.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImagingStudy.java @@ -19,14 +19,11 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyProcedureComponent; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -55,258 +52,288 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ImagingStudy extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r4.model.ImagingStudy src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImagingStudy tgt = new org.hl7.fhir.r5.model.ImagingStudy(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertImagingStudyStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.Coding t : src.getModality()) - tgt.addModality(convertCoding(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasStarted()) - tgt.setStartedElement(convertDateTime(src.getStartedElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasReferrer()) - tgt.setReferrer(convertReference(src.getReferrer())); - for (org.hl7.fhir.r4.model.Reference t : src.getInterpreter()) - tgt.addInterpreter(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - if (src.hasNumberOfSeries()) - tgt.setNumberOfSeriesElement(convertUnsignedInt(src.getNumberOfSeriesElement())); - if (src.hasNumberOfInstances()) - tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); - if (src.hasProcedureReference()) - tgt.addProcedure().setValue(convertReference(src.getProcedureReference())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProcedureCode()) - tgt.addProcedure().setValue(convertCodeableConcept(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) - tgt.addSeries(convertImagingStudySeriesComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r5.model.ImagingStudy src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImagingStudy tgt = new org.hl7.fhir.r4.model.ImagingStudy(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertImagingStudyStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.Coding t : src.getModality()) - tgt.addModality(convertCoding(t)); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasStarted()) - tgt.setStartedElement(convertDateTime(src.getStartedElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasReferrer()) - tgt.setReferrer(convertReference(src.getReferrer())); - for (org.hl7.fhir.r5.model.Reference t : src.getInterpreter()) - tgt.addInterpreter(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - if (src.hasNumberOfSeries()) - tgt.setNumberOfSeriesElement(convertUnsignedInt(src.getNumberOfSeriesElement())); - if (src.hasNumberOfInstances()) - tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); - for (ImagingStudyProcedureComponent t : src.getProcedure()) { - if (t.hasValueCodeableConcept()) - tgt.addProcedureCode(convertCodeableConcept(t.getValueCodeableConcept())); - if (t.hasValueReference()) { - tgt.setProcedureReference(convertReference(t.getValueReference())); - } + public static org.hl7.fhir.r5.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r4.model.ImagingStudy src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy tgt = new org.hl7.fhir.r5.model.ImagingStudy(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertImagingStudyStatus(src.getStatus())); + if (src.hasModality()) { + for (org.hl7.fhir.r4.model.Coding t : src.getModality()) tgt.addModality(convertCoding(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasStarted()) + tgt.setStartedElement(convertDateTime(src.getStartedElement())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReferrer()) + tgt.setReferrer(convertReference(src.getReferrer())); + if (src.hasInterpreter()) { + for (org.hl7.fhir.r4.model.Reference t : src.getInterpreter()) tgt.addInterpreter(convertReference(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + if (src.hasNumberOfSeries()) + tgt.setNumberOfSeriesElement(convertUnsignedInt(src.getNumberOfSeriesElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); + if (src.hasProcedureReference()) + tgt.addProcedure().setValue(convertReference(src.getProcedureReference())); + if (src.hasProcedureCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProcedureCode()) tgt.addProcedure().setValue(convertCodeableConcept(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSeries()) { + for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); + } + return tgt; } - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) - tgt.addSeries(convertImagingStudySeriesComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus convertImagingStudyStatus(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.REGISTERED; - case AVAILABLE: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.AVAILABLE; - case CANCELLED: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus convertImagingStudyStatus(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.REGISTERED; - case AVAILABLE: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.AVAILABLE; - case CANCELLED: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent(); - copyElement(src, tgt); - if (src.hasUid()) - tgt.setUidElement(convertId(src.getUidElement())); - if (src.hasNumber()) - tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); - if (src.hasModality()) - tgt.setModality(convertCoding(src.getModality())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasNumberOfInstances()) - tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCoding(src.getBodySite())); - if (src.hasLaterality()) - tgt.setLaterality(convertCoding(src.getLaterality())); - for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) - tgt.addSpecimen(convertReference(t)); - if (src.hasStarted()) - tgt.setStartedElement(convertDateTime(src.getStartedElement())); - for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t)); - for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) - tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent(); - copyElement(src, tgt); - if (src.hasUid()) - tgt.setUidElement(convertId(src.getUidElement())); - if (src.hasNumber()) - tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); - if (src.hasModality()) - tgt.setModality(convertCoding(src.getModality())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasNumberOfInstances()) - tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCoding(src.getBodySite())); - if (src.hasLaterality()) - tgt.setLaterality(convertCoding(src.getLaterality())); - for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) - tgt.addSpecimen(convertReference(t)); - if (src.hasStarted()) - tgt.setStartedElement(convertDateTime(src.getStartedElement())); - for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t)); - for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) - tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); - copyElement(src, tgt); - if (src.hasUid()) - tgt.setUidElement(convertId(src.getUidElement())); - if (src.hasSopClass()) - tgt.setSopClass(convertCoding(src.getSopClass())); - if (src.hasNumber()) - tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); - copyElement(src, tgt); - if (src.hasUid()) - tgt.setUidElement(convertId(src.getUidElement())); - if (src.hasSopClass()) - tgt.setSopClass(convertCoding(src.getSopClass())); - if (src.hasNumber()) - tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - return tgt; - } - + public static org.hl7.fhir.r4.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r5.model.ImagingStudy src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImagingStudy tgt = new org.hl7.fhir.r4.model.ImagingStudy(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertImagingStudyStatus(src.getStatus())); + if (src.hasModality()) { + for (org.hl7.fhir.r5.model.Coding t : src.getModality()) tgt.addModality(convertCoding(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasStarted()) + tgt.setStartedElement(convertDateTime(src.getStartedElement())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReferrer()) + tgt.setReferrer(convertReference(src.getReferrer())); + if (src.hasInterpreter()) { + for (org.hl7.fhir.r5.model.Reference t : src.getInterpreter()) tgt.addInterpreter(convertReference(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + if (src.hasNumberOfSeries()) + tgt.setNumberOfSeriesElement(convertUnsignedInt(src.getNumberOfSeriesElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); + for (ImagingStudyProcedureComponent t : src.getProcedure()) { + if (t.hasValueCodeableConcept()) + tgt.addProcedureCode(convertCodeableConcept(t.getValueCodeableConcept())); + if (t.hasValueReference()) { + tgt.setProcedureReference(convertReference(t.getValueReference())); + } + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSeries()) { + for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus convertImagingStudyStatus(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.REGISTERED; + case AVAILABLE: + return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.AVAILABLE; + case CANCELLED: + return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus convertImagingStudyStatus(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.REGISTERED; + case AVAILABLE: + return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.AVAILABLE; + case CANCELLED: + return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent(); + copyElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(convertId(src.getUidElement())); + if (src.hasNumber()) + tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); + if (src.hasModality()) + tgt.setModality(convertCoding(src.getModality())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCoding(src.getBodySite())); + if (src.hasLaterality()) + tgt.setLaterality(convertCoding(src.getLaterality())); + if (src.hasSpecimen()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(convertReference(t)); + } + if (src.hasStarted()) + tgt.setStartedElement(convertDateTime(src.getStartedElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t)); + } + if (src.hasInstance()) { + for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent(); + copyElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(convertId(src.getUidElement())); + if (src.hasNumber()) + tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); + if (src.hasModality()) + tgt.setModality(convertCoding(src.getModality())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCoding(src.getBodySite())); + if (src.hasLaterality()) + tgt.setLaterality(convertCoding(src.getLaterality())); + if (src.hasSpecimen()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(convertReference(t)); + } + if (src.hasStarted()) + tgt.setStartedElement(convertDateTime(src.getStartedElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t)); + } + if (src.hasInstance()) { + for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); + copyElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(convertId(src.getUidElement())); + if (src.hasSopClass()) + tgt.setSopClass(convertCoding(src.getSopClass())); + if (src.hasNumber()) + tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); + copyElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(convertId(src.getUidElement())); + if (src.hasSopClass()) + tgt.setSopClass(convertCoding(src.getSopClass())); + if (src.hasNumber()) + tgt.setNumberElement(convertUnsignedInt(src.getNumberElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Immunization.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Immunization.java index a2e4f2a0e..f207f4193 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Immunization.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Immunization.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,283 +51,304 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Immunization extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Immunization convertImmunization(org.hl7.fhir.r4.model.Immunization src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Immunization tgt = new org.hl7.fhir.r5.model.Immunization(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertImmunizationStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasVaccineCode()) - tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasRecorded()) - tgt.setRecordedElement(convertDateTime(src.getRecordedElement())); - if (src.hasPrimarySource()) - tgt.setPrimarySourceElement(convertBoolean(src.getPrimarySourceElement())); - if (src.hasReportOrigin()) - tgt.setInformationSource(convertCodeableConcept(src.getReportOrigin())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasManufacturer()) - tgt.setManufacturer(convertReference(src.getManufacturer())); - if (src.hasLotNumber()) - tgt.setLotNumberElement(convertString(src.getLotNumberElement())); - if (src.hasExpirationDate()) - tgt.setExpirationDateElement(convertDate(src.getExpirationDateElement())); - if (src.hasSite()) - tgt.setSite(convertCodeableConcept(src.getSite())); - if (src.hasRoute()) - tgt.setRoute(convertCodeableConcept(src.getRoute())); - if (src.hasDoseQuantity()) - tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertImmunizationPerformerComponent(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - if (src.hasIsSubpotent()) - tgt.setIsSubpotentElement(convertBoolean(src.getIsSubpotentElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubpotentReason()) - tgt.addSubpotentReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent t : src.getEducation()) - tgt.addEducation(convertImmunizationEducationComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramEligibility()) - tgt.addProgramEligibility(convertCodeableConcept(t)); - if (src.hasFundingSource()) - tgt.setFundingSource(convertCodeableConcept(src.getFundingSource())); - for (org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) - tgt.addReaction(convertImmunizationReactionComponent(t)); - for (org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied()) - tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Immunization convertImmunization(org.hl7.fhir.r5.model.Immunization src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Immunization tgt = new org.hl7.fhir.r4.model.Immunization(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertImmunizationStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasVaccineCode()) - tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasRecorded()) - tgt.setRecordedElement(convertDateTime(src.getRecordedElement())); - if (src.hasPrimarySource()) - tgt.setPrimarySourceElement(convertBoolean(src.getPrimarySourceElement())); - if (src.hasInformationSourceCodeableConcept()) - tgt.setReportOrigin(convertCodeableConcept(src.getInformationSourceCodeableConcept())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasManufacturer()) - tgt.setManufacturer(convertReference(src.getManufacturer())); - if (src.hasLotNumber()) - tgt.setLotNumberElement(convertString(src.getLotNumberElement())); - if (src.hasExpirationDate()) - tgt.setExpirationDateElement(convertDate(src.getExpirationDateElement())); - if (src.hasSite()) - tgt.setSite(convertCodeableConcept(src.getSite())); - if (src.hasRoute()) - tgt.setRoute(convertCodeableConcept(src.getRoute())); - if (src.hasDoseQuantity()) - tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity())); - for (org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertImmunizationPerformerComponent(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - if (src.hasIsSubpotent()) - tgt.setIsSubpotentElement(convertBoolean(src.getIsSubpotentElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubpotentReason()) - tgt.addSubpotentReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent t : src.getEducation()) - tgt.addEducation(convertImmunizationEducationComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramEligibility()) - tgt.addProgramEligibility(convertCodeableConcept(t)); - if (src.hasFundingSource()) - tgt.setFundingSource(convertCodeableConcept(src.getFundingSource())); - for (org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) - tgt.addReaction(convertImmunizationReactionComponent(t)); - for (org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied()) - tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes convertImmunizationStatus(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETED: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR; - case NOTDONE: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NOTDONE; - default: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Immunization.ImmunizationStatus convertImmunizationStatus(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETED: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.ENTEREDINERROR; - case NOTDONE: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NOTDONE; - default: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent(); - copyElement(src, tgt); - if (src.hasDocumentType()) - tgt.setDocumentTypeElement(convertString(src.getDocumentTypeElement())); - if (src.hasReference()) - tgt.setReferenceElement(convertUri(src.getReferenceElement())); - if (src.hasPublicationDate()) - tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); - if (src.hasPresentationDate()) - tgt.setPresentationDateElement(convertDateTime(src.getPresentationDateElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent(); - copyElement(src, tgt); - if (src.hasDocumentType()) - tgt.setDocumentTypeElement(convertString(src.getDocumentTypeElement())); - if (src.hasReference()) - tgt.setReferenceElement(convertUri(src.getReferenceElement())); - if (src.hasPublicationDate()) - tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); - if (src.hasPresentationDate()) - tgt.setPresentationDateElement(convertDateTime(src.getPresentationDateElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent(); - copyElement(src, tgt); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasDetail()) - tgt.setDetail(convertReference(src.getDetail())); - if (src.hasReported()) - tgt.setReportedElement(convertBoolean(src.getReportedElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent(); - copyElement(src, tgt); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasDetail()) - tgt.setDetail(convertReference(src.getDetail())); - if (src.hasReported()) - tgt.setReportedElement(convertBoolean(src.getReportedElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent(); - copyElement(src, tgt); - if (src.hasSeries()) - tgt.setSeriesElement(convertString(src.getSeriesElement())); - if (src.hasAuthority()) - tgt.setAuthority(convertReference(src.getAuthority())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTargetDisease()) - tgt.addTargetDisease(convertCodeableConcept(t)); - if (src.hasDoseNumber()) - tgt.setDoseNumber(convertType(src.getDoseNumber())); - if (src.hasSeriesDoses()) - tgt.setSeriesDoses(convertType(src.getSeriesDoses())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent(); - copyElement(src, tgt); - if (src.hasSeries()) - tgt.setSeriesElement(convertString(src.getSeriesElement())); - if (src.hasAuthority()) - tgt.setAuthority(convertReference(src.getAuthority())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTargetDisease()) - tgt.addTargetDisease(convertCodeableConcept(t)); - if (src.hasDoseNumber()) - tgt.setDoseNumber(convertType(src.getDoseNumber())); - if (src.hasSeriesDoses()) - tgt.setSeriesDoses(convertType(src.getSeriesDoses())); - return tgt; - } + public static org.hl7.fhir.r5.model.Immunization convertImmunization(org.hl7.fhir.r4.model.Immunization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization tgt = new org.hl7.fhir.r5.model.Immunization(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertImmunizationStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasVaccineCode()) + tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasRecorded()) + tgt.setRecordedElement(convertDateTime(src.getRecordedElement())); + if (src.hasPrimarySource()) + tgt.setPrimarySourceElement(convertBoolean(src.getPrimarySourceElement())); + if (src.hasReportOrigin()) + tgt.setInformationSource(convertCodeableConcept(src.getReportOrigin())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasManufacturer()) + tgt.setManufacturer(convertReference(src.getManufacturer())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(convertDate(src.getExpirationDateElement())); + if (src.hasSite()) + tgt.setSite(convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(convertCodeableConcept(src.getRoute())); + if (src.hasDoseQuantity()) + tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertImmunizationPerformerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasIsSubpotent()) + tgt.setIsSubpotentElement(convertBoolean(src.getIsSubpotentElement())); + if (src.hasSubpotentReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubpotentReason()) tgt.addSubpotentReason(convertCodeableConcept(t)); + } + if (src.hasEducation()) { + for (org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent t : src.getEducation()) tgt.addEducation(convertImmunizationEducationComponent(t)); + } + if (src.hasProgramEligibility()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramEligibility()) tgt.addProgramEligibility(convertCodeableConcept(t)); + } + if (src.hasFundingSource()) + tgt.setFundingSource(convertCodeableConcept(src.getFundingSource())); + if (src.hasReaction()) { + for (org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) tgt.addReaction(convertImmunizationReactionComponent(t)); + } + if (src.hasProtocolApplied()) { + for (org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied()) tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Immunization convertImmunization(org.hl7.fhir.r5.model.Immunization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Immunization tgt = new org.hl7.fhir.r4.model.Immunization(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertImmunizationStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasVaccineCode()) + tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasRecorded()) + tgt.setRecordedElement(convertDateTime(src.getRecordedElement())); + if (src.hasPrimarySource()) + tgt.setPrimarySourceElement(convertBoolean(src.getPrimarySourceElement())); + if (src.hasInformationSourceCodeableConcept()) + tgt.setReportOrigin(convertCodeableConcept(src.getInformationSourceCodeableConcept())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasManufacturer()) + tgt.setManufacturer(convertReference(src.getManufacturer())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(convertDate(src.getExpirationDateElement())); + if (src.hasSite()) + tgt.setSite(convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(convertCodeableConcept(src.getRoute())); + if (src.hasDoseQuantity()) + tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertImmunizationPerformerComponent(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasIsSubpotent()) + tgt.setIsSubpotentElement(convertBoolean(src.getIsSubpotentElement())); + if (src.hasSubpotentReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubpotentReason()) tgt.addSubpotentReason(convertCodeableConcept(t)); + } + if (src.hasEducation()) { + for (org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent t : src.getEducation()) tgt.addEducation(convertImmunizationEducationComponent(t)); + } + if (src.hasProgramEligibility()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramEligibility()) tgt.addProgramEligibility(convertCodeableConcept(t)); + } + if (src.hasFundingSource()) + tgt.setFundingSource(convertCodeableConcept(src.getFundingSource())); + if (src.hasReaction()) { + for (org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) tgt.addReaction(convertImmunizationReactionComponent(t)); + } + if (src.hasProtocolApplied()) { + for (org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied()) tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes convertImmunizationStatus(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETED: + return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR; + case NOTDONE: + return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NOTDONE; + default: + return org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Immunization.ImmunizationStatus convertImmunizationStatus(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETED: + return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.ENTEREDINERROR; + case NOTDONE: + return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NOTDONE; + default: + return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent(); + copyElement(src, tgt); + if (src.hasDocumentType()) + tgt.setDocumentTypeElement(convertString(src.getDocumentTypeElement())); + if (src.hasReference()) + tgt.setReferenceElement(convertUri(src.getReferenceElement())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); + if (src.hasPresentationDate()) + tgt.setPresentationDateElement(convertDateTime(src.getPresentationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent(); + copyElement(src, tgt); + if (src.hasDocumentType()) + tgt.setDocumentTypeElement(convertString(src.getDocumentTypeElement())); + if (src.hasReference()) + tgt.setReferenceElement(convertUri(src.getReferenceElement())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement())); + if (src.hasPresentationDate()) + tgt.setPresentationDateElement(convertDateTime(src.getPresentationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent(); + copyElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasDetail()) + tgt.setDetail(convertReference(src.getDetail())); + if (src.hasReported()) + tgt.setReportedElement(convertBoolean(src.getReportedElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent(); + copyElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasDetail()) + tgt.setDetail(convertReference(src.getDetail())); + if (src.hasReported()) + tgt.setReportedElement(convertBoolean(src.getReportedElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent(); + copyElement(src, tgt); + if (src.hasSeries()) + tgt.setSeriesElement(convertString(src.getSeriesElement())); + if (src.hasAuthority()) + tgt.setAuthority(convertReference(src.getAuthority())); + if (src.hasTargetDisease()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTargetDisease()) tgt.addTargetDisease(convertCodeableConcept(t)); + } + if (src.hasDoseNumber()) + tgt.setDoseNumber(convertType(src.getDoseNumber())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(convertType(src.getSeriesDoses())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent(); + copyElement(src, tgt); + if (src.hasSeries()) + tgt.setSeriesElement(convertString(src.getSeriesElement())); + if (src.hasAuthority()) + tgt.setAuthority(convertReference(src.getAuthority())); + if (src.hasTargetDisease()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTargetDisease()) tgt.addTargetDisease(convertCodeableConcept(t)); + } + if (src.hasDoseNumber()) + tgt.setDoseNumber(convertType(src.getDoseNumber())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(convertType(src.getSeriesDoses())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationEvaluation.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationEvaluation.java index c84f96e4c..94f329a0f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationEvaluation.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationEvaluation.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,99 +50,104 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ImmunizationEvaluation extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r4.model.ImmunizationEvaluation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r5.model.ImmunizationEvaluation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertImmunizationEvaluationStatus(src.getStatus())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasAuthority()) - tgt.setAuthority(convertReference(src.getAuthority())); - if (src.hasTargetDisease()) - tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease())); - if (src.hasImmunizationEvent()) - tgt.setImmunizationEvent(convertReference(src.getImmunizationEvent())); - if (src.hasDoseStatus()) - tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDoseStatusReason()) - tgt.addDoseStatusReason(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSeries()) - tgt.setSeriesElement(convertString(src.getSeriesElement())); - if (src.hasDoseNumber()) - tgt.setDoseNumber(convertType(src.getDoseNumber())); - if (src.hasSeriesDoses()) - tgt.setSeriesDoses(convertType(src.getSeriesDoses())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r5.model.ImmunizationEvaluation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r4.model.ImmunizationEvaluation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertImmunizationEvaluationStatus(src.getStatus())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasAuthority()) - tgt.setAuthority(convertReference(src.getAuthority())); - if (src.hasTargetDisease()) - tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease())); - if (src.hasImmunizationEvent()) - tgt.setImmunizationEvent(convertReference(src.getImmunizationEvent())); - if (src.hasDoseStatus()) - tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDoseStatusReason()) - tgt.addDoseStatusReason(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSeries()) - tgt.setSeriesElement(convertString(src.getSeriesElement())); - if (src.hasDoseNumber()) - tgt.setDoseNumber(convertType(src.getDoseNumber())); - if (src.hasSeriesDoses()) - tgt.setSeriesDoses(convertType(src.getSeriesDoses())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes convertImmunizationEvaluationStatus(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETED: return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus convertImmunizationEvaluationStatus(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETED: return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r4.model.ImmunizationEvaluation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r5.model.ImmunizationEvaluation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertImmunizationEvaluationStatus(src.getStatus())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(convertReference(src.getAuthority())); + if (src.hasTargetDisease()) + tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease())); + if (src.hasImmunizationEvent()) + tgt.setImmunizationEvent(convertReference(src.getImmunizationEvent())); + if (src.hasDoseStatus()) + tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus())); + if (src.hasDoseStatusReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDoseStatusReason()) tgt.addDoseStatusReason(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(convertType(src.getDoseNumber())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(convertType(src.getSeriesDoses())); + return tgt; + } + public static org.hl7.fhir.r4.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r5.model.ImmunizationEvaluation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r4.model.ImmunizationEvaluation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertImmunizationEvaluationStatus(src.getStatus())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(convertReference(src.getAuthority())); + if (src.hasTargetDisease()) + tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease())); + if (src.hasImmunizationEvent()) + tgt.setImmunizationEvent(convertReference(src.getImmunizationEvent())); + if (src.hasDoseStatus()) + tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus())); + if (src.hasDoseStatusReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDoseStatusReason()) tgt.addDoseStatusReason(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(convertType(src.getDoseNumber())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(convertType(src.getSeriesDoses())); + return tgt; + } + public static org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes convertImmunizationEvaluationStatus(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETED: + return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus convertImmunizationEvaluationStatus(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETED: + return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationRecommendation.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationRecommendation.java index 12f8dd0b2..d471da93d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationRecommendation.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImmunizationRecommendation.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,135 +50,146 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ImmunizationRecommendation extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r4.model.ImmunizationRecommendation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasAuthority()) - tgt.setAuthority(convertReference(src.getAuthority())); - for (org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) - tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r4.model.ImmunizationRecommendation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(convertReference(src.getAuthority())); + if (src.hasRecommendation()) { + for (org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r5.model.ImmunizationRecommendation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasAuthority()) - tgt.setAuthority(convertReference(src.getAuthority())); - for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) - tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r5.model.ImmunizationRecommendation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(convertReference(src.getAuthority())); + if (src.hasRecommendation()) { + for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getVaccineCode()) - tgt.addVaccineCode(convertCodeableConcept(t)); - if (src.hasTargetDisease()) - tgt.addTargetDisease(convertCodeableConcept(src.getTargetDisease())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getContraindicatedVaccineCode()) - tgt.addContraindicatedVaccineCode(convertCodeableConcept(t)); - if (src.hasForecastStatus()) - tgt.setForecastStatus(convertCodeableConcept(src.getForecastStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getForecastReason()) - tgt.addForecastReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) - tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSeries()) - tgt.setSeriesElement(convertString(src.getSeriesElement())); - if (src.hasDoseNumber()) - tgt.setDoseNumber(convertType(src.getDoseNumber())); - if (src.hasSeriesDoses()) - tgt.setSeriesDoses(convertType(src.getSeriesDoses())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingImmunization()) - tgt.addSupportingImmunization(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingPatientInformation()) - tgt.addSupportingPatientInformation(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); + copyElement(src, tgt); + if (src.hasVaccineCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getVaccineCode()) tgt.addVaccineCode(convertCodeableConcept(t)); + } + if (src.hasTargetDisease()) + tgt.addTargetDisease(convertCodeableConcept(src.getTargetDisease())); + if (src.hasContraindicatedVaccineCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getContraindicatedVaccineCode()) tgt.addContraindicatedVaccineCode(convertCodeableConcept(t)); + } + if (src.hasForecastStatus()) + tgt.setForecastStatus(convertCodeableConcept(src.getForecastStatus())); + if (src.hasForecastReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getForecastReason()) tgt.addForecastReason(convertCodeableConcept(t)); + } + if (src.hasDateCriterion()) { + for (org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(convertType(src.getDoseNumber())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(convertType(src.getSeriesDoses())); + if (src.hasSupportingImmunization()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingImmunization()) tgt.addSupportingImmunization(convertReference(t)); + } + if (src.hasSupportingPatientInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingPatientInformation()) tgt.addSupportingPatientInformation(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getVaccineCode()) - tgt.addVaccineCode(convertCodeableConcept(t)); - if (src.hasTargetDisease()) - tgt.setTargetDisease(convertCodeableConcept(src.getTargetDiseaseFirstRep())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getContraindicatedVaccineCode()) - tgt.addContraindicatedVaccineCode(convertCodeableConcept(t)); - if (src.hasForecastStatus()) - tgt.setForecastStatus(convertCodeableConcept(src.getForecastStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getForecastReason()) - tgt.addForecastReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) - tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasSeries()) - tgt.setSeriesElement(convertString(src.getSeriesElement())); - if (src.hasDoseNumber()) - tgt.setDoseNumber(convertType(src.getDoseNumber())); - if (src.hasSeriesDoses()) - tgt.setSeriesDoses(convertType(src.getSeriesDoses())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingImmunization()) - tgt.addSupportingImmunization(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingPatientInformation()) - tgt.addSupportingPatientInformation(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValueElement(convertDateTime(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValueElement(convertDateTime(src.getValueElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); + copyElement(src, tgt); + if (src.hasVaccineCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getVaccineCode()) tgt.addVaccineCode(convertCodeableConcept(t)); + } + if (src.hasTargetDisease()) + tgt.setTargetDisease(convertCodeableConcept(src.getTargetDiseaseFirstRep())); + if (src.hasContraindicatedVaccineCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getContraindicatedVaccineCode()) tgt.addContraindicatedVaccineCode(convertCodeableConcept(t)); + } + if (src.hasForecastStatus()) + tgt.setForecastStatus(convertCodeableConcept(src.getForecastStatus())); + if (src.hasForecastReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getForecastReason()) tgt.addForecastReason(convertCodeableConcept(t)); + } + if (src.hasDateCriterion()) { + for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(convertType(src.getDoseNumber())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(convertType(src.getSeriesDoses())); + if (src.hasSupportingImmunization()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingImmunization()) tgt.addSupportingImmunization(convertReference(t)); + } + if (src.hasSupportingPatientInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingPatientInformation()) tgt.addSupportingPatientInformation(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValueElement(convertDateTime(src.getValueElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValueElement(convertDateTime(src.getValueElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java index 56ff08264..ca698240c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,1221 +51,1975 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ImplementationGuide extends VersionConvertor_40_50 { - static final String EXT_IG_DEFINITION_PARAMETER = "http://hl7.org/fhir/tools/StructureDefinition/ig-parameter"; - - public static org.hl7.fhir.r5.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r4.model.ImplementationGuide src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide tgt = new org.hl7.fhir.r5.model.ImplementationGuide(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasPackageId()) - tgt.setPackageIdElement(convertId(src.getPackageIdElement())); - if (src.hasLicense()) - tgt.setLicense(convertSPDXLicense(src.getLicense())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getFhirVersion()) - copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) - tgt.addDependsOn(convertImplementationGuideDependsOnComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) - tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - if (src.hasDefinition()) - tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition())); - if (src.hasManifest()) - tgt.setManifest(convertImplementationGuideManifestComponent(src.getManifest())); - return tgt; - } + static final String EXT_IG_DEFINITION_PARAMETER = "http://hl7.org/fhir/tools/StructureDefinition/ig-parameter"; - public static org.hl7.fhir.r4.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r5.model.ImplementationGuide src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide tgt = new org.hl7.fhir.r4.model.ImplementationGuide(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasPackageId()) - tgt.setPackageIdElement(convertId(src.getPackageIdElement())); - if (src.hasLicense()) - tgt.setLicense(convertSPDXLicense(src.getLicense())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getFhirVersion()) - copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) - tgt.addDependsOn(convertImplementationGuideDependsOnComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) - tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); - if (src.hasDefinition()) - tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition())); - if (src.hasManifest()) - tgt.setManifest(convertImplementationGuideManifestComponent(src.getManifest())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense convertSPDXLicense(org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTOPENSOURCE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOTOPENSOURCE; - case _0BSD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense._0BSD; - case AAL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AAL; - case ABSTYLES: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ABSTYLES; - case ADOBE2006: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADOBE2006; - case ADOBEGLYPH: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADOBEGLYPH; - case ADSL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADSL; - case AFL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL1_1; - case AFL1_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL1_2; - case AFL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL2_0; - case AFL2_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL2_1; - case AFL3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL3_0; - case AFMPARSE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFMPARSE; - case AGPL1_0ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL1_0ONLY; - case AGPL1_0ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL1_0ORLATER; - case AGPL3_0ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL3_0ONLY; - case AGPL3_0ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL3_0ORLATER; - case ALADDIN: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ALADDIN; - case AMDPLPA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AMDPLPA; - case AML: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AML; - case AMPAS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AMPAS; - case ANTLRPD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ANTLRPD; - case APACHE1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE1_0; - case APACHE1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE1_1; - case APACHE2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE2_0; - case APAFML: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APAFML; - case APL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APL1_0; - case APSL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_0; - case APSL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_1; - case APSL1_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_2; - case APSL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL2_0; - case ARTISTIC1_0CL8: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0CL8; - case ARTISTIC1_0PERL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0PERL; - case ARTISTIC1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0; - case ARTISTIC2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC2_0; - case BAHYPH: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BAHYPH; - case BARR: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BARR; - case BEERWARE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BEERWARE; - case BITTORRENT1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BITTORRENT1_0; - case BITTORRENT1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BITTORRENT1_1; - case BORCEUX: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BORCEUX; - case BSD1CLAUSE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD1CLAUSE; - case BSD2CLAUSEFREEBSD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEFREEBSD; - case BSD2CLAUSENETBSD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSENETBSD; - case BSD2CLAUSEPATENT: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEPATENT; - case BSD2CLAUSE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSE; - case BSD3CLAUSEATTRIBUTION: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSEATTRIBUTION; - case BSD3CLAUSECLEAR: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSECLEAR; - case BSD3CLAUSELBNL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSELBNL; - case BSD3CLAUSENONUCLEARLICENSE2014: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE2014; - case BSD3CLAUSENONUCLEARLICENSE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE; - case BSD3CLAUSENONUCLEARWARRANTY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARWARRANTY; - case BSD3CLAUSE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSE; - case BSD4CLAUSEUC: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD4CLAUSEUC; - case BSD4CLAUSE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD4CLAUSE; - case BSDPROTECTION: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSDPROTECTION; - case BSDSOURCECODE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSDSOURCECODE; - case BSL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSL1_0; - case BZIP21_0_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BZIP21_0_5; - case BZIP21_0_6: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BZIP21_0_6; - case CALDERA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CALDERA; - case CATOSL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CATOSL1_1; - case CCBY1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY1_0; - case CCBY2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY2_0; - case CCBY2_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY2_5; - case CCBY3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY3_0; - case CCBY4_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY4_0; - case CCBYNC1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC1_0; - case CCBYNC2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC2_0; - case CCBYNC2_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC2_5; - case CCBYNC3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC3_0; - case CCBYNC4_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC4_0; - case CCBYNCND1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND1_0; - case CCBYNCND2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND2_0; - case CCBYNCND2_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND2_5; - case CCBYNCND3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND3_0; - case CCBYNCND4_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND4_0; - case CCBYNCSA1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA1_0; - case CCBYNCSA2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_0; - case CCBYNCSA2_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_5; - case CCBYNCSA3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA3_0; - case CCBYNCSA4_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA4_0; - case CCBYND1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND1_0; - case CCBYND2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND2_0; - case CCBYND2_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND2_5; - case CCBYND3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND3_0; - case CCBYND4_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND4_0; - case CCBYSA1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA1_0; - case CCBYSA2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA2_0; - case CCBYSA2_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA2_5; - case CCBYSA3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA3_0; - case CCBYSA4_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA4_0; - case CC01_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CC01_0; - case CDDL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDDL1_0; - case CDDL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDDL1_1; - case CDLAPERMISSIVE1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDLAPERMISSIVE1_0; - case CDLASHARING1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDLASHARING1_0; - case CECILL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL1_0; - case CECILL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL1_1; - case CECILL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL2_0; - case CECILL2_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL2_1; - case CECILLB: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILLB; - case CECILLC: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILLC; - case CLARTISTIC: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CLARTISTIC; - case CNRIJYTHON: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIJYTHON; - case CNRIPYTHONGPLCOMPATIBLE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIPYTHONGPLCOMPATIBLE; - case CNRIPYTHON: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIPYTHON; - case CONDOR1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CONDOR1_1; - case CPAL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPAL1_0; - case CPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPL1_0; - case CPOL1_02: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPOL1_02; - case CROSSWORD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CROSSWORD; - case CRYSTALSTACKER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CRYSTALSTACKER; - case CUAOPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CUAOPL1_0; - case CUBE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CUBE; - case CURL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CURL; - case DFSL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DFSL1_0; - case DIFFMARK: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DIFFMARK; - case DOC: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DOC; - case DOTSEQN: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DOTSEQN; - case DSDP: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DSDP; - case DVIPDFM: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DVIPDFM; - case ECL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ECL1_0; - case ECL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ECL2_0; - case EFL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EFL1_0; - case EFL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EFL2_0; - case EGENIX: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EGENIX; - case ENTESSA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ENTESSA; - case EPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EPL1_0; - case EPL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EPL2_0; - case ERLPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ERLPL1_1; - case EUDATAGRID: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUDATAGRID; - case EUPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_0; - case EUPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_1; - case EUPL1_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_2; - case EUROSYM: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUROSYM; - case FAIR: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FAIR; - case FRAMEWORX1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FRAMEWORX1_0; - case FREEIMAGE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FREEIMAGE; - case FSFAP: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFAP; - case FSFUL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFUL; - case FSFULLR: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFULLR; - case FTL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FTL; - case GFDL1_1ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_1ONLY; - case GFDL1_1ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_1ORLATER; - case GFDL1_2ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_2ONLY; - case GFDL1_2ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_2ORLATER; - case GFDL1_3ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_3ONLY; - case GFDL1_3ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_3ORLATER; - case GIFTWARE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GIFTWARE; - case GL2PS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GL2PS; - case GLIDE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GLIDE; - case GLULXE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GLULXE; - case GNUPLOT: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GNUPLOT; - case GPL1_0ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL1_0ONLY; - case GPL1_0ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL1_0ORLATER; - case GPL2_0ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL2_0ONLY; - case GPL2_0ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL2_0ORLATER; - case GPL3_0ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL3_0ONLY; - case GPL3_0ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL3_0ORLATER; - case GSOAP1_3B: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GSOAP1_3B; - case HASKELLREPORT: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.HASKELLREPORT; - case HPND: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.HPND; - case IBMPIBS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IBMPIBS; - case ICU: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ICU; - case IJG: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IJG; - case IMAGEMAGICK: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMAGEMAGICK; - case IMATIX: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMATIX; - case IMLIB2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMLIB2; - case INFOZIP: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INFOZIP; - case INTELACPI: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTELACPI; - case INTEL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTEL; - case INTERBASE1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTERBASE1_0; - case IPA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IPA; - case IPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IPL1_0; - case ISC: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ISC; - case JASPER2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.JASPER2_0; - case JSON: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.JSON; - case LAL1_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LAL1_2; - case LAL1_3: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LAL1_3; - case LATEX2E: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LATEX2E; - case LEPTONICA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LEPTONICA; - case LGPL2_0ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_0ONLY; - case LGPL2_0ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_0ORLATER; - case LGPL2_1ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_1ONLY; - case LGPL2_1ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_1ORLATER; - case LGPL3_0ONLY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL3_0ONLY; - case LGPL3_0ORLATER: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL3_0ORLATER; - case LGPLLR: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPLLR; - case LIBPNG: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LIBPNG; - case LIBTIFF: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LIBTIFF; - case LILIQP1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQP1_1; - case LILIQR1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQR1_1; - case LILIQRPLUS1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQRPLUS1_1; - case LINUXOPENIB: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LINUXOPENIB; - case LPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPL1_0; - case LPL1_02: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPL1_02; - case LPPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_0; - case LPPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_1; - case LPPL1_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_2; - case LPPL1_3A: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_3A; - case LPPL1_3C: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_3C; - case MAKEINDEX: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MAKEINDEX; - case MIROS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIROS; - case MIT0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIT0; - case MITADVERTISING: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITADVERTISING; - case MITCMU: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITCMU; - case MITENNA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITENNA; - case MITFEH: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITFEH; - case MIT: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIT; - case MITNFA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITNFA; - case MOTOSOTO: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MOTOSOTO; - case MPICH2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPICH2; - case MPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL1_0; - case MPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL1_1; - case MPL2_0NOCOPYLEFTEXCEPTION: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL2_0NOCOPYLEFTEXCEPTION; - case MPL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL2_0; - case MSPL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MSPL; - case MSRL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MSRL; - case MTLL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MTLL; - case MULTICS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MULTICS; - case MUP: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MUP; - case NASA1_3: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NASA1_3; - case NAUMEN: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NAUMEN; - case NBPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NBPL1_0; - case NCSA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NCSA; - case NETSNMP: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NETSNMP; - case NETCDF: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NETCDF; - case NEWSLETR: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NEWSLETR; - case NGPL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NGPL; - case NLOD1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NLOD1_0; - case NLPL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NLPL; - case NOKIA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOKIA; - case NOSL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOSL; - case NOWEB: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOWEB; - case NPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPL1_0; - case NPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPL1_1; - case NPOSL3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPOSL3_0; - case NRL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NRL; - case NTP: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NTP; - case OCCTPL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OCCTPL; - case OCLC2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OCLC2_0; - case ODBL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ODBL1_0; - case OFL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OFL1_0; - case OFL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OFL1_1; - case OGTSL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OGTSL; - case OLDAP1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_1; - case OLDAP1_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_2; - case OLDAP1_3: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_3; - case OLDAP1_4: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_4; - case OLDAP2_0_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_0_1; - case OLDAP2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_0; - case OLDAP2_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_1; - case OLDAP2_2_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2_1; - case OLDAP2_2_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2_2; - case OLDAP2_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2; - case OLDAP2_3: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_3; - case OLDAP2_4: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_4; - case OLDAP2_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_5; - case OLDAP2_6: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_6; - case OLDAP2_7: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_7; - case OLDAP2_8: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_8; - case OML: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OML; - case OPENSSL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OPENSSL; - case OPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OPL1_0; - case OSETPL2_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSETPL2_1; - case OSL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL1_0; - case OSL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL1_1; - case OSL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL2_0; - case OSL2_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL2_1; - case OSL3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL3_0; - case PDDL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PDDL1_0; - case PHP3_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PHP3_0; - case PHP3_01: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PHP3_01; - case PLEXUS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PLEXUS; - case POSTGRESQL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.POSTGRESQL; - case PSFRAG: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PSFRAG; - case PSUTILS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PSUTILS; - case PYTHON2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PYTHON2_0; - case QHULL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.QHULL; - case QPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.QPL1_0; - case RDISC: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RDISC; - case RHECOS1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RHECOS1_1; - case RPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPL1_1; - case RPL1_5: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPL1_5; - case RPSL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPSL1_0; - case RSAMD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RSAMD; - case RSCPL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RSCPL; - case RUBY: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RUBY; - case SAXPD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SAXPD; - case SAXPATH: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SAXPATH; - case SCEA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SCEA; - case SENDMAIL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SENDMAIL; - case SGIB1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB1_0; - case SGIB1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB1_1; - case SGIB2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB2_0; - case SIMPL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SIMPL2_0; - case SISSL1_2: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SISSL1_2; - case SISSL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SISSL; - case SLEEPYCAT: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SLEEPYCAT; - case SMLNJ: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SMLNJ; - case SMPPL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SMPPL; - case SNIA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SNIA; - case SPENCER86: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER86; - case SPENCER94: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER94; - case SPENCER99: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER99; - case SPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPL1_0; - case SUGARCRM1_1_3: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SUGARCRM1_1_3; - case SWL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SWL; - case TCL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TCL; - case TCPWRAPPERS: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TCPWRAPPERS; - case TMATE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TMATE; - case TORQUE1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TORQUE1_1; - case TOSL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TOSL; - case UNICODEDFS2015: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODEDFS2015; - case UNICODEDFS2016: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODEDFS2016; - case UNICODETOU: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODETOU; - case UNLICENSE: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNLICENSE; - case UPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UPL1_0; - case VIM: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VIM; - case VOSTROM: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VOSTROM; - case VSL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VSL1_0; - case W3C19980720: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C19980720; - case W3C20150513: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C20150513; - case W3C: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C; - case WATCOM1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WATCOM1_0; - case WSUIPA: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WSUIPA; - case WTFPL: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WTFPL; - case X11: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.X11; - case XEROX: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XEROX; - case XFREE861_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XFREE861_1; - case XINETD: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XINETD; - case XNET: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XNET; - case XPP: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XPP; - case XSKAT: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XSKAT; - case YPL1_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.YPL1_0; - case YPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.YPL1_1; - case ZED: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZED; - case ZEND2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZEND2_0; - case ZIMBRA1_3: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZIMBRA1_3; - case ZIMBRA1_4: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZIMBRA1_4; - case ZLIBACKNOWLEDGEMENT: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZLIBACKNOWLEDGEMENT; - case ZLIB: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZLIB; - case ZPL1_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL1_1; - case ZPL2_0: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL2_0; - case ZPL2_1: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL2_1; - default: return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NULL; - } -} - - public static org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense convertSPDXLicense(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NOTOPENSOURCE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOTOPENSOURCE; - case _0BSD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense._0BSD; - case AAL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AAL; - case ABSTYLES: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ABSTYLES; - case ADOBE2006: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ADOBE2006; - case ADOBEGLYPH: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ADOBEGLYPH; - case ADSL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ADSL; - case AFL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL1_1; - case AFL1_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL1_2; - case AFL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL2_0; - case AFL2_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL2_1; - case AFL3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL3_0; - case AFMPARSE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFMPARSE; - case AGPL1_0ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL1_0ONLY; - case AGPL1_0ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL1_0ORLATER; - case AGPL3_0ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL3_0ONLY; - case AGPL3_0ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL3_0ORLATER; - case ALADDIN: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ALADDIN; - case AMDPLPA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AMDPLPA; - case AML: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AML; - case AMPAS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AMPAS; - case ANTLRPD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ANTLRPD; - case APACHE1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APACHE1_0; - case APACHE1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APACHE1_1; - case APACHE2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APACHE2_0; - case APAFML: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APAFML; - case APL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APL1_0; - case APSL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL1_0; - case APSL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL1_1; - case APSL1_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL1_2; - case APSL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL2_0; - case ARTISTIC1_0CL8: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0CL8; - case ARTISTIC1_0PERL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0PERL; - case ARTISTIC1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0; - case ARTISTIC2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC2_0; - case BAHYPH: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BAHYPH; - case BARR: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BARR; - case BEERWARE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BEERWARE; - case BITTORRENT1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BITTORRENT1_0; - case BITTORRENT1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BITTORRENT1_1; - case BORCEUX: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BORCEUX; - case BSD1CLAUSE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD1CLAUSE; - case BSD2CLAUSEFREEBSD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEFREEBSD; - case BSD2CLAUSENETBSD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSENETBSD; - case BSD2CLAUSEPATENT: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEPATENT; - case BSD2CLAUSE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSE; - case BSD3CLAUSEATTRIBUTION: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSEATTRIBUTION; - case BSD3CLAUSECLEAR: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSECLEAR; - case BSD3CLAUSELBNL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSELBNL; - case BSD3CLAUSENONUCLEARLICENSE2014: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE2014; - case BSD3CLAUSENONUCLEARLICENSE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE; - case BSD3CLAUSENONUCLEARWARRANTY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARWARRANTY; - case BSD3CLAUSE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSE; - case BSD4CLAUSEUC: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD4CLAUSEUC; - case BSD4CLAUSE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD4CLAUSE; - case BSDPROTECTION: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSDPROTECTION; - case BSDSOURCECODE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSDSOURCECODE; - case BSL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSL1_0; - case BZIP21_0_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BZIP21_0_5; - case BZIP21_0_6: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BZIP21_0_6; - case CALDERA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CALDERA; - case CATOSL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CATOSL1_1; - case CCBY1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY1_0; - case CCBY2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY2_0; - case CCBY2_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY2_5; - case CCBY3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY3_0; - case CCBY4_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY4_0; - case CCBYNC1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC1_0; - case CCBYNC2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC2_0; - case CCBYNC2_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC2_5; - case CCBYNC3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC3_0; - case CCBYNC4_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC4_0; - case CCBYNCND1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND1_0; - case CCBYNCND2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND2_0; - case CCBYNCND2_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND2_5; - case CCBYNCND3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND3_0; - case CCBYNCND4_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND4_0; - case CCBYNCSA1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA1_0; - case CCBYNCSA2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_0; - case CCBYNCSA2_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_5; - case CCBYNCSA3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA3_0; - case CCBYNCSA4_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA4_0; - case CCBYND1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND1_0; - case CCBYND2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND2_0; - case CCBYND2_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND2_5; - case CCBYND3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND3_0; - case CCBYND4_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND4_0; - case CCBYSA1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA1_0; - case CCBYSA2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA2_0; - case CCBYSA2_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA2_5; - case CCBYSA3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA3_0; - case CCBYSA4_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA4_0; - case CC01_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CC01_0; - case CDDL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDDL1_0; - case CDDL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDDL1_1; - case CDLAPERMISSIVE1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDLAPERMISSIVE1_0; - case CDLASHARING1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDLASHARING1_0; - case CECILL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL1_0; - case CECILL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL1_1; - case CECILL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL2_0; - case CECILL2_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL2_1; - case CECILLB: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILLB; - case CECILLC: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILLC; - case CLARTISTIC: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CLARTISTIC; - case CNRIJYTHON: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CNRIJYTHON; - case CNRIPYTHONGPLCOMPATIBLE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CNRIPYTHONGPLCOMPATIBLE; - case CNRIPYTHON: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CNRIPYTHON; - case CONDOR1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CONDOR1_1; - case CPAL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CPAL1_0; - case CPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CPL1_0; - case CPOL1_02: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CPOL1_02; - case CROSSWORD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CROSSWORD; - case CRYSTALSTACKER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CRYSTALSTACKER; - case CUAOPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CUAOPL1_0; - case CUBE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CUBE; - case CURL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CURL; - case DFSL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DFSL1_0; - case DIFFMARK: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DIFFMARK; - case DOC: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DOC; - case DOTSEQN: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DOTSEQN; - case DSDP: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DSDP; - case DVIPDFM: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DVIPDFM; - case ECL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ECL1_0; - case ECL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ECL2_0; - case EFL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EFL1_0; - case EFL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EFL2_0; - case EGENIX: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EGENIX; - case ENTESSA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ENTESSA; - case EPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EPL1_0; - case EPL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EPL2_0; - case ERLPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ERLPL1_1; - case EUDATAGRID: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUDATAGRID; - case EUPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUPL1_0; - case EUPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUPL1_1; - case EUPL1_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUPL1_2; - case EUROSYM: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUROSYM; - case FAIR: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FAIR; - case FRAMEWORX1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FRAMEWORX1_0; - case FREEIMAGE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FREEIMAGE; - case FSFAP: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FSFAP; - case FSFUL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FSFUL; - case FSFULLR: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FSFULLR; - case FTL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FTL; - case GFDL1_1ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_1ONLY; - case GFDL1_1ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_1ORLATER; - case GFDL1_2ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_2ONLY; - case GFDL1_2ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_2ORLATER; - case GFDL1_3ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_3ONLY; - case GFDL1_3ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_3ORLATER; - case GIFTWARE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GIFTWARE; - case GL2PS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GL2PS; - case GLIDE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GLIDE; - case GLULXE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GLULXE; - case GNUPLOT: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GNUPLOT; - case GPL1_0ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL1_0ONLY; - case GPL1_0ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL1_0ORLATER; - case GPL2_0ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL2_0ONLY; - case GPL2_0ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL2_0ORLATER; - case GPL3_0ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL3_0ONLY; - case GPL3_0ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL3_0ORLATER; - case GSOAP1_3B: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GSOAP1_3B; - case HASKELLREPORT: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.HASKELLREPORT; - case HPND: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.HPND; - case IBMPIBS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IBMPIBS; - case ICU: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ICU; - case IJG: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IJG; - case IMAGEMAGICK: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IMAGEMAGICK; - case IMATIX: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IMATIX; - case IMLIB2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IMLIB2; - case INFOZIP: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INFOZIP; - case INTELACPI: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INTELACPI; - case INTEL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INTEL; - case INTERBASE1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INTERBASE1_0; - case IPA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IPA; - case IPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IPL1_0; - case ISC: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ISC; - case JASPER2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.JASPER2_0; - case JSON: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.JSON; - case LAL1_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LAL1_2; - case LAL1_3: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LAL1_3; - case LATEX2E: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LATEX2E; - case LEPTONICA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LEPTONICA; - case LGPL2_0ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_0ONLY; - case LGPL2_0ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_0ORLATER; - case LGPL2_1ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_1ONLY; - case LGPL2_1ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_1ORLATER; - case LGPL3_0ONLY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL3_0ONLY; - case LGPL3_0ORLATER: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL3_0ORLATER; - case LGPLLR: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPLLR; - case LIBPNG: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LIBPNG; - case LIBTIFF: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LIBTIFF; - case LILIQP1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LILIQP1_1; - case LILIQR1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LILIQR1_1; - case LILIQRPLUS1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LILIQRPLUS1_1; - case LINUXOPENIB: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LINUXOPENIB; - case LPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPL1_0; - case LPL1_02: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPL1_02; - case LPPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_0; - case LPPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_1; - case LPPL1_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_2; - case LPPL1_3A: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_3A; - case LPPL1_3C: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_3C; - case MAKEINDEX: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MAKEINDEX; - case MIROS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MIROS; - case MIT0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MIT0; - case MITADVERTISING: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITADVERTISING; - case MITCMU: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITCMU; - case MITENNA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITENNA; - case MITFEH: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITFEH; - case MIT: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MIT; - case MITNFA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITNFA; - case MOTOSOTO: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MOTOSOTO; - case MPICH2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPICH2; - case MPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL1_0; - case MPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL1_1; - case MPL2_0NOCOPYLEFTEXCEPTION: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL2_0NOCOPYLEFTEXCEPTION; - case MPL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL2_0; - case MSPL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MSPL; - case MSRL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MSRL; - case MTLL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MTLL; - case MULTICS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MULTICS; - case MUP: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MUP; - case NASA1_3: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NASA1_3; - case NAUMEN: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NAUMEN; - case NBPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NBPL1_0; - case NCSA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NCSA; - case NETSNMP: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NETSNMP; - case NETCDF: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NETCDF; - case NEWSLETR: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NEWSLETR; - case NGPL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NGPL; - case NLOD1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NLOD1_0; - case NLPL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NLPL; - case NOKIA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOKIA; - case NOSL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOSL; - case NOWEB: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOWEB; - case NPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NPL1_0; - case NPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NPL1_1; - case NPOSL3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NPOSL3_0; - case NRL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NRL; - case NTP: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NTP; - case OCCTPL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OCCTPL; - case OCLC2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OCLC2_0; - case ODBL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ODBL1_0; - case OFL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OFL1_0; - case OFL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OFL1_1; - case OGTSL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OGTSL; - case OLDAP1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_1; - case OLDAP1_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_2; - case OLDAP1_3: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_3; - case OLDAP1_4: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_4; - case OLDAP2_0_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_0_1; - case OLDAP2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_0; - case OLDAP2_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_1; - case OLDAP2_2_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_2_1; - case OLDAP2_2_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_2_2; - case OLDAP2_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_2; - case OLDAP2_3: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_3; - case OLDAP2_4: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_4; - case OLDAP2_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_5; - case OLDAP2_6: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_6; - case OLDAP2_7: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_7; - case OLDAP2_8: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_8; - case OML: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OML; - case OPENSSL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OPENSSL; - case OPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OPL1_0; - case OSETPL2_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSETPL2_1; - case OSL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL1_0; - case OSL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL1_1; - case OSL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL2_0; - case OSL2_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL2_1; - case OSL3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL3_0; - case PDDL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PDDL1_0; - case PHP3_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PHP3_0; - case PHP3_01: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PHP3_01; - case PLEXUS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PLEXUS; - case POSTGRESQL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.POSTGRESQL; - case PSFRAG: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PSFRAG; - case PSUTILS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PSUTILS; - case PYTHON2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PYTHON2_0; - case QHULL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.QHULL; - case QPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.QPL1_0; - case RDISC: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RDISC; - case RHECOS1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RHECOS1_1; - case RPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RPL1_1; - case RPL1_5: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RPL1_5; - case RPSL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RPSL1_0; - case RSAMD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RSAMD; - case RSCPL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RSCPL; - case RUBY: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RUBY; - case SAXPD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SAXPD; - case SAXPATH: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SAXPATH; - case SCEA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SCEA; - case SENDMAIL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SENDMAIL; - case SGIB1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SGIB1_0; - case SGIB1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SGIB1_1; - case SGIB2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SGIB2_0; - case SIMPL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SIMPL2_0; - case SISSL1_2: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SISSL1_2; - case SISSL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SISSL; - case SLEEPYCAT: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SLEEPYCAT; - case SMLNJ: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SMLNJ; - case SMPPL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SMPPL; - case SNIA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SNIA; - case SPENCER86: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPENCER86; - case SPENCER94: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPENCER94; - case SPENCER99: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPENCER99; - case SPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPL1_0; - case SUGARCRM1_1_3: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SUGARCRM1_1_3; - case SWL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SWL; - case TCL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TCL; - case TCPWRAPPERS: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TCPWRAPPERS; - case TMATE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TMATE; - case TORQUE1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TORQUE1_1; - case TOSL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TOSL; - case UNICODEDFS2015: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNICODEDFS2015; - case UNICODEDFS2016: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNICODEDFS2016; - case UNICODETOU: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNICODETOU; - case UNLICENSE: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNLICENSE; - case UPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UPL1_0; - case VIM: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.VIM; - case VOSTROM: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.VOSTROM; - case VSL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.VSL1_0; - case W3C19980720: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.W3C19980720; - case W3C20150513: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.W3C20150513; - case W3C: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.W3C; - case WATCOM1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.WATCOM1_0; - case WSUIPA: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.WSUIPA; - case WTFPL: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.WTFPL; - case X11: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.X11; - case XEROX: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XEROX; - case XFREE861_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XFREE861_1; - case XINETD: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XINETD; - case XNET: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XNET; - case XPP: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XPP; - case XSKAT: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XSKAT; - case YPL1_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.YPL1_0; - case YPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.YPL1_1; - case ZED: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZED; - case ZEND2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZEND2_0; - case ZIMBRA1_3: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZIMBRA1_3; - case ZIMBRA1_4: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZIMBRA1_4; - case ZLIBACKNOWLEDGEMENT: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZLIBACKNOWLEDGEMENT; - case ZLIB: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZLIB; - case ZPL1_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZPL1_1; - case ZPL2_0: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZPL2_0; - case ZPL2_1: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZPL2_1; - default: return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NULL; - } -} - - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent convertImplementationGuideDependsOnComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); - copyElement(src, tgt); - if (src.hasUri()) - tgt.setUriElement(convertCanonical(src.getUriElement())); - if (src.hasPackageId()) - tgt.setPackageIdElement(convertId(src.getPackageIdElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent convertImplementationGuideDependsOnComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); - copyElement(src, tgt); - if (src.hasUri()) - tgt.setUriElement(convertCanonical(src.getUriElement())); - if (src.hasPackageId()) - tgt.setPackageIdElement(convertId(src.getPackageIdElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getGrouping()) - tgt.addGrouping(convertImplementationGuideDefinitionGroupingComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getResource()) - tgt.addResource(convertImplementationGuideDefinitionResourceComponent(t)); - if (src.hasPage()) - tgt.setPage(convertImplementationGuideDefinitionPageComponent(src.getPage())); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent t : src.getParameter()) - tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t)); - for (org.hl7.fhir.r4.model.Extension e: org.hl7.fhir.r4.utils.ToolingExtensions.getExtensions(src, EXT_IG_DEFINITION_PARAMETER)) { - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent p = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); - p.setCode(org.hl7.fhir.r4.utils.ToolingExtensions.readStringExtension(e,"code")); - p.setValue(org.hl7.fhir.r4.utils.ToolingExtensions.readStringExtension(e,"Value")); - tgt.addParameter(p); + public static org.hl7.fhir.r5.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r4.model.ImplementationGuide src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide tgt = new org.hl7.fhir.r5.model.ImplementationGuide(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(convertId(src.getPackageIdElement())); + if (src.hasLicense()) + tgt.setLicense(convertSPDXLicense(src.getLicense())); + if (src.hasFhirVersion()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getFhirVersion()) copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependsOn(convertImplementationGuideDependsOnComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasDefinition()) + tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition())); + if (src.hasManifest()) + tgt.setManifest(convertImplementationGuideManifestComponent(src.getManifest())); + return tgt; } - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent t : src.getTemplate()) - tgt.addTemplate(convertImplementationGuideDefinitionTemplateComponent(t)); - return tgt; - } - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getGrouping()) - tgt.addGrouping(convertImplementationGuideDefinitionGroupingComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getResource()) - tgt.addResource(convertImplementationGuideDefinitionResourceComponent(t)); - if (src.hasPage()) - tgt.setPage(convertImplementationGuideDefinitionPageComponent(src.getPage())); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent t : src.getParameter()) { - if (Utilities.existsInList(t.getCode(), "apply","path-resource","path-pages","path-tx-cache","expansion-parameter","rule-broken-links","generate-xml","generate-json","generate-turtle","html-template")) - tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t)); - else { - org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(EXT_IG_DEFINITION_PARAMETER); - org.hl7.fhir.r4.model.Extension eCode = new org.hl7.fhir.r4.model.Extension("code", new org.hl7.fhir.r4.model.StringType(t.getCode())); - org.hl7.fhir.r4.model.Extension eValue = new org.hl7.fhir.r4.model.Extension("value", new org.hl7.fhir.r4.model.StringType(t.getValue())); - e.addExtension(eCode); - e.addExtension(eValue); - tgt.addExtension(e); - } + public static org.hl7.fhir.r4.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r5.model.ImplementationGuide src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide tgt = new org.hl7.fhir.r4.model.ImplementationGuide(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(convertId(src.getPackageIdElement())); + if (src.hasLicense()) + tgt.setLicense(convertSPDXLicense(src.getLicense())); + if (src.hasFhirVersion()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getFhirVersion()) copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); + } + if (src.hasDependsOn()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependsOn(convertImplementationGuideDependsOnComponent(t)); + } + if (src.hasGlobal()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + } + if (src.hasDefinition()) + tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition())); + if (src.hasManifest()) + tgt.setManifest(convertImplementationGuideManifestComponent(src.getManifest())); + return tgt; } - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent t : src.getTemplate()) - tgt.addTemplate(convertImplementationGuideDefinitionTemplateComponent(t)); - return tgt; - } - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent convertImplementationGuideDefinitionGroupingComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense convertSPDXLicense(org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTOPENSOURCE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOTOPENSOURCE; + case _0BSD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense._0BSD; + case AAL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AAL; + case ABSTYLES: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ABSTYLES; + case ADOBE2006: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADOBE2006; + case ADOBEGLYPH: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADOBEGLYPH; + case ADSL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADSL; + case AFL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL1_1; + case AFL1_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL1_2; + case AFL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL2_0; + case AFL2_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL2_1; + case AFL3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL3_0; + case AFMPARSE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFMPARSE; + case AGPL1_0ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL1_0ONLY; + case AGPL1_0ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL1_0ORLATER; + case AGPL3_0ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL3_0ONLY; + case AGPL3_0ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL3_0ORLATER; + case ALADDIN: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ALADDIN; + case AMDPLPA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AMDPLPA; + case AML: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AML; + case AMPAS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AMPAS; + case ANTLRPD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ANTLRPD; + case APACHE1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE1_0; + case APACHE1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE1_1; + case APACHE2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE2_0; + case APAFML: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APAFML; + case APL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APL1_0; + case APSL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_0; + case APSL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_1; + case APSL1_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_2; + case APSL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL2_0; + case ARTISTIC1_0CL8: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0CL8; + case ARTISTIC1_0PERL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0PERL; + case ARTISTIC1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0; + case ARTISTIC2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC2_0; + case BAHYPH: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BAHYPH; + case BARR: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BARR; + case BEERWARE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BEERWARE; + case BITTORRENT1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BITTORRENT1_0; + case BITTORRENT1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BITTORRENT1_1; + case BORCEUX: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BORCEUX; + case BSD1CLAUSE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD1CLAUSE; + case BSD2CLAUSEFREEBSD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEFREEBSD; + case BSD2CLAUSENETBSD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSENETBSD; + case BSD2CLAUSEPATENT: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEPATENT; + case BSD2CLAUSE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSE; + case BSD3CLAUSEATTRIBUTION: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSEATTRIBUTION; + case BSD3CLAUSECLEAR: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSECLEAR; + case BSD3CLAUSELBNL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSELBNL; + case BSD3CLAUSENONUCLEARLICENSE2014: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE2014; + case BSD3CLAUSENONUCLEARLICENSE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE; + case BSD3CLAUSENONUCLEARWARRANTY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARWARRANTY; + case BSD3CLAUSE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSE; + case BSD4CLAUSEUC: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD4CLAUSEUC; + case BSD4CLAUSE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD4CLAUSE; + case BSDPROTECTION: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSDPROTECTION; + case BSDSOURCECODE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSDSOURCECODE; + case BSL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSL1_0; + case BZIP21_0_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BZIP21_0_5; + case BZIP21_0_6: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BZIP21_0_6; + case CALDERA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CALDERA; + case CATOSL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CATOSL1_1; + case CCBY1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY1_0; + case CCBY2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY2_0; + case CCBY2_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY2_5; + case CCBY3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY3_0; + case CCBY4_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY4_0; + case CCBYNC1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC1_0; + case CCBYNC2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC2_0; + case CCBYNC2_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC2_5; + case CCBYNC3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC3_0; + case CCBYNC4_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC4_0; + case CCBYNCND1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND1_0; + case CCBYNCND2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND2_0; + case CCBYNCND2_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND2_5; + case CCBYNCND3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND3_0; + case CCBYNCND4_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND4_0; + case CCBYNCSA1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA1_0; + case CCBYNCSA2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_0; + case CCBYNCSA2_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_5; + case CCBYNCSA3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA3_0; + case CCBYNCSA4_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA4_0; + case CCBYND1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND1_0; + case CCBYND2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND2_0; + case CCBYND2_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND2_5; + case CCBYND3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND3_0; + case CCBYND4_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND4_0; + case CCBYSA1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA1_0; + case CCBYSA2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA2_0; + case CCBYSA2_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA2_5; + case CCBYSA3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA3_0; + case CCBYSA4_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA4_0; + case CC01_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CC01_0; + case CDDL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDDL1_0; + case CDDL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDDL1_1; + case CDLAPERMISSIVE1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDLAPERMISSIVE1_0; + case CDLASHARING1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDLASHARING1_0; + case CECILL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL1_0; + case CECILL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL1_1; + case CECILL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL2_0; + case CECILL2_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL2_1; + case CECILLB: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILLB; + case CECILLC: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILLC; + case CLARTISTIC: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CLARTISTIC; + case CNRIJYTHON: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIJYTHON; + case CNRIPYTHONGPLCOMPATIBLE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIPYTHONGPLCOMPATIBLE; + case CNRIPYTHON: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIPYTHON; + case CONDOR1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CONDOR1_1; + case CPAL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPAL1_0; + case CPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPL1_0; + case CPOL1_02: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPOL1_02; + case CROSSWORD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CROSSWORD; + case CRYSTALSTACKER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CRYSTALSTACKER; + case CUAOPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CUAOPL1_0; + case CUBE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CUBE; + case CURL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CURL; + case DFSL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DFSL1_0; + case DIFFMARK: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DIFFMARK; + case DOC: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DOC; + case DOTSEQN: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DOTSEQN; + case DSDP: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DSDP; + case DVIPDFM: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DVIPDFM; + case ECL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ECL1_0; + case ECL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ECL2_0; + case EFL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EFL1_0; + case EFL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EFL2_0; + case EGENIX: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EGENIX; + case ENTESSA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ENTESSA; + case EPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EPL1_0; + case EPL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EPL2_0; + case ERLPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ERLPL1_1; + case EUDATAGRID: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUDATAGRID; + case EUPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_0; + case EUPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_1; + case EUPL1_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_2; + case EUROSYM: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUROSYM; + case FAIR: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FAIR; + case FRAMEWORX1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FRAMEWORX1_0; + case FREEIMAGE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FREEIMAGE; + case FSFAP: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFAP; + case FSFUL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFUL; + case FSFULLR: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFULLR; + case FTL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FTL; + case GFDL1_1ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_1ONLY; + case GFDL1_1ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_1ORLATER; + case GFDL1_2ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_2ONLY; + case GFDL1_2ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_2ORLATER; + case GFDL1_3ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_3ONLY; + case GFDL1_3ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_3ORLATER; + case GIFTWARE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GIFTWARE; + case GL2PS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GL2PS; + case GLIDE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GLIDE; + case GLULXE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GLULXE; + case GNUPLOT: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GNUPLOT; + case GPL1_0ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL1_0ONLY; + case GPL1_0ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL1_0ORLATER; + case GPL2_0ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL2_0ONLY; + case GPL2_0ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL2_0ORLATER; + case GPL3_0ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL3_0ONLY; + case GPL3_0ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL3_0ORLATER; + case GSOAP1_3B: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GSOAP1_3B; + case HASKELLREPORT: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.HASKELLREPORT; + case HPND: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.HPND; + case IBMPIBS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IBMPIBS; + case ICU: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ICU; + case IJG: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IJG; + case IMAGEMAGICK: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMAGEMAGICK; + case IMATIX: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMATIX; + case IMLIB2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMLIB2; + case INFOZIP: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INFOZIP; + case INTELACPI: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTELACPI; + case INTEL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTEL; + case INTERBASE1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTERBASE1_0; + case IPA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IPA; + case IPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IPL1_0; + case ISC: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ISC; + case JASPER2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.JASPER2_0; + case JSON: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.JSON; + case LAL1_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LAL1_2; + case LAL1_3: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LAL1_3; + case LATEX2E: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LATEX2E; + case LEPTONICA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LEPTONICA; + case LGPL2_0ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_0ONLY; + case LGPL2_0ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_0ORLATER; + case LGPL2_1ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_1ONLY; + case LGPL2_1ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_1ORLATER; + case LGPL3_0ONLY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL3_0ONLY; + case LGPL3_0ORLATER: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL3_0ORLATER; + case LGPLLR: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPLLR; + case LIBPNG: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LIBPNG; + case LIBTIFF: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LIBTIFF; + case LILIQP1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQP1_1; + case LILIQR1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQR1_1; + case LILIQRPLUS1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQRPLUS1_1; + case LINUXOPENIB: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LINUXOPENIB; + case LPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPL1_0; + case LPL1_02: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPL1_02; + case LPPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_0; + case LPPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_1; + case LPPL1_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_2; + case LPPL1_3A: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_3A; + case LPPL1_3C: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_3C; + case MAKEINDEX: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MAKEINDEX; + case MIROS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIROS; + case MIT0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIT0; + case MITADVERTISING: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITADVERTISING; + case MITCMU: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITCMU; + case MITENNA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITENNA; + case MITFEH: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITFEH; + case MIT: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIT; + case MITNFA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITNFA; + case MOTOSOTO: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MOTOSOTO; + case MPICH2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPICH2; + case MPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL1_0; + case MPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL1_1; + case MPL2_0NOCOPYLEFTEXCEPTION: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL2_0NOCOPYLEFTEXCEPTION; + case MPL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL2_0; + case MSPL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MSPL; + case MSRL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MSRL; + case MTLL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MTLL; + case MULTICS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MULTICS; + case MUP: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MUP; + case NASA1_3: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NASA1_3; + case NAUMEN: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NAUMEN; + case NBPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NBPL1_0; + case NCSA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NCSA; + case NETSNMP: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NETSNMP; + case NETCDF: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NETCDF; + case NEWSLETR: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NEWSLETR; + case NGPL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NGPL; + case NLOD1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NLOD1_0; + case NLPL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NLPL; + case NOKIA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOKIA; + case NOSL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOSL; + case NOWEB: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOWEB; + case NPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPL1_0; + case NPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPL1_1; + case NPOSL3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPOSL3_0; + case NRL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NRL; + case NTP: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NTP; + case OCCTPL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OCCTPL; + case OCLC2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OCLC2_0; + case ODBL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ODBL1_0; + case OFL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OFL1_0; + case OFL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OFL1_1; + case OGTSL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OGTSL; + case OLDAP1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_1; + case OLDAP1_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_2; + case OLDAP1_3: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_3; + case OLDAP1_4: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_4; + case OLDAP2_0_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_0_1; + case OLDAP2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_0; + case OLDAP2_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_1; + case OLDAP2_2_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2_1; + case OLDAP2_2_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2_2; + case OLDAP2_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2; + case OLDAP2_3: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_3; + case OLDAP2_4: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_4; + case OLDAP2_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_5; + case OLDAP2_6: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_6; + case OLDAP2_7: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_7; + case OLDAP2_8: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_8; + case OML: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OML; + case OPENSSL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OPENSSL; + case OPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OPL1_0; + case OSETPL2_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSETPL2_1; + case OSL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL1_0; + case OSL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL1_1; + case OSL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL2_0; + case OSL2_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL2_1; + case OSL3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL3_0; + case PDDL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PDDL1_0; + case PHP3_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PHP3_0; + case PHP3_01: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PHP3_01; + case PLEXUS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PLEXUS; + case POSTGRESQL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.POSTGRESQL; + case PSFRAG: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PSFRAG; + case PSUTILS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PSUTILS; + case PYTHON2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PYTHON2_0; + case QHULL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.QHULL; + case QPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.QPL1_0; + case RDISC: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RDISC; + case RHECOS1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RHECOS1_1; + case RPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPL1_1; + case RPL1_5: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPL1_5; + case RPSL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPSL1_0; + case RSAMD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RSAMD; + case RSCPL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RSCPL; + case RUBY: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RUBY; + case SAXPD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SAXPD; + case SAXPATH: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SAXPATH; + case SCEA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SCEA; + case SENDMAIL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SENDMAIL; + case SGIB1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB1_0; + case SGIB1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB1_1; + case SGIB2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB2_0; + case SIMPL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SIMPL2_0; + case SISSL1_2: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SISSL1_2; + case SISSL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SISSL; + case SLEEPYCAT: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SLEEPYCAT; + case SMLNJ: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SMLNJ; + case SMPPL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SMPPL; + case SNIA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SNIA; + case SPENCER86: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER86; + case SPENCER94: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER94; + case SPENCER99: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER99; + case SPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPL1_0; + case SUGARCRM1_1_3: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SUGARCRM1_1_3; + case SWL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SWL; + case TCL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TCL; + case TCPWRAPPERS: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TCPWRAPPERS; + case TMATE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TMATE; + case TORQUE1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TORQUE1_1; + case TOSL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TOSL; + case UNICODEDFS2015: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODEDFS2015; + case UNICODEDFS2016: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODEDFS2016; + case UNICODETOU: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODETOU; + case UNLICENSE: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNLICENSE; + case UPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UPL1_0; + case VIM: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VIM; + case VOSTROM: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VOSTROM; + case VSL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VSL1_0; + case W3C19980720: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C19980720; + case W3C20150513: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C20150513; + case W3C: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C; + case WATCOM1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WATCOM1_0; + case WSUIPA: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WSUIPA; + case WTFPL: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WTFPL; + case X11: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.X11; + case XEROX: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XEROX; + case XFREE861_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XFREE861_1; + case XINETD: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XINETD; + case XNET: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XNET; + case XPP: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XPP; + case XSKAT: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XSKAT; + case YPL1_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.YPL1_0; + case YPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.YPL1_1; + case ZED: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZED; + case ZEND2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZEND2_0; + case ZIMBRA1_3: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZIMBRA1_3; + case ZIMBRA1_4: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZIMBRA1_4; + case ZLIBACKNOWLEDGEMENT: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZLIBACKNOWLEDGEMENT; + case ZLIB: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZLIB; + case ZPL1_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL1_1; + case ZPL2_0: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL2_0; + case ZPL2_1: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL2_1; + default: + return org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NULL; + } + } - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent convertImplementationGuideDefinitionGroupingComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense convertSPDXLicense(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NOTOPENSOURCE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOTOPENSOURCE; + case _0BSD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense._0BSD; + case AAL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AAL; + case ABSTYLES: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ABSTYLES; + case ADOBE2006: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ADOBE2006; + case ADOBEGLYPH: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ADOBEGLYPH; + case ADSL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ADSL; + case AFL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL1_1; + case AFL1_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL1_2; + case AFL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL2_0; + case AFL2_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL2_1; + case AFL3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFL3_0; + case AFMPARSE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AFMPARSE; + case AGPL1_0ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL1_0ONLY; + case AGPL1_0ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL1_0ORLATER; + case AGPL3_0ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL3_0ONLY; + case AGPL3_0ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AGPL3_0ORLATER; + case ALADDIN: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ALADDIN; + case AMDPLPA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AMDPLPA; + case AML: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AML; + case AMPAS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.AMPAS; + case ANTLRPD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ANTLRPD; + case APACHE1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APACHE1_0; + case APACHE1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APACHE1_1; + case APACHE2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APACHE2_0; + case APAFML: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APAFML; + case APL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APL1_0; + case APSL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL1_0; + case APSL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL1_1; + case APSL1_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL1_2; + case APSL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.APSL2_0; + case ARTISTIC1_0CL8: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0CL8; + case ARTISTIC1_0PERL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0PERL; + case ARTISTIC1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0; + case ARTISTIC2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ARTISTIC2_0; + case BAHYPH: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BAHYPH; + case BARR: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BARR; + case BEERWARE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BEERWARE; + case BITTORRENT1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BITTORRENT1_0; + case BITTORRENT1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BITTORRENT1_1; + case BORCEUX: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BORCEUX; + case BSD1CLAUSE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD1CLAUSE; + case BSD2CLAUSEFREEBSD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEFREEBSD; + case BSD2CLAUSENETBSD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSENETBSD; + case BSD2CLAUSEPATENT: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEPATENT; + case BSD2CLAUSE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD2CLAUSE; + case BSD3CLAUSEATTRIBUTION: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSEATTRIBUTION; + case BSD3CLAUSECLEAR: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSECLEAR; + case BSD3CLAUSELBNL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSELBNL; + case BSD3CLAUSENONUCLEARLICENSE2014: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE2014; + case BSD3CLAUSENONUCLEARLICENSE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE; + case BSD3CLAUSENONUCLEARWARRANTY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARWARRANTY; + case BSD3CLAUSE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD3CLAUSE; + case BSD4CLAUSEUC: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD4CLAUSEUC; + case BSD4CLAUSE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSD4CLAUSE; + case BSDPROTECTION: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSDPROTECTION; + case BSDSOURCECODE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSDSOURCECODE; + case BSL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BSL1_0; + case BZIP21_0_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BZIP21_0_5; + case BZIP21_0_6: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.BZIP21_0_6; + case CALDERA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CALDERA; + case CATOSL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CATOSL1_1; + case CCBY1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY1_0; + case CCBY2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY2_0; + case CCBY2_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY2_5; + case CCBY3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY3_0; + case CCBY4_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBY4_0; + case CCBYNC1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC1_0; + case CCBYNC2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC2_0; + case CCBYNC2_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC2_5; + case CCBYNC3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC3_0; + case CCBYNC4_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNC4_0; + case CCBYNCND1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND1_0; + case CCBYNCND2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND2_0; + case CCBYNCND2_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND2_5; + case CCBYNCND3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND3_0; + case CCBYNCND4_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCND4_0; + case CCBYNCSA1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA1_0; + case CCBYNCSA2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_0; + case CCBYNCSA2_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_5; + case CCBYNCSA3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA3_0; + case CCBYNCSA4_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYNCSA4_0; + case CCBYND1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND1_0; + case CCBYND2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND2_0; + case CCBYND2_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND2_5; + case CCBYND3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND3_0; + case CCBYND4_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYND4_0; + case CCBYSA1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA1_0; + case CCBYSA2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA2_0; + case CCBYSA2_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA2_5; + case CCBYSA3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA3_0; + case CCBYSA4_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CCBYSA4_0; + case CC01_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CC01_0; + case CDDL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDDL1_0; + case CDDL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDDL1_1; + case CDLAPERMISSIVE1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDLAPERMISSIVE1_0; + case CDLASHARING1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CDLASHARING1_0; + case CECILL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL1_0; + case CECILL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL1_1; + case CECILL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL2_0; + case CECILL2_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILL2_1; + case CECILLB: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILLB; + case CECILLC: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CECILLC; + case CLARTISTIC: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CLARTISTIC; + case CNRIJYTHON: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CNRIJYTHON; + case CNRIPYTHONGPLCOMPATIBLE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CNRIPYTHONGPLCOMPATIBLE; + case CNRIPYTHON: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CNRIPYTHON; + case CONDOR1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CONDOR1_1; + case CPAL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CPAL1_0; + case CPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CPL1_0; + case CPOL1_02: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CPOL1_02; + case CROSSWORD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CROSSWORD; + case CRYSTALSTACKER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CRYSTALSTACKER; + case CUAOPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CUAOPL1_0; + case CUBE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CUBE; + case CURL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.CURL; + case DFSL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DFSL1_0; + case DIFFMARK: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DIFFMARK; + case DOC: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DOC; + case DOTSEQN: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DOTSEQN; + case DSDP: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DSDP; + case DVIPDFM: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.DVIPDFM; + case ECL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ECL1_0; + case ECL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ECL2_0; + case EFL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EFL1_0; + case EFL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EFL2_0; + case EGENIX: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EGENIX; + case ENTESSA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ENTESSA; + case EPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EPL1_0; + case EPL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EPL2_0; + case ERLPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ERLPL1_1; + case EUDATAGRID: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUDATAGRID; + case EUPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUPL1_0; + case EUPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUPL1_1; + case EUPL1_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUPL1_2; + case EUROSYM: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.EUROSYM; + case FAIR: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FAIR; + case FRAMEWORX1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FRAMEWORX1_0; + case FREEIMAGE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FREEIMAGE; + case FSFAP: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FSFAP; + case FSFUL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FSFUL; + case FSFULLR: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FSFULLR; + case FTL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.FTL; + case GFDL1_1ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_1ONLY; + case GFDL1_1ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_1ORLATER; + case GFDL1_2ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_2ONLY; + case GFDL1_2ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_2ORLATER; + case GFDL1_3ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_3ONLY; + case GFDL1_3ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GFDL1_3ORLATER; + case GIFTWARE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GIFTWARE; + case GL2PS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GL2PS; + case GLIDE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GLIDE; + case GLULXE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GLULXE; + case GNUPLOT: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GNUPLOT; + case GPL1_0ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL1_0ONLY; + case GPL1_0ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL1_0ORLATER; + case GPL2_0ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL2_0ONLY; + case GPL2_0ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL2_0ORLATER; + case GPL3_0ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL3_0ONLY; + case GPL3_0ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GPL3_0ORLATER; + case GSOAP1_3B: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.GSOAP1_3B; + case HASKELLREPORT: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.HASKELLREPORT; + case HPND: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.HPND; + case IBMPIBS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IBMPIBS; + case ICU: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ICU; + case IJG: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IJG; + case IMAGEMAGICK: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IMAGEMAGICK; + case IMATIX: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IMATIX; + case IMLIB2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IMLIB2; + case INFOZIP: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INFOZIP; + case INTELACPI: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INTELACPI; + case INTEL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INTEL; + case INTERBASE1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.INTERBASE1_0; + case IPA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IPA; + case IPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.IPL1_0; + case ISC: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ISC; + case JASPER2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.JASPER2_0; + case JSON: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.JSON; + case LAL1_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LAL1_2; + case LAL1_3: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LAL1_3; + case LATEX2E: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LATEX2E; + case LEPTONICA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LEPTONICA; + case LGPL2_0ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_0ONLY; + case LGPL2_0ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_0ORLATER; + case LGPL2_1ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_1ONLY; + case LGPL2_1ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL2_1ORLATER; + case LGPL3_0ONLY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL3_0ONLY; + case LGPL3_0ORLATER: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPL3_0ORLATER; + case LGPLLR: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LGPLLR; + case LIBPNG: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LIBPNG; + case LIBTIFF: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LIBTIFF; + case LILIQP1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LILIQP1_1; + case LILIQR1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LILIQR1_1; + case LILIQRPLUS1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LILIQRPLUS1_1; + case LINUXOPENIB: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LINUXOPENIB; + case LPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPL1_0; + case LPL1_02: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPL1_02; + case LPPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_0; + case LPPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_1; + case LPPL1_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_2; + case LPPL1_3A: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_3A; + case LPPL1_3C: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.LPPL1_3C; + case MAKEINDEX: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MAKEINDEX; + case MIROS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MIROS; + case MIT0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MIT0; + case MITADVERTISING: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITADVERTISING; + case MITCMU: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITCMU; + case MITENNA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITENNA; + case MITFEH: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITFEH; + case MIT: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MIT; + case MITNFA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MITNFA; + case MOTOSOTO: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MOTOSOTO; + case MPICH2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPICH2; + case MPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL1_0; + case MPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL1_1; + case MPL2_0NOCOPYLEFTEXCEPTION: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL2_0NOCOPYLEFTEXCEPTION; + case MPL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MPL2_0; + case MSPL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MSPL; + case MSRL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MSRL; + case MTLL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MTLL; + case MULTICS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MULTICS; + case MUP: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.MUP; + case NASA1_3: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NASA1_3; + case NAUMEN: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NAUMEN; + case NBPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NBPL1_0; + case NCSA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NCSA; + case NETSNMP: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NETSNMP; + case NETCDF: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NETCDF; + case NEWSLETR: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NEWSLETR; + case NGPL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NGPL; + case NLOD1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NLOD1_0; + case NLPL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NLPL; + case NOKIA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOKIA; + case NOSL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOSL; + case NOWEB: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NOWEB; + case NPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NPL1_0; + case NPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NPL1_1; + case NPOSL3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NPOSL3_0; + case NRL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NRL; + case NTP: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NTP; + case OCCTPL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OCCTPL; + case OCLC2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OCLC2_0; + case ODBL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ODBL1_0; + case OFL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OFL1_0; + case OFL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OFL1_1; + case OGTSL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OGTSL; + case OLDAP1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_1; + case OLDAP1_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_2; + case OLDAP1_3: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_3; + case OLDAP1_4: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP1_4; + case OLDAP2_0_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_0_1; + case OLDAP2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_0; + case OLDAP2_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_1; + case OLDAP2_2_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_2_1; + case OLDAP2_2_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_2_2; + case OLDAP2_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_2; + case OLDAP2_3: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_3; + case OLDAP2_4: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_4; + case OLDAP2_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_5; + case OLDAP2_6: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_6; + case OLDAP2_7: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_7; + case OLDAP2_8: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OLDAP2_8; + case OML: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OML; + case OPENSSL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OPENSSL; + case OPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OPL1_0; + case OSETPL2_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSETPL2_1; + case OSL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL1_0; + case OSL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL1_1; + case OSL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL2_0; + case OSL2_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL2_1; + case OSL3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.OSL3_0; + case PDDL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PDDL1_0; + case PHP3_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PHP3_0; + case PHP3_01: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PHP3_01; + case PLEXUS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PLEXUS; + case POSTGRESQL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.POSTGRESQL; + case PSFRAG: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PSFRAG; + case PSUTILS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PSUTILS; + case PYTHON2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.PYTHON2_0; + case QHULL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.QHULL; + case QPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.QPL1_0; + case RDISC: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RDISC; + case RHECOS1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RHECOS1_1; + case RPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RPL1_1; + case RPL1_5: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RPL1_5; + case RPSL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RPSL1_0; + case RSAMD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RSAMD; + case RSCPL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RSCPL; + case RUBY: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.RUBY; + case SAXPD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SAXPD; + case SAXPATH: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SAXPATH; + case SCEA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SCEA; + case SENDMAIL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SENDMAIL; + case SGIB1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SGIB1_0; + case SGIB1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SGIB1_1; + case SGIB2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SGIB2_0; + case SIMPL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SIMPL2_0; + case SISSL1_2: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SISSL1_2; + case SISSL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SISSL; + case SLEEPYCAT: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SLEEPYCAT; + case SMLNJ: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SMLNJ; + case SMPPL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SMPPL; + case SNIA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SNIA; + case SPENCER86: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPENCER86; + case SPENCER94: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPENCER94; + case SPENCER99: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPENCER99; + case SPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SPL1_0; + case SUGARCRM1_1_3: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SUGARCRM1_1_3; + case SWL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.SWL; + case TCL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TCL; + case TCPWRAPPERS: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TCPWRAPPERS; + case TMATE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TMATE; + case TORQUE1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TORQUE1_1; + case TOSL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.TOSL; + case UNICODEDFS2015: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNICODEDFS2015; + case UNICODEDFS2016: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNICODEDFS2016; + case UNICODETOU: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNICODETOU; + case UNLICENSE: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UNLICENSE; + case UPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.UPL1_0; + case VIM: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.VIM; + case VOSTROM: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.VOSTROM; + case VSL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.VSL1_0; + case W3C19980720: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.W3C19980720; + case W3C20150513: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.W3C20150513; + case W3C: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.W3C; + case WATCOM1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.WATCOM1_0; + case WSUIPA: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.WSUIPA; + case WTFPL: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.WTFPL; + case X11: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.X11; + case XEROX: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XEROX; + case XFREE861_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XFREE861_1; + case XINETD: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XINETD; + case XNET: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XNET; + case XPP: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XPP; + case XSKAT: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.XSKAT; + case YPL1_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.YPL1_0; + case YPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.YPL1_1; + case ZED: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZED; + case ZEND2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZEND2_0; + case ZIMBRA1_3: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZIMBRA1_3; + case ZIMBRA1_4: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZIMBRA1_4; + case ZLIBACKNOWLEDGEMENT: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZLIBACKNOWLEDGEMENT; + case ZLIB: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZLIB; + case ZPL1_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZPL1_1; + case ZPL2_0: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZPL2_0; + case ZPL2_1: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.ZPL2_1; + default: + return org.hl7.fhir.r4.model.ImplementationGuide.SPDXLicense.NULL; + } + } - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent convertImplementationGuideDefinitionResourceComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent(); - copyElement(src, tgt); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getFhirVersion()) - copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasExample()) - tgt.setExample(convertType(src.getExample())); - if (src.hasGroupingId()) - tgt.setGroupingIdElement(convertId(src.getGroupingIdElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent convertImplementationGuideDependsOnComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); + copyElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(convertCanonical(src.getUriElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(convertId(src.getPackageIdElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent convertImplementationGuideDefinitionResourceComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent(); - copyElement(src, tgt); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getFhirVersion()) - copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasExample()) - tgt.setExample(convertType(src.getExample())); - if (src.hasGroupingId()) - tgt.setGroupingIdElement(convertId(src.getGroupingIdElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent convertImplementationGuideDependsOnComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); + copyElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(convertCanonical(src.getUriElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(convertId(src.getPackageIdElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent convertImplementationGuideDefinitionPageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setName(convertType(src.getName())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasGeneration()) - tgt.setGeneration(convertGuidePageGeneration(src.getGeneration())); - for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) - tgt.addPage(convertImplementationGuideDefinitionPageComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent convertImplementationGuideDefinitionPageComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setName(convertType(src.getName())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasGeneration()) - tgt.setGeneration(convertGuidePageGeneration(src.getGeneration())); - for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) - tgt.addPage(convertImplementationGuideDefinitionPageComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration convertGuidePageGeneration(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case HTML: return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.HTML; - case MARKDOWN: return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.MARKDOWN; - case XML: return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.XML; - case GENERATED: return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.GENERATED; - default: return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.NULL; - } -} - - public static org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration convertGuidePageGeneration(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case HTML: return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.HTML; - case MARKDOWN: return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.MARKDOWN; - case XML: return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.XML; - case GENERATED: return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.GENERATED; - default: return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.NULL; - } -} - - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertString(src.getCodeElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertString(src.getCodeElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.utils.GuideParameterCode convertGuideParameterCode(org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPLY: return org.hl7.fhir.r5.utils.GuideParameterCode.APPLY; - case PATHRESOURCE: return org.hl7.fhir.r5.utils.GuideParameterCode.PATHRESOURCE; - case PATHPAGES: return org.hl7.fhir.r5.utils.GuideParameterCode.PATHPAGES; - case PATHTXCACHE: return org.hl7.fhir.r5.utils.GuideParameterCode.PATHTXCACHE; - case EXPANSIONPARAMETER: return org.hl7.fhir.r5.utils.GuideParameterCode.EXPANSIONPARAMETER; - case RULEBROKENLINKS: return org.hl7.fhir.r5.utils.GuideParameterCode.RULEBROKENLINKS; - case GENERATEXML: return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATEXML; - case GENERATEJSON: return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATEJSON; - case GENERATETURTLE: return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATETURTLE; - case HTMLTEMPLATE: return org.hl7.fhir.r5.utils.GuideParameterCode.HTMLTEMPLATE; - default: return org.hl7.fhir.r5.utils.GuideParameterCode.NULL; - } -} - - public static org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode convertGuideParameterCode(org.hl7.fhir.r5.utils.GuideParameterCode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPLY: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.APPLY; - case PATHRESOURCE: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.PATHRESOURCE; - case PATHPAGES: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.PATHPAGES; - case PATHTXCACHE: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.PATHTXCACHE; - case EXPANSIONPARAMETER: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.EXPANSIONPARAMETER; - case RULEBROKENLINKS: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.RULEBROKENLINKS; - case GENERATEXML: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.GENERATEXML; - case GENERATEJSON: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.GENERATEJSON; - case GENERATETURTLE: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.GENERATETURTLE; - case HTMLTEMPLATE: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.HTMLTEMPLATE; - default: return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.NULL; - } -} - - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent convertImplementationGuideDefinitionTemplateComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasSource()) - tgt.setSourceElement(convertString(src.getSourceElement())); - if (src.hasScope()) - tgt.setScopeElement(convertString(src.getScopeElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent convertImplementationGuideDefinitionTemplateComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasSource()) - tgt.setSourceElement(convertString(src.getSourceElement())); - if (src.hasScope()) - tgt.setScopeElement(convertString(src.getScopeElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent convertImplementationGuideManifestComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent(); - copyElement(src, tgt); - if (src.hasRendering()) - tgt.setRenderingElement(convertUrl(src.getRenderingElement())); - for (org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent t : src.getResource()) - tgt.addResource(convertManifestResourceComponent(t)); - for (org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent t : src.getPage()) - tgt.addPage(convertManifestPageComponent(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getImage()) - tgt.getImage().add(convertString(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getOther()) - tgt.getOther().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent convertImplementationGuideManifestComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent(); - copyElement(src, tgt); - if (src.hasRendering()) - tgt.setRenderingElement(convertUrl(src.getRenderingElement())); - for (org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent t : src.getResource()) - tgt.addResource(convertManifestResourceComponent(t)); - for (org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent t : src.getPage()) - tgt.addPage(convertManifestPageComponent(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getImage()) - tgt.getImage().add(convertString(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getOther()) - tgt.getOther().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent convertManifestResourceComponent(org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent(); - copyElement(src, tgt); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - if (src.hasExample()) - tgt.setExample(convertType(src.getExample())); - if (src.hasRelativePath()) - tgt.setRelativePathElement(convertUrl(src.getRelativePathElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent convertManifestResourceComponent(org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent(); - copyElement(src, tgt); - if (src.hasReference()) - tgt.setReference(convertReference(src.getReference())); - if (src.hasExample()) - tgt.setExample(convertType(src.getExample())); - if (src.hasRelativePath()) - tgt.setRelativePathElement(convertUrl(src.getRelativePathElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent convertManifestPageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getAnchor()) - tgt.getAnchor().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent convertManifestPageComponent(org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getAnchor()) - tgt.getAnchor().add(convertString(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent(); + copyElement(src, tgt); + if (src.hasGrouping()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getGrouping()) tgt.addGrouping(convertImplementationGuideDefinitionGroupingComponent(t)); + } + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuideDefinitionResourceComponent(t)); + } + if (src.hasPage()) + tgt.setPage(convertImplementationGuideDefinitionPageComponent(src.getPage())); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t)); + } + for (org.hl7.fhir.r4.model.Extension e : org.hl7.fhir.r4.utils.ToolingExtensions.getExtensions(src, EXT_IG_DEFINITION_PARAMETER)) { + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent p = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); + p.setCode(org.hl7.fhir.r4.utils.ToolingExtensions.readStringExtension(e, "code")); + p.setValue(org.hl7.fhir.r4.utils.ToolingExtensions.readStringExtension(e, "Value")); + tgt.addParameter(p); + } + if (src.hasTemplate()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent t : src.getTemplate()) tgt.addTemplate(convertImplementationGuideDefinitionTemplateComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent(); + copyElement(src, tgt); + if (src.hasGrouping()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getGrouping()) tgt.addGrouping(convertImplementationGuideDefinitionGroupingComponent(t)); + } + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuideDefinitionResourceComponent(t)); + } + if (src.hasPage()) + tgt.setPage(convertImplementationGuideDefinitionPageComponent(src.getPage())); + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent t : src.getParameter()) { + if (Utilities.existsInList(t.getCode(), "apply", "path-resource", "path-pages", "path-tx-cache", "expansion-parameter", "rule-broken-links", "generate-xml", "generate-json", "generate-turtle", "html-template")) + tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t)); + else { + org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(EXT_IG_DEFINITION_PARAMETER); + org.hl7.fhir.r4.model.Extension eCode = new org.hl7.fhir.r4.model.Extension("code", new org.hl7.fhir.r4.model.StringType(t.getCode())); + org.hl7.fhir.r4.model.Extension eValue = new org.hl7.fhir.r4.model.Extension("value", new org.hl7.fhir.r4.model.StringType(t.getValue())); + e.addExtension(eCode); + e.addExtension(eValue); + tgt.addExtension(e); + } + } + if (src.hasTemplate()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent t : src.getTemplate()) tgt.addTemplate(convertImplementationGuideDefinitionTemplateComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent convertImplementationGuideDefinitionGroupingComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent convertImplementationGuideDefinitionGroupingComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent convertImplementationGuideDefinitionResourceComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent(); + copyElement(src, tgt); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasFhirVersion()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getFhirVersion()) copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasExample()) + tgt.setExample(convertType(src.getExample())); + if (src.hasGroupingId()) + tgt.setGroupingIdElement(convertId(src.getGroupingIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent convertImplementationGuideDefinitionResourceComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent(); + copyElement(src, tgt); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasFhirVersion()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getFhirVersion()) copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasExample()) + tgt.setExample(convertType(src.getExample())); + if (src.hasGroupingId()) + tgt.setGroupingIdElement(convertId(src.getGroupingIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent convertImplementationGuideDefinitionPageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setName(convertType(src.getName())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasGeneration()) + tgt.setGeneration(convertGuidePageGeneration(src.getGeneration())); + if (src.hasPage()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuideDefinitionPageComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent convertImplementationGuideDefinitionPageComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setName(convertType(src.getName())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasGeneration()) + tgt.setGeneration(convertGuidePageGeneration(src.getGeneration())); + if (src.hasPage()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) tgt.addPage(convertImplementationGuideDefinitionPageComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration convertGuidePageGeneration(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case HTML: + return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.HTML; + case MARKDOWN: + return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.MARKDOWN; + case XML: + return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.XML; + case GENERATED: + return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.GENERATED; + default: + return org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.NULL; + } + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration convertGuidePageGeneration(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case HTML: + return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.HTML; + case MARKDOWN: + return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.MARKDOWN; + case XML: + return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.XML; + case GENERATED: + return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.GENERATED; + default: + return org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.NULL; + } + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertString(src.getCodeElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertString(src.getCodeElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.utils.GuideParameterCode convertGuideParameterCode(org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPLY: + return org.hl7.fhir.r5.utils.GuideParameterCode.APPLY; + case PATHRESOURCE: + return org.hl7.fhir.r5.utils.GuideParameterCode.PATHRESOURCE; + case PATHPAGES: + return org.hl7.fhir.r5.utils.GuideParameterCode.PATHPAGES; + case PATHTXCACHE: + return org.hl7.fhir.r5.utils.GuideParameterCode.PATHTXCACHE; + case EXPANSIONPARAMETER: + return org.hl7.fhir.r5.utils.GuideParameterCode.EXPANSIONPARAMETER; + case RULEBROKENLINKS: + return org.hl7.fhir.r5.utils.GuideParameterCode.RULEBROKENLINKS; + case GENERATEXML: + return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATEXML; + case GENERATEJSON: + return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATEJSON; + case GENERATETURTLE: + return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATETURTLE; + case HTMLTEMPLATE: + return org.hl7.fhir.r5.utils.GuideParameterCode.HTMLTEMPLATE; + default: + return org.hl7.fhir.r5.utils.GuideParameterCode.NULL; + } + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode convertGuideParameterCode(org.hl7.fhir.r5.utils.GuideParameterCode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPLY: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.APPLY; + case PATHRESOURCE: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.PATHRESOURCE; + case PATHPAGES: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.PATHPAGES; + case PATHTXCACHE: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.PATHTXCACHE; + case EXPANSIONPARAMETER: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.EXPANSIONPARAMETER; + case RULEBROKENLINKS: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.RULEBROKENLINKS; + case GENERATEXML: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.GENERATEXML; + case GENERATEJSON: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.GENERATEJSON; + case GENERATETURTLE: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.GENERATETURTLE; + case HTMLTEMPLATE: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.HTMLTEMPLATE; + default: + return org.hl7.fhir.r4.model.ImplementationGuide.GuideParameterCode.NULL; + } + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent convertImplementationGuideDefinitionTemplateComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasSource()) + tgt.setSourceElement(convertString(src.getSourceElement())); + if (src.hasScope()) + tgt.setScopeElement(convertString(src.getScopeElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent convertImplementationGuideDefinitionTemplateComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasSource()) + tgt.setSourceElement(convertString(src.getSourceElement())); + if (src.hasScope()) + tgt.setScopeElement(convertString(src.getScopeElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent convertImplementationGuideManifestComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent(); + copyElement(src, tgt); + if (src.hasRendering()) + tgt.setRenderingElement(convertUrl(src.getRenderingElement())); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent t : src.getResource()) tgt.addResource(convertManifestResourceComponent(t)); + } + if (src.hasPage()) { + for (org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent t : src.getPage()) tgt.addPage(convertManifestPageComponent(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.r4.model.StringType t : src.getImage()) tgt.getImage().add(convertString(t)); + } + if (src.hasOther()) { + for (org.hl7.fhir.r4.model.StringType t : src.getOther()) tgt.getOther().add(convertString(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent convertImplementationGuideManifestComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideManifestComponent(); + copyElement(src, tgt); + if (src.hasRendering()) + tgt.setRenderingElement(convertUrl(src.getRenderingElement())); + if (src.hasResource()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent t : src.getResource()) tgt.addResource(convertManifestResourceComponent(t)); + } + if (src.hasPage()) { + for (org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent t : src.getPage()) tgt.addPage(convertManifestPageComponent(t)); + } + if (src.hasImage()) { + for (org.hl7.fhir.r5.model.StringType t : src.getImage()) tgt.getImage().add(convertString(t)); + } + if (src.hasOther()) { + for (org.hl7.fhir.r5.model.StringType t : src.getOther()) tgt.getOther().add(convertString(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent convertManifestResourceComponent(org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent(); + copyElement(src, tgt); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasExample()) + tgt.setExample(convertType(src.getExample())); + if (src.hasRelativePath()) + tgt.setRelativePathElement(convertUrl(src.getRelativePathElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent convertManifestResourceComponent(org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ManifestResourceComponent(); + copyElement(src, tgt); + if (src.hasReference()) + tgt.setReference(convertReference(src.getReference())); + if (src.hasExample()) + tgt.setExample(convertType(src.getExample())); + if (src.hasRelativePath()) + tgt.setRelativePathElement(convertUrl(src.getRelativePathElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent convertManifestPageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasAnchor()) { + for (org.hl7.fhir.r4.model.StringType t : src.getAnchor()) tgt.getAnchor().add(convertString(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent convertManifestPageComponent(org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ManifestPageComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasAnchor()) { + for (org.hl7.fhir.r5.model.StringType t : src.getAnchor()) tgt.getAnchor().add(convertString(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/InsurancePlan.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/InsurancePlan.java index 45096ff81..380faf047 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/InsurancePlan.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/InsurancePlan.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,347 +50,384 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class InsurancePlan extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r4.model.InsurancePlan src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan tgt = new org.hl7.fhir.r5.model.InsurancePlan(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasOwnedBy()) - tgt.setOwnedBy(convertReference(src.getOwnedBy())); - if (src.hasAdministeredBy()) - tgt.setAdministeredBy(convertReference(src.getAdministeredBy())); - for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) - tgt.addCoverageArea(convertReference(t)); - for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent t : src.getContact()) - tgt.addContact(convertInsurancePlanContactComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage()) - tgt.addCoverage(convertInsurancePlanCoverageComponent(t)); - for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan()) - tgt.addPlan(convertInsurancePlanPlanComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r4.model.InsurancePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan tgt = new org.hl7.fhir.r5.model.InsurancePlan(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasOwnedBy()) + tgt.setOwnedBy(convertReference(src.getOwnedBy())); + if (src.hasAdministeredBy()) + tgt.setAdministeredBy(convertReference(src.getAdministeredBy())); + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(convertReference(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent t : src.getContact()) tgt.addContact(convertInsurancePlanContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + if (src.hasNetwork()) { + for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasCoverage()) { + for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage()) tgt.addCoverage(convertInsurancePlanCoverageComponent(t)); + } + if (src.hasPlan()) { + for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan()) tgt.addPlan(convertInsurancePlanPlanComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r5.model.InsurancePlan src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan tgt = new org.hl7.fhir.r4.model.InsurancePlan(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasOwnedBy()) - tgt.setOwnedBy(convertReference(src.getOwnedBy())); - if (src.hasAdministeredBy()) - tgt.setAdministeredBy(convertReference(src.getAdministeredBy())); - for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) - tgt.addCoverageArea(convertReference(t)); - for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent t : src.getContact()) - tgt.addContact(convertInsurancePlanContactComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage()) - tgt.addCoverage(convertInsurancePlanCoverageComponent(t)); - for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan()) - tgt.addPlan(convertInsurancePlanPlanComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r5.model.InsurancePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan tgt = new org.hl7.fhir.r4.model.InsurancePlan(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasOwnedBy()) + tgt.setOwnedBy(convertReference(src.getOwnedBy())); + if (src.hasAdministeredBy()) + tgt.setAdministeredBy(convertReference(src.getAdministeredBy())); + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(convertReference(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent t : src.getContact()) tgt.addContact(convertInsurancePlanContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + if (src.hasNetwork()) { + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasCoverage()) { + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage()) tgt.addCoverage(convertInsurancePlanCoverageComponent(t)); + } + if (src.hasPlan()) { + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan()) tgt.addPlan(convertInsurancePlanPlanComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent convertInsurancePlanContactComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent(); - copyElement(src, tgt); - if (src.hasPurpose()) - tgt.setPurpose(convertCodeableConcept(src.getPurpose())); - if (src.hasName()) - tgt.setName(convertHumanName(src.getName())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent convertInsurancePlanContactComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent(); + copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(convertHumanName(src.getName())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent convertInsurancePlanContactComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent(); - copyElement(src, tgt); - if (src.hasPurpose()) - tgt.setPurpose(convertCodeableConcept(src.getPurpose())); - if (src.hasName()) - tgt.setName(convertHumanName(src.getName())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent convertInsurancePlanContactComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent(); + copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(convertHumanName(src.getName())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit()) - tgt.addBenefit(convertCoverageBenefitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasNetwork()) { + for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasBenefit()) { + for (org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit()) tgt.addBenefit(convertCoverageBenefitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit()) - tgt.addBenefit(convertCoverageBenefitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasNetwork()) { + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasBenefit()) { + for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit()) tgt.addBenefit(convertCoverageBenefitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasRequirement()) - tgt.setRequirementElement(convertString(src.getRequirementElement())); - for (org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit()) - tgt.addLimit(convertCoverageBenefitLimitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRequirement()) + tgt.setRequirementElement(convertString(src.getRequirementElement())); + if (src.hasLimit()) { + for (org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit()) tgt.addLimit(convertCoverageBenefitLimitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasRequirement()) - tgt.setRequirementElement(convertString(src.getRequirementElement())); - for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit()) - tgt.addLimit(convertCoverageBenefitLimitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRequirement()) + tgt.setRequirementElement(convertString(src.getRequirementElement())); + if (src.hasLimit()) { + for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit()) tgt.addLimit(convertCoverageBenefitLimitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertQuantity(src.getValue())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertQuantity(src.getValue())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertQuantity(src.getValue())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertQuantity(src.getValue())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) - tgt.addCoverageArea(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost()) - tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t)); - for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost()) - tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(convertReference(t)); + } + if (src.hasNetwork()) { + for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasGeneralCost()) { + for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost()) tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t)); + } + if (src.hasSpecificCost()) { + for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost()) tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) - tgt.addCoverageArea(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost()) - tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t)); - for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost()) - tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCoverageArea()) { + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) tgt.addCoverageArea(convertReference(t)); + } + if (src.hasNetwork()) { + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasGeneralCost()) { + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost()) tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t)); + } + if (src.hasSpecificCost()) { + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost()) tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasGroupSize()) - tgt.setGroupSizeElement(convertPositiveInt(src.getGroupSizeElement())); - if (src.hasCost()) - tgt.setCost(convertMoney(src.getCost())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasGroupSize()) + tgt.setGroupSizeElement(convertPositiveInt(src.getGroupSizeElement())); + if (src.hasCost()) + tgt.setCost(convertMoney(src.getCost())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasGroupSize()) - tgt.setGroupSizeElement(convertPositiveInt(src.getGroupSizeElement())); - if (src.hasCost()) - tgt.setCost(convertMoney(src.getCost())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasGroupSize()) + tgt.setGroupSizeElement(convertPositiveInt(src.getGroupSizeElement())); + if (src.hasCost()) + tgt.setCost(convertMoney(src.getCost())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - for (org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit()) - tgt.addBenefit(convertPlanBenefitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasBenefit()) { + for (org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit()) tgt.addBenefit(convertPlanBenefitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit()) - tgt.addBenefit(convertPlanBenefitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasBenefit()) { + for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit()) tgt.addBenefit(convertPlanBenefitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost()) - tgt.addCost(convertPlanBenefitCostComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCost()) { + for (org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost()) tgt.addCost(convertPlanBenefitCostComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost()) - tgt.addCost(convertPlanBenefitCostComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasApplicability()) - tgt.setApplicability(convertCodeableConcept(src.getApplicability())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getQualifiers()) - tgt.addQualifiers(convertCodeableConcept(t)); - if (src.hasValue()) - tgt.setValue(convertQuantity(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasApplicability()) - tgt.setApplicability(convertCodeableConcept(src.getApplicability())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getQualifiers()) - tgt.addQualifiers(convertCodeableConcept(t)); - if (src.hasValue()) - tgt.setValue(convertQuantity(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCost()) { + for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost()) tgt.addCost(convertPlanBenefitCostComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasApplicability()) + tgt.setApplicability(convertCodeableConcept(src.getApplicability())); + if (src.hasQualifiers()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getQualifiers()) tgt.addQualifiers(convertCodeableConcept(t)); + } + if (src.hasValue()) + tgt.setValue(convertQuantity(src.getValue())); + return tgt; + } + public static org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasApplicability()) + tgt.setApplicability(convertCodeableConcept(src.getApplicability())); + if (src.hasQualifiers()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getQualifiers()) tgt.addQualifiers(convertCodeableConcept(t)); + } + if (src.hasValue()) + tgt.setValue(convertQuantity(src.getValue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Invoice.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Invoice.java index 0547dfe7c..ac383766c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Invoice.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Invoice.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,229 +50,262 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Invoice extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Invoice convertInvoice(org.hl7.fhir.r4.model.Invoice src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Invoice tgt = new org.hl7.fhir.r5.model.Invoice(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertInvoiceStatus(src.getStatus())); - if (src.hasCancelledReason()) - tgt.setCancelledReasonElement(convertString(src.getCancelledReasonElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasRecipient()) - tgt.setRecipient(convertReference(src.getRecipient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - for (org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertInvoiceParticipantComponent(t)); - if (src.hasIssuer()) - tgt.setIssuer(convertReference(src.getIssuer())); - if (src.hasAccount()) - tgt.setAccount(convertReference(src.getAccount())); - for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent t : src.getLineItem()) - tgt.addLineItem(convertInvoiceLineItemComponent(t)); - for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent()) - tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); - if (src.hasTotalNet()) - tgt.setTotalNet(convertMoney(src.getTotalNet())); - if (src.hasTotalGross()) - tgt.setTotalGross(convertMoney(src.getTotalGross())); - if (src.hasPaymentTerms()) - tgt.setPaymentTermsElement(convertMarkdown(src.getPaymentTermsElement())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Invoice convertInvoice(org.hl7.fhir.r5.model.Invoice src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Invoice tgt = new org.hl7.fhir.r4.model.Invoice(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertInvoiceStatus(src.getStatus())); - if (src.hasCancelledReason()) - tgt.setCancelledReasonElement(convertString(src.getCancelledReasonElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasRecipient()) - tgt.setRecipient(convertReference(src.getRecipient())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - for (org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertInvoiceParticipantComponent(t)); - if (src.hasIssuer()) - tgt.setIssuer(convertReference(src.getIssuer())); - if (src.hasAccount()) - tgt.setAccount(convertReference(src.getAccount())); - for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent t : src.getLineItem()) - tgt.addLineItem(convertInvoiceLineItemComponent(t)); - for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent()) - tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); - if (src.hasTotalNet()) - tgt.setTotalNet(convertMoney(src.getTotalNet())); - if (src.hasTotalGross()) - tgt.setTotalGross(convertMoney(src.getTotalGross())); - if (src.hasPaymentTerms()) - tgt.setPaymentTermsElement(convertMarkdown(src.getPaymentTermsElement())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Invoice.InvoiceStatus convertInvoiceStatus(org.hl7.fhir.r4.model.Invoice.InvoiceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.DRAFT; - case ISSUED: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ISSUED; - case BALANCED: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.BALANCED; - case CANCELLED: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Invoice.InvoiceStatus convertInvoiceStatus(org.hl7.fhir.r5.model.Invoice.InvoiceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.DRAFT; - case ISSUED: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ISSUED; - case BALANCED: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.BALANCED; - case CANCELLED: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent(); - copyElement(src, tgt); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent(); - copyElement(src, tgt); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasChargeItem()) - tgt.setChargeItem(convertType(src.getChargeItem())); - for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent()) - tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent(); - copyElement(src, tgt); - if (src.hasSequence()) - tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); - if (src.hasChargeItem()) - tgt.setChargeItem(convertType(src.getChargeItem())); - for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent()) - tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertInvoicePriceComponentType(src.getType())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertInvoicePriceComponentType(src.getType())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasFactor()) - tgt.setFactorElement(convertDecimal(src.getFactorElement())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType convertInvoicePriceComponentType(org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BASE: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.BASE; - case SURCHARGE: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.SURCHARGE; - case DEDUCTION: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DEDUCTION; - case DISCOUNT: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DISCOUNT; - case TAX: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.TAX; - case INFORMATIONAL: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL; - default: return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType convertInvoicePriceComponentType(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BASE: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.BASE; - case SURCHARGE: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.SURCHARGE; - case DEDUCTION: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.DEDUCTION; - case DISCOUNT: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.DISCOUNT; - case TAX: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.TAX; - case INFORMATIONAL: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.INFORMATIONAL; - default: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.NULL; - } -} + public static org.hl7.fhir.r5.model.Invoice convertInvoice(org.hl7.fhir.r4.model.Invoice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice tgt = new org.hl7.fhir.r5.model.Invoice(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertInvoiceStatus(src.getStatus())); + if (src.hasCancelledReason()) + tgt.setCancelledReasonElement(convertString(src.getCancelledReasonElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasRecipient()) + tgt.setRecipient(convertReference(src.getRecipient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertInvoiceParticipantComponent(t)); + } + if (src.hasIssuer()) + tgt.setIssuer(convertReference(src.getIssuer())); + if (src.hasAccount()) + tgt.setAccount(convertReference(src.getAccount())); + if (src.hasLineItem()) { + for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent t : src.getLineItem()) tgt.addLineItem(convertInvoiceLineItemComponent(t)); + } + if (src.hasTotalPriceComponent()) { + for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent()) tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + } + if (src.hasTotalNet()) + tgt.setTotalNet(convertMoney(src.getTotalNet())); + if (src.hasTotalGross()) + tgt.setTotalGross(convertMoney(src.getTotalGross())); + if (src.hasPaymentTerms()) + tgt.setPaymentTermsElement(convertMarkdown(src.getPaymentTermsElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Invoice convertInvoice(org.hl7.fhir.r5.model.Invoice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Invoice tgt = new org.hl7.fhir.r4.model.Invoice(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertInvoiceStatus(src.getStatus())); + if (src.hasCancelledReason()) + tgt.setCancelledReasonElement(convertString(src.getCancelledReasonElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasRecipient()) + tgt.setRecipient(convertReference(src.getRecipient())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertInvoiceParticipantComponent(t)); + } + if (src.hasIssuer()) + tgt.setIssuer(convertReference(src.getIssuer())); + if (src.hasAccount()) + tgt.setAccount(convertReference(src.getAccount())); + if (src.hasLineItem()) { + for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent t : src.getLineItem()) tgt.addLineItem(convertInvoiceLineItemComponent(t)); + } + if (src.hasTotalPriceComponent()) { + for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent()) tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + } + if (src.hasTotalNet()) + tgt.setTotalNet(convertMoney(src.getTotalNet())); + if (src.hasTotalGross()) + tgt.setTotalGross(convertMoney(src.getTotalGross())); + if (src.hasPaymentTerms()) + tgt.setPaymentTermsElement(convertMarkdown(src.getPaymentTermsElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Invoice.InvoiceStatus convertInvoiceStatus(org.hl7.fhir.r4.model.Invoice.InvoiceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.DRAFT; + case ISSUED: + return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ISSUED; + case BALANCED: + return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.BALANCED; + case CANCELLED: + return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Invoice.InvoiceStatus convertInvoiceStatus(org.hl7.fhir.r5.model.Invoice.InvoiceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.DRAFT; + case ISSUED: + return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ISSUED; + case BALANCED: + return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.BALANCED; + case CANCELLED: + return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent(); + copyElement(src, tgt); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent(); + copyElement(src, tgt); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasChargeItem()) + tgt.setChargeItem(convertType(src.getChargeItem())); + if (src.hasPriceComponent()) { + for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent()) tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent(); + copyElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement())); + if (src.hasChargeItem()) + tgt.setChargeItem(convertType(src.getChargeItem())); + if (src.hasPriceComponent()) { + for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent()) tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertInvoicePriceComponentType(src.getType())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertInvoicePriceComponentType(src.getType())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType convertInvoicePriceComponentType(org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BASE: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.BASE; + case SURCHARGE: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.SURCHARGE; + case DEDUCTION: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DEDUCTION; + case DISCOUNT: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DISCOUNT; + case TAX: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.TAX; + case INFORMATIONAL: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL; + default: + return org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType convertInvoicePriceComponentType(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BASE: + return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.BASE; + case SURCHARGE: + return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.SURCHARGE; + case DEDUCTION: + return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.DEDUCTION; + case DISCOUNT: + return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.DISCOUNT; + case TAX: + return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.TAX; + case INFORMATIONAL: + return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.INFORMATIONAL; + default: + return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Library.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Library.java index a7491a6a1..d1a6dca19 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Library.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Library.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,151 +50,172 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Library extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Library convertLibrary(org.hl7.fhir.r4.model.Library src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Library tgt = new org.hl7.fhir.r5.model.Library(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.ParameterDefinition t : src.getParameter()) - tgt.addParameter(convertParameterDefinition(t)); - for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement()) - tgt.addDataRequirement(convertDataRequirement(t)); - for (org.hl7.fhir.r4.model.Attachment t : src.getContent()) - tgt.addContent(convertAttachment(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Library convertLibrary(org.hl7.fhir.r5.model.Library src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Library tgt = new org.hl7.fhir.r4.model.Library(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.ParameterDefinition t : src.getParameter()) - tgt.addParameter(convertParameterDefinition(t)); - for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) - tgt.addDataRequirement(convertDataRequirement(t)); - for (org.hl7.fhir.r5.model.Attachment t : src.getContent()) - tgt.addContent(convertAttachment(t)); - return tgt; - } - + public static org.hl7.fhir.r5.model.Library convertLibrary(org.hl7.fhir.r4.model.Library src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Library tgt = new org.hl7.fhir.r5.model.Library(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(convertParameterDefinition(t)); + } + if (src.hasDataRequirement()) { + for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(convertDataRequirement(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getContent()) tgt.addContent(convertAttachment(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Library convertLibrary(org.hl7.fhir.r5.model.Library src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Library tgt = new org.hl7.fhir.r4.model.Library(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.ParameterDefinition t : src.getParameter()) tgt.addParameter(convertParameterDefinition(t)); + } + if (src.hasDataRequirement()) { + for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(convertDataRequirement(t)); + } + if (src.hasContent()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getContent()) tgt.addContent(convertAttachment(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Linkage.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Linkage.java index 7bfbb1632..3e7a6220f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Linkage.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Linkage.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,85 +50,90 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Linkage extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Linkage convertLinkage(org.hl7.fhir.r4.model.Linkage src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Linkage tgt = new org.hl7.fhir.r5.model.Linkage(); - copyDomainResource(src, tgt); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (org.hl7.fhir.r4.model.Linkage.LinkageItemComponent t : src.getItem()) - tgt.addItem(convertLinkageItemComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Linkage convertLinkage(org.hl7.fhir.r4.model.Linkage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Linkage tgt = new org.hl7.fhir.r5.model.Linkage(); + copyDomainResource(src, tgt); + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Linkage convertLinkage(org.hl7.fhir.r5.model.Linkage src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Linkage tgt = new org.hl7.fhir.r4.model.Linkage(); - copyDomainResource(src, tgt); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (org.hl7.fhir.r5.model.Linkage.LinkageItemComponent t : src.getItem()) - tgt.addItem(convertLinkageItemComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Linkage convertLinkage(org.hl7.fhir.r5.model.Linkage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Linkage tgt = new org.hl7.fhir.r4.model.Linkage(); + copyDomainResource(src, tgt); + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Linkage.LinkageItemComponent t : src.getItem()) tgt.addItem(convertLinkageItemComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r4.model.Linkage.LinkageItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r5.model.Linkage.LinkageItemComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertLinkageType(src.getType())); - if (src.hasResource()) - tgt.setResource(convertReference(src.getResource())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r5.model.Linkage.LinkageItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r4.model.Linkage.LinkageItemComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertLinkageType(src.getType())); - if (src.hasResource()) - tgt.setResource(convertReference(src.getResource())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Linkage.LinkageType convertLinkageType(org.hl7.fhir.r4.model.Linkage.LinkageType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SOURCE: return org.hl7.fhir.r5.model.Linkage.LinkageType.SOURCE; - case ALTERNATE: return org.hl7.fhir.r5.model.Linkage.LinkageType.ALTERNATE; - case HISTORICAL: return org.hl7.fhir.r5.model.Linkage.LinkageType.HISTORICAL; - default: return org.hl7.fhir.r5.model.Linkage.LinkageType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Linkage.LinkageType convertLinkageType(org.hl7.fhir.r5.model.Linkage.LinkageType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SOURCE: return org.hl7.fhir.r4.model.Linkage.LinkageType.SOURCE; - case ALTERNATE: return org.hl7.fhir.r4.model.Linkage.LinkageType.ALTERNATE; - case HISTORICAL: return org.hl7.fhir.r4.model.Linkage.LinkageType.HISTORICAL; - default: return org.hl7.fhir.r4.model.Linkage.LinkageType.NULL; - } -} + public static org.hl7.fhir.r5.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r4.model.Linkage.LinkageItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r5.model.Linkage.LinkageItemComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertLinkageType(src.getType())); + if (src.hasResource()) + tgt.setResource(convertReference(src.getResource())); + return tgt; + } + public static org.hl7.fhir.r4.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r5.model.Linkage.LinkageItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r4.model.Linkage.LinkageItemComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertLinkageType(src.getType())); + if (src.hasResource()) + tgt.setResource(convertReference(src.getResource())); + return tgt; + } + public static org.hl7.fhir.r5.model.Linkage.LinkageType convertLinkageType(org.hl7.fhir.r4.model.Linkage.LinkageType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SOURCE: + return org.hl7.fhir.r5.model.Linkage.LinkageType.SOURCE; + case ALTERNATE: + return org.hl7.fhir.r5.model.Linkage.LinkageType.ALTERNATE; + case HISTORICAL: + return org.hl7.fhir.r5.model.Linkage.LinkageType.HISTORICAL; + default: + return org.hl7.fhir.r5.model.Linkage.LinkageType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Linkage.LinkageType convertLinkageType(org.hl7.fhir.r5.model.Linkage.LinkageType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SOURCE: + return org.hl7.fhir.r4.model.Linkage.LinkageType.SOURCE; + case ALTERNATE: + return org.hl7.fhir.r4.model.Linkage.LinkageType.ALTERNATE; + case HISTORICAL: + return org.hl7.fhir.r4.model.Linkage.LinkageType.HISTORICAL; + default: + return org.hl7.fhir.r4.model.Linkage.LinkageType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ListResource.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ListResource.java index f86215318..0c52ba7d4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ListResource.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ListResource.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,155 +50,172 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ListResource extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ListResource convertListResource(org.hl7.fhir.r4.model.ListResource src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ListResource tgt = new org.hl7.fhir.r5.model.ListResource(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertListStatus(src.getStatus())); - if (src.hasMode()) - tgt.setMode(convertListMode(src.getMode())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasOrderedBy()) - tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.ListResource.ListEntryComponent t : src.getEntry()) - tgt.addEntry(convertListEntryComponent(t)); - if (src.hasEmptyReason()) - tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ListResource convertListResource(org.hl7.fhir.r5.model.ListResource src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ListResource tgt = new org.hl7.fhir.r4.model.ListResource(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertListStatus(src.getStatus())); - if (src.hasMode()) - tgt.setMode(convertListMode(src.getMode())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - if (src.hasOrderedBy()) - tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent t : src.getEntry()) - tgt.addEntry(convertListEntryComponent(t)); - if (src.hasEmptyReason()) - tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ListResource.ListStatus convertListStatus(org.hl7.fhir.r4.model.ListResource.ListStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CURRENT: return org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT; - case RETIRED: return org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.ListResource.ListStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ListResource.ListStatus convertListStatus(org.hl7.fhir.r5.model.ListResource.ListStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CURRENT: return org.hl7.fhir.r4.model.ListResource.ListStatus.CURRENT; - case RETIRED: return org.hl7.fhir.r4.model.ListResource.ListStatus.RETIRED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ListResource.ListStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.ListResource.ListStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ListMode convertListMode(org.hl7.fhir.r4.model.ListResource.ListMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case WORKING: return org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING; - case SNAPSHOT: return org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT; - case CHANGES: return org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES; - default: return org.hl7.fhir.r5.model.Enumerations.ListMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.ListResource.ListMode convertListMode(org.hl7.fhir.r5.model.Enumerations.ListMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case WORKING: return org.hl7.fhir.r4.model.ListResource.ListMode.WORKING; - case SNAPSHOT: return org.hl7.fhir.r4.model.ListResource.ListMode.SNAPSHOT; - case CHANGES: return org.hl7.fhir.r4.model.ListResource.ListMode.CHANGES; - default: return org.hl7.fhir.r4.model.ListResource.ListMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent convertListEntryComponent(org.hl7.fhir.r4.model.ListResource.ListEntryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent tgt = new org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent(); - copyElement(src, tgt); - if (src.hasFlag()) - tgt.setFlag(convertCodeableConcept(src.getFlag())); - if (src.hasDeleted()) - tgt.setDeletedElement(convertBoolean(src.getDeletedElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasItem()) - tgt.setItem(convertReference(src.getItem())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ListResource.ListEntryComponent convertListEntryComponent(org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ListResource.ListEntryComponent tgt = new org.hl7.fhir.r4.model.ListResource.ListEntryComponent(); - copyElement(src, tgt); - if (src.hasFlag()) - tgt.setFlag(convertCodeableConcept(src.getFlag())); - if (src.hasDeleted()) - tgt.setDeletedElement(convertBoolean(src.getDeletedElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasItem()) - tgt.setItem(convertReference(src.getItem())); - return tgt; - } + public static org.hl7.fhir.r5.model.ListResource convertListResource(org.hl7.fhir.r4.model.ListResource src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ListResource tgt = new org.hl7.fhir.r5.model.ListResource(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasMode()) + tgt.setMode(convertListMode(src.getMode())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r4.model.ListResource.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + } + if (src.hasEmptyReason()) + tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); + return tgt; + } + public static org.hl7.fhir.r4.model.ListResource convertListResource(org.hl7.fhir.r5.model.ListResource src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ListResource tgt = new org.hl7.fhir.r4.model.ListResource(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertListStatus(src.getStatus())); + if (src.hasMode()) + tgt.setMode(convertListMode(src.getMode())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasEntry()) { + for (org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntryComponent(t)); + } + if (src.hasEmptyReason()) + tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason())); + return tgt; + } + public static org.hl7.fhir.r5.model.ListResource.ListStatus convertListStatus(org.hl7.fhir.r4.model.ListResource.ListStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CURRENT: + return org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT; + case RETIRED: + return org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.ListResource.ListStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ListResource.ListStatus convertListStatus(org.hl7.fhir.r5.model.ListResource.ListStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CURRENT: + return org.hl7.fhir.r4.model.ListResource.ListStatus.CURRENT; + case RETIRED: + return org.hl7.fhir.r4.model.ListResource.ListStatus.RETIRED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ListResource.ListStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.ListResource.ListStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ListMode convertListMode(org.hl7.fhir.r4.model.ListResource.ListMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case WORKING: + return org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING; + case SNAPSHOT: + return org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT; + case CHANGES: + return org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES; + default: + return org.hl7.fhir.r5.model.Enumerations.ListMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.ListResource.ListMode convertListMode(org.hl7.fhir.r5.model.Enumerations.ListMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case WORKING: + return org.hl7.fhir.r4.model.ListResource.ListMode.WORKING; + case SNAPSHOT: + return org.hl7.fhir.r4.model.ListResource.ListMode.SNAPSHOT; + case CHANGES: + return org.hl7.fhir.r4.model.ListResource.ListMode.CHANGES; + default: + return org.hl7.fhir.r4.model.ListResource.ListMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent convertListEntryComponent(org.hl7.fhir.r4.model.ListResource.ListEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent tgt = new org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent(); + copyElement(src, tgt); + if (src.hasFlag()) + tgt.setFlag(convertCodeableConcept(src.getFlag())); + if (src.hasDeleted()) + tgt.setDeletedElement(convertBoolean(src.getDeletedElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasItem()) + tgt.setItem(convertReference(src.getItem())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ListResource.ListEntryComponent convertListEntryComponent(org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ListResource.ListEntryComponent tgt = new org.hl7.fhir.r4.model.ListResource.ListEntryComponent(); + copyElement(src, tgt); + if (src.hasFlag()) + tgt.setFlag(convertCodeableConcept(src.getFlag())); + if (src.hasDeleted()) + tgt.setDeletedElement(convertBoolean(src.getDeletedElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasItem()) + tgt.setItem(convertReference(src.getItem())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java index 01a050d11..80ae14db3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,227 +50,266 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Location extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Location convertLocation(org.hl7.fhir.r4.model.Location src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Location tgt = new org.hl7.fhir.r5.model.Location(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertLocationStatus(src.getStatus())); - if (src.hasOperationalStatus()) - tgt.setOperationalStatus(convertCoding(src.getOperationalStatus())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasMode()) - tgt.setMode(convertLocationMode(src.getMode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - if (src.hasPhysicalType()) - tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); - if (src.hasPosition()) - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - for (org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation()) - tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t)); - if (src.hasAvailabilityExceptions()) - tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Location convertLocation(org.hl7.fhir.r5.model.Location src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Location tgt = new org.hl7.fhir.r4.model.Location(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertLocationStatus(src.getStatus())); - if (src.hasOperationalStatus()) - tgt.setOperationalStatus(convertCoding(src.getOperationalStatus())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasMode()) - tgt.setMode(convertLocationMode(src.getMode())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - if (src.hasPhysicalType()) - tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); - if (src.hasPosition()) - tgt.setPosition(convertLocationPositionComponent(src.getPosition())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - for (org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation()) - tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t)); - if (src.hasAvailabilityExceptions()) - tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Location.LocationStatus convertLocationStatus(org.hl7.fhir.r4.model.Location.LocationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED; - case INACTIVE: return org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE; - default: return org.hl7.fhir.r5.model.Location.LocationStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Location.LocationStatus convertLocationStatus(org.hl7.fhir.r5.model.Location.LocationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Location.LocationStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r4.model.Location.LocationStatus.SUSPENDED; - case INACTIVE: return org.hl7.fhir.r4.model.Location.LocationStatus.INACTIVE; - default: return org.hl7.fhir.r4.model.Location.LocationStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Location.LocationMode convertLocationMode(org.hl7.fhir.r4.model.Location.LocationMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE; - case KIND: return org.hl7.fhir.r5.model.Location.LocationMode.KIND; - default: return org.hl7.fhir.r5.model.Location.LocationMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.Location.LocationMode convertLocationMode(org.hl7.fhir.r5.model.Location.LocationMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r4.model.Location.LocationMode.INSTANCE; - case KIND: return org.hl7.fhir.r4.model.Location.LocationMode.KIND; - default: return org.hl7.fhir.r4.model.Location.LocationMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r4.model.Location.LocationPositionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r5.model.Location.LocationPositionComponent(); - copyElement(src, tgt); - if (src.hasLongitude()) - tgt.setLongitudeElement(convertDecimal(src.getLongitudeElement())); - if (src.hasLatitude()) - tgt.setLatitudeElement(convertDecimal(src.getLatitudeElement())); - if (src.hasAltitude()) - tgt.setAltitudeElement(convertDecimal(src.getAltitudeElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r5.model.Location.LocationPositionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r4.model.Location.LocationPositionComponent(); - copyElement(src, tgt); - if (src.hasLongitude()) - tgt.setLongitudeElement(convertDecimal(src.getLongitudeElement())); - if (src.hasLatitude()) - tgt.setLatitudeElement(convertDecimal(src.getLatitudeElement())); - if (src.hasAltitude()) - tgt.setAltitudeElement(convertDecimal(src.getAltitudeElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - if (src.hasAllDay()) - tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); - if (src.hasOpeningTime()) - tgt.setOpeningTimeElement(convertTime(src.getOpeningTimeElement())); - if (src.hasClosingTime()) - tgt.setClosingTimeElement(convertTime(src.getClosingTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - if (src.hasAllDay()) - tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); - if (src.hasOpeningTime()) - tgt.setOpeningTimeElement(convertTime(src.getOpeningTimeElement())); - if (src.hasClosingTime()) - tgt.setClosingTimeElement(convertTime(src.getClosingTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.Location.DaysOfWeek src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MON: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON; - case TUE: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE; - case WED: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED; - case THU: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU; - case FRI: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI; - case SAT: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT; - case SUN: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN; - default: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL; - } -} - - public static org.hl7.fhir.r4.model.Location.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MON: return org.hl7.fhir.r4.model.Location.DaysOfWeek.MON; - case TUE: return org.hl7.fhir.r4.model.Location.DaysOfWeek.TUE; - case WED: return org.hl7.fhir.r4.model.Location.DaysOfWeek.WED; - case THU: return org.hl7.fhir.r4.model.Location.DaysOfWeek.THU; - case FRI: return org.hl7.fhir.r4.model.Location.DaysOfWeek.FRI; - case SAT: return org.hl7.fhir.r4.model.Location.DaysOfWeek.SAT; - case SUN: return org.hl7.fhir.r4.model.Location.DaysOfWeek.SUN; - default: return org.hl7.fhir.r4.model.Location.DaysOfWeek.NULL; - } -} + public static org.hl7.fhir.r5.model.Location convertLocation(org.hl7.fhir.r4.model.Location src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Location tgt = new org.hl7.fhir.r5.model.Location(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertLocationStatus(src.getStatus())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatus(convertCoding(src.getOperationalStatus())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasMode()) + tgt.setMode(convertLocationMode(src.getMode())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); + if (src.hasPosition()) + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + if (src.hasHoursOfOperation()) { + for (org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation()) tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t)); + } + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Location convertLocation(org.hl7.fhir.r5.model.Location src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Location tgt = new org.hl7.fhir.r4.model.Location(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertLocationStatus(src.getStatus())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatus(convertCoding(src.getOperationalStatus())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasMode()) + tgt.setMode(convertLocationMode(src.getMode())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType())); + if (src.hasPosition()) + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + if (src.hasHoursOfOperation()) { + for (org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation()) tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t)); + } + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Location.LocationStatus convertLocationStatus(org.hl7.fhir.r4.model.Location.LocationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED; + case INACTIVE: + return org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE; + default: + return org.hl7.fhir.r5.model.Location.LocationStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Location.LocationStatus convertLocationStatus(org.hl7.fhir.r5.model.Location.LocationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Location.LocationStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r4.model.Location.LocationStatus.SUSPENDED; + case INACTIVE: + return org.hl7.fhir.r4.model.Location.LocationStatus.INACTIVE; + default: + return org.hl7.fhir.r4.model.Location.LocationStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Location.LocationMode convertLocationMode(org.hl7.fhir.r4.model.Location.LocationMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE; + case KIND: + return org.hl7.fhir.r5.model.Location.LocationMode.KIND; + default: + return org.hl7.fhir.r5.model.Location.LocationMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.Location.LocationMode convertLocationMode(org.hl7.fhir.r5.model.Location.LocationMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r4.model.Location.LocationMode.INSTANCE; + case KIND: + return org.hl7.fhir.r4.model.Location.LocationMode.KIND; + default: + return org.hl7.fhir.r4.model.Location.LocationMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r4.model.Location.LocationPositionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r5.model.Location.LocationPositionComponent(); + copyElement(src, tgt); + if (src.hasLongitude()) + tgt.setLongitudeElement(convertDecimal(src.getLongitudeElement())); + if (src.hasLatitude()) + tgt.setLatitudeElement(convertDecimal(src.getLatitudeElement())); + if (src.hasAltitude()) + tgt.setAltitudeElement(convertDecimal(src.getAltitudeElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r5.model.Location.LocationPositionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r4.model.Location.LocationPositionComponent(); + copyElement(src, tgt); + if (src.hasLongitude()) + tgt.setLongitudeElement(convertDecimal(src.getLongitudeElement())); + if (src.hasLatitude()) + tgt.setLatitudeElement(convertDecimal(src.getLatitudeElement())); + if (src.hasAltitude()) + tgt.setAltitudeElement(convertDecimal(src.getAltitudeElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent(); + copyElement(src, tgt); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) + tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); + if (src.hasOpeningTime()) + tgt.setOpeningTimeElement(convertTime(src.getOpeningTimeElement())); + if (src.hasClosingTime()) + tgt.setClosingTimeElement(convertTime(src.getClosingTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent(); + copyElement(src, tgt); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) + tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); + if (src.hasOpeningTime()) + tgt.setOpeningTimeElement(convertTime(src.getOpeningTimeElement())); + if (src.hasClosingTime()) + tgt.setClosingTimeElement(convertTime(src.getClosingTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.Location.DaysOfWeek src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MON: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON; + case TUE: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE; + case WED: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED; + case THU: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU; + case FRI: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI; + case SAT: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT; + case SUN: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN; + default: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL; + } + } + + public static org.hl7.fhir.r4.model.Location.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MON: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.MON; + case TUE: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.TUE; + case WED: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.WED; + case THU: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.THU; + case FRI: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.FRI; + case SAT: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.SAT; + case SUN: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.SUN; + default: + return org.hl7.fhir.r4.model.Location.DaysOfWeek.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Measure.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Measure.java index 21f88c8fb..8d78bb49a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Measure.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Measure.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,343 +50,376 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Measure extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Measure convertMeasure(org.hl7.fhir.r4.model.Measure src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Measure tgt = new org.hl7.fhir.r5.model.Measure(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) - tgt.getLibrary().add(convertCanonical(t)); - if (src.hasDisclaimer()) - tgt.setDisclaimerElement(convertMarkdown(src.getDisclaimerElement())); - if (src.hasScoring()) - tgt.setScoring(convertCodeableConcept(src.getScoring())); - if (src.hasCompositeScoring()) - tgt.setCompositeScoring(convertCodeableConcept(src.getCompositeScoring())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasRiskAdjustment()) - tgt.setRiskAdjustmentElement(convertString(src.getRiskAdjustmentElement())); - if (src.hasRateAggregation()) - tgt.setRateAggregationElement(convertString(src.getRateAggregationElement())); - if (src.hasRationale()) - tgt.setRationaleElement(convertMarkdown(src.getRationaleElement())); - if (src.hasClinicalRecommendationStatement()) - tgt.setClinicalRecommendationStatementElement(convertMarkdown(src.getClinicalRecommendationStatementElement())); - if (src.hasImprovementNotation()) - tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); - for (org.hl7.fhir.r4.model.MarkdownType t : src.getDefinition()) - tgt.getDefinition().add(convertMarkdown(t)); - if (src.hasGuidance()) - tgt.setGuidanceElement(convertMarkdown(src.getGuidanceElement())); - for (org.hl7.fhir.r4.model.Measure.MeasureGroupComponent t : src.getGroup()) - tgt.addGroup(convertMeasureGroupComponent(t)); - for (org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData()) - tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Measure convertMeasure(org.hl7.fhir.r4.model.Measure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure tgt = new org.hl7.fhir.r5.model.Measure(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t)); + } + if (src.hasDisclaimer()) + tgt.setDisclaimerElement(convertMarkdown(src.getDisclaimerElement())); + if (src.hasScoring()) + tgt.setScoring(convertCodeableConcept(src.getScoring())); + if (src.hasCompositeScoring()) + tgt.setCompositeScoring(convertCodeableConcept(src.getCompositeScoring())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasRiskAdjustment()) + tgt.setRiskAdjustmentElement(convertString(src.getRiskAdjustmentElement())); + if (src.hasRateAggregation()) + tgt.setRateAggregationElement(convertString(src.getRateAggregationElement())); + if (src.hasRationale()) + tgt.setRationaleElement(convertMarkdown(src.getRationaleElement())); + if (src.hasClinicalRecommendationStatement()) + tgt.setClinicalRecommendationStatementElement(convertMarkdown(src.getClinicalRecommendationStatementElement())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); + if (src.hasDefinition()) { + for (org.hl7.fhir.r4.model.MarkdownType t : src.getDefinition()) tgt.getDefinition().add(convertMarkdown(t)); + } + if (src.hasGuidance()) + tgt.setGuidanceElement(convertMarkdown(src.getGuidanceElement())); + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.Measure.MeasureGroupComponent t : src.getGroup()) tgt.addGroup(convertMeasureGroupComponent(t)); + } + if (src.hasSupplementalData()) { + for (org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData()) tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Measure convertMeasure(org.hl7.fhir.r5.model.Measure src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Measure tgt = new org.hl7.fhir.r4.model.Measure(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) - tgt.getLibrary().add(convertCanonical(t)); - if (src.hasDisclaimer()) - tgt.setDisclaimerElement(convertMarkdown(src.getDisclaimerElement())); - if (src.hasScoring()) - tgt.setScoring(convertCodeableConcept(src.getScoring())); - if (src.hasCompositeScoring()) - tgt.setCompositeScoring(convertCodeableConcept(src.getCompositeScoring())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasRiskAdjustment()) - tgt.setRiskAdjustmentElement(convertString(src.getRiskAdjustmentElement())); - if (src.hasRateAggregation()) - tgt.setRateAggregationElement(convertString(src.getRateAggregationElement())); - if (src.hasRationale()) - tgt.setRationaleElement(convertMarkdown(src.getRationaleElement())); - if (src.hasClinicalRecommendationStatement()) - tgt.setClinicalRecommendationStatementElement(convertMarkdown(src.getClinicalRecommendationStatementElement())); - if (src.hasImprovementNotation()) - tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); - for (org.hl7.fhir.r5.model.MarkdownType t : src.getDefinition()) - tgt.getDefinition().add(convertMarkdown(t)); - if (src.hasGuidance()) - tgt.setGuidanceElement(convertMarkdown(src.getGuidanceElement())); - for (org.hl7.fhir.r5.model.Measure.MeasureGroupComponent t : src.getGroup()) - tgt.addGroup(convertMeasureGroupComponent(t)); - for (org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData()) - tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Measure convertMeasure(org.hl7.fhir.r5.model.Measure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Measure tgt = new org.hl7.fhir.r4.model.Measure(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t)); + } + if (src.hasDisclaimer()) + tgt.setDisclaimerElement(convertMarkdown(src.getDisclaimerElement())); + if (src.hasScoring()) + tgt.setScoring(convertCodeableConcept(src.getScoring())); + if (src.hasCompositeScoring()) + tgt.setCompositeScoring(convertCodeableConcept(src.getCompositeScoring())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasRiskAdjustment()) + tgt.setRiskAdjustmentElement(convertString(src.getRiskAdjustmentElement())); + if (src.hasRateAggregation()) + tgt.setRateAggregationElement(convertString(src.getRateAggregationElement())); + if (src.hasRationale()) + tgt.setRationaleElement(convertMarkdown(src.getRationaleElement())); + if (src.hasClinicalRecommendationStatement()) + tgt.setClinicalRecommendationStatementElement(convertMarkdown(src.getClinicalRecommendationStatementElement())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); + if (src.hasDefinition()) { + for (org.hl7.fhir.r5.model.MarkdownType t : src.getDefinition()) tgt.getDefinition().add(convertMarkdown(t)); + } + if (src.hasGuidance()) + tgt.setGuidanceElement(convertMarkdown(src.getGuidanceElement())); + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.Measure.MeasureGroupComponent t : src.getGroup()) tgt.addGroup(convertMeasureGroupComponent(t)); + } + if (src.hasSupplementalData()) { + for (org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData()) tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation()) - tgt.addPopulation(convertMeasureGroupPopulationComponent(t)); - for (org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier()) - tgt.addStratifier(convertMeasureGroupStratifierComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasPopulation()) { + for (org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation()) tgt.addPopulation(convertMeasureGroupPopulationComponent(t)); + } + if (src.hasStratifier()) { + for (org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier()) tgt.addStratifier(convertMeasureGroupStratifierComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation()) - tgt.addPopulation(convertMeasureGroupPopulationComponent(t)); - for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier()) - tgt.addStratifier(convertMeasureGroupStratifierComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasPopulation()) { + for (org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation()) tgt.addPopulation(convertMeasureGroupPopulationComponent(t)); + } + if (src.hasStratifier()) { + for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier()) tgt.addStratifier(convertMeasureGroupStratifierComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - return tgt; - } + public static org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + return tgt; + } - public static org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - return tgt; - } + public static org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + return tgt; + } - public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - for (org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent()) - tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + if (src.hasComponent()) { + for (org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent()) tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent()) - tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + if (src.hasComponent()) { + for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent()) tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - return tgt; - } + public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + return tgt; + } - public static org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getUsage()) - tgt.addUsage(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getUsage()) - tgt.addUsage(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCriteria()) - tgt.setCriteria(convertExpression(src.getCriteria())); - return tgt; - } + public static org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + return tgt; + } + public static org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasUsage()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getUsage()) tgt.addUsage(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + return tgt; + } + public static org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasUsage()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getUsage()) tgt.addUsage(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(convertExpression(src.getCriteria())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MeasureReport.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MeasureReport.java index 32b922d95..2546b4c4f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MeasureReport.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MeasureReport.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,285 +50,316 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MeasureReport extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MeasureReport convertMeasureReport(org.hl7.fhir.r4.model.MeasureReport src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MeasureReport tgt = new org.hl7.fhir.r5.model.MeasureReport(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertMeasureReportStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertMeasureReportType(src.getType())); - if (src.hasMeasure()) - tgt.setMeasureElement(convertCanonical(src.getMeasureElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasReporter()) - tgt.setReporter(convertReference(src.getReporter())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasImprovementNotation()) - tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); - for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup()) - tgt.addGroup(convertMeasureReportGroupComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEvaluatedResource()) - tgt.addEvaluatedResource(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MeasureReport convertMeasureReport(org.hl7.fhir.r5.model.MeasureReport src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MeasureReport tgt = new org.hl7.fhir.r4.model.MeasureReport(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertMeasureReportStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertMeasureReportType(src.getType())); - if (src.hasMeasure()) - tgt.setMeasureElement(convertCanonical(src.getMeasureElement())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasReporter()) - tgt.setReporter(convertReference(src.getReporter())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasImprovementNotation()) - tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); - for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup()) - tgt.addGroup(convertMeasureReportGroupComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEvaluatedResource()) - tgt.addEvaluatedResource(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus convertMeasureReportStatus(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETE: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.COMPLETE; - case PENDING: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.PENDING; - case ERROR: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.ERROR; - default: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus convertMeasureReportStatus(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETE: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.COMPLETE; - case PENDING: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.PENDING; - case ERROR: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.ERROR; - default: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportType convertMeasureReportType(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INDIVIDUAL: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.INDIVIDUAL; - case SUBJECTLIST: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUBJECTLIST; - case SUMMARY: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUMMARY; - case DATACOLLECTION: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.DATACOLLECTION; - default: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.NULL; - } -} - - public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportType convertMeasureReportType(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INDIVIDUAL: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.INDIVIDUAL; - case SUBJECTLIST: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUBJECTLIST; - case SUMMARY: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUMMARY; - case DATACOLLECTION: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.DATACOLLECTION; - default: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.NULL; - } -} - - public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation()) - tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t)); - if (src.hasMeasureScore()) - tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); - for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier()) - tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation()) - tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t)); - if (src.hasMeasureScore()) - tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); - for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier()) - tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasCount()) - tgt.setCountElement(convertInteger(src.getCountElement())); - if (src.hasSubjectResults()) - tgt.setSubjectResults(convertReference(src.getSubjectResults())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasCount()) - tgt.setCountElement(convertInteger(src.getCountElement())); - if (src.hasSubjectResults()) - tgt.setSubjectResults(convertReference(src.getSubjectResults())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent t : src.getStratum()) - tgt.addStratum(convertStratifierGroupComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent t : src.getStratum()) - tgt.addStratum(convertStratifierGroupComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertCodeableConcept(src.getValue())); - for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent()) - tgt.addComponent(convertStratifierGroupComponentComponent(t)); - for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation()) - tgt.addPopulation(convertStratifierGroupPopulationComponent(t)); - if (src.hasMeasureScore()) - tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertCodeableConcept(src.getValue())); - for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent()) - tgt.addComponent(convertStratifierGroupComponentComponent(t)); - for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation()) - tgt.addPopulation(convertStratifierGroupPopulationComponent(t)); - if (src.hasMeasureScore()) - tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertCodeableConcept(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertCodeableConcept(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasCount()) - tgt.setCountElement(convertInteger(src.getCountElement())); - if (src.hasSubjectResults()) - tgt.setSubjectResults(convertReference(src.getSubjectResults())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasCount()) - tgt.setCountElement(convertInteger(src.getCountElement())); - if (src.hasSubjectResults()) - tgt.setSubjectResults(convertReference(src.getSubjectResults())); - return tgt; - } + public static org.hl7.fhir.r5.model.MeasureReport convertMeasureReport(org.hl7.fhir.r4.model.MeasureReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport tgt = new org.hl7.fhir.r5.model.MeasureReport(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertMeasureReportStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertMeasureReportType(src.getType())); + if (src.hasMeasure()) + tgt.setMeasureElement(convertCanonical(src.getMeasureElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasReporter()) + tgt.setReporter(convertReference(src.getReporter())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup()) tgt.addGroup(convertMeasureReportGroupComponent(t)); + } + if (src.hasEvaluatedResource()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEvaluatedResource()) tgt.addEvaluatedResource(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.MeasureReport convertMeasureReport(org.hl7.fhir.r5.model.MeasureReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MeasureReport tgt = new org.hl7.fhir.r4.model.MeasureReport(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertMeasureReportStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertMeasureReportType(src.getType())); + if (src.hasMeasure()) + tgt.setMeasureElement(convertCanonical(src.getMeasureElement())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasReporter()) + tgt.setReporter(convertReference(src.getReporter())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation())); + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup()) tgt.addGroup(convertMeasureReportGroupComponent(t)); + } + if (src.hasEvaluatedResource()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEvaluatedResource()) tgt.addEvaluatedResource(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus convertMeasureReportStatus(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETE: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.COMPLETE; + case PENDING: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.PENDING; + case ERROR: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.ERROR; + default: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus convertMeasureReportStatus(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETE: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.COMPLETE; + case PENDING: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.PENDING; + case ERROR: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.ERROR; + default: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportType convertMeasureReportType(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INDIVIDUAL: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.INDIVIDUAL; + case SUBJECTLIST: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUBJECTLIST; + case SUMMARY: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUMMARY; + case DATACOLLECTION: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.DATACOLLECTION; + default: + return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.NULL; + } + } + + public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportType convertMeasureReportType(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INDIVIDUAL: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.INDIVIDUAL; + case SUBJECTLIST: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUBJECTLIST; + case SUMMARY: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUMMARY; + case DATACOLLECTION: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.DATACOLLECTION; + default: + return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.NULL; + } + } + + public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasPopulation()) { + for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation()) tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t)); + } + if (src.hasMeasureScore()) + tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); + if (src.hasStratifier()) { + for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier()) tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasPopulation()) { + for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation()) tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t)); + } + if (src.hasMeasureScore()) + tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); + if (src.hasStratifier()) { + for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier()) tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(convertReference(src.getSubjectResults())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(convertReference(src.getSubjectResults())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasStratum()) { + for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent t : src.getStratum()) tgt.addStratum(convertStratifierGroupComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent(); + copyElement(src, tgt); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasStratum()) { + for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent t : src.getStratum()) tgt.addStratum(convertStratifierGroupComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertCodeableConcept(src.getValue())); + if (src.hasComponent()) { + for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent()) tgt.addComponent(convertStratifierGroupComponentComponent(t)); + } + if (src.hasPopulation()) { + for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation()) tgt.addPopulation(convertStratifierGroupPopulationComponent(t)); + } + if (src.hasMeasureScore()) + tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertCodeableConcept(src.getValue())); + if (src.hasComponent()) { + for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent()) tgt.addComponent(convertStratifierGroupComponentComponent(t)); + } + if (src.hasPopulation()) { + for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation()) tgt.addPopulation(convertStratifierGroupPopulationComponent(t)); + } + if (src.hasMeasureScore()) + tgt.setMeasureScore(convertQuantity(src.getMeasureScore())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertCodeableConcept(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertCodeableConcept(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(convertReference(src.getSubjectResults())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(convertReference(src.getSubjectResults())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Media.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Media.java index 06c594e85..227b96e74 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Media.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Media.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,153 +50,147 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Media extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.DocumentReference convertMedia(org.hl7.fhir.r4.model.Media src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference(); - copyDomainResource(src, tgt); -// for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) -// tgt.addIdentifier(convertIdentifier(t)); -// for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) -// tgt.addBasedOn(convertReference(t)); -// for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) -// tgt.addPartOf(convertReference(t)); -// if (src.hasStatus()) -// tgt.setStatus(convertMediaStatus(src.getStatus())); -// if (src.hasType()) -// tgt.setType(convertCodeableConcept(src.getType())); -// if (src.hasModality()) -// tgt.setModality(convertCodeableConcept(src.getModality())); -// if (src.hasView()) -// tgt.setView(convertCodeableConcept(src.getView())); -// if (src.hasSubject()) -// tgt.setSubject(convertReference(src.getSubject())); -// if (src.hasEncounter()) -// tgt.setEncounter(convertReference(src.getEncounter())); -// if (src.hasCreated()) -// tgt.setCreated(convertType(src.getCreated())); -// if (src.hasIssued()) -// tgt.setIssuedElement(convertInstant(src.getIssuedElement())); -// if (src.hasOperator()) -// tgt.setOperator(convertReference(src.getOperator())); -// for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) -// tgt.addReasonCode(convertCodeableConcept(t)); -// if (src.hasBodySite()) -// tgt.setBodySite(convertCodeableConcept(src.getBodySite())); -// if (src.hasDeviceName()) -// tgt.setDeviceNameElement(convertString(src.getDeviceNameElement())); -// if (src.hasDevice()) -// tgt.setDevice(convertReference(src.getDevice())); -// if (src.hasHeight()) -// tgt.setHeightElement(convertPositiveInt(src.getHeightElement())); -// if (src.hasWidth()) -// tgt.setWidthElement(convertPositiveInt(src.getWidthElement())); -// if (src.hasFrames()) -// tgt.setFramesElement(convertPositiveInt(src.getFramesElement())); -// if (src.hasDuration()) -// tgt.setDurationElement(convertDecimal(src.getDurationElement())); -// if (src.hasContent()) -// tgt.setContent(convertAttachment(src.getContent())); -// for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) -// tgt.addNote(convertAnnotation(t)); - return tgt; - } - - /** - * Todo: how do you decide that it maps to a media? - * @param src - * @return - * @throws FHIRException - */ - public static org.hl7.fhir.r4.model.Media convertMedia(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Media tgt = new org.hl7.fhir.r4.model.Media(); - copyDomainResource(src, tgt); -// for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) -// tgt.addIdentifier(convertIdentifier(t)); -// for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) -// tgt.addBasedOn(convertReference(t)); -// for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) -// tgt.addPartOf(convertReference(t)); -// if (src.hasStatus()) -// tgt.setStatus(convertMediaStatus(src.getStatus())); -// if (src.hasType()) -// tgt.setType(convertCodeableConcept(src.getType())); -// if (src.hasModality()) -// tgt.setModality(convertCodeableConcept(src.getModality())); -// if (src.hasView()) -// tgt.setView(convertCodeableConcept(src.getView())); -// if (src.hasSubject()) -// tgt.setSubject(convertReference(src.getSubject())); -// if (src.hasEncounter()) -// tgt.setEncounter(convertReference(src.getEncounter())); -// if (src.hasCreated()) -// tgt.setCreated(convertType(src.getCreated())); -// if (src.hasIssued()) -// tgt.setIssuedElement(convertInstant(src.getIssuedElement())); -// if (src.hasOperator()) -// tgt.setOperator(convertReference(src.getOperator())); -// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode()) -// tgt.addReasonCode(convertCodeableConcept(t)); -// if (src.hasBodySite()) -// tgt.setBodySite(convertCodeableConcept(src.getBodySite())); -// if (src.hasDeviceName()) -// tgt.setDeviceNameElement(convertString(src.getDeviceNameElement())); -// if (src.hasDevice()) -// tgt.setDevice(convertReference(src.getDevice())); -// if (src.hasHeight()) -// tgt.setHeightElement(convertPositiveInt(src.getHeightElement())); -// if (src.hasWidth()) -// tgt.setWidthElement(convertPositiveInt(src.getWidthElement())); -// if (src.hasFrames()) -// tgt.setFramesElement(convertPositiveInt(src.getFramesElement())); -// if (src.hasDuration()) -// tgt.setDurationElement(convertDecimal(src.getDurationElement())); -// if (src.hasContent()) -// tgt.setContent(convertAttachment(src.getContent())); -// for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) -// tgt.addNote(convertAnnotation(t)); - return tgt; - } - -// public static org.hl7.fhir.r5.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r4.model.Media.MediaStatus src) throws FHIRException { -// if (src == null) -// return null; -// switch (src) { -// case PREPARATION: return org.hl7.fhir.r5.model.Media.MediaStatus.PREPARATION; -// case INPROGRESS: return org.hl7.fhir.r5.model.Media.MediaStatus.INPROGRESS; -// case NOTDONE: return org.hl7.fhir.r5.model.Media.MediaStatus.NOTDONE; -// case ONHOLD: return org.hl7.fhir.r5.model.Media.MediaStatus.ONHOLD; -// case STOPPED: return org.hl7.fhir.r5.model.Media.MediaStatus.STOPPED; -// case COMPLETED: return org.hl7.fhir.r5.model.Media.MediaStatus.COMPLETED; -// case ENTEREDINERROR: return org.hl7.fhir.r5.model.Media.MediaStatus.ENTEREDINERROR; -// case UNKNOWN: return org.hl7.fhir.r5.model.Media.MediaStatus.UNKNOWN; -// default: return org.hl7.fhir.r5.model.Media.MediaStatus.NULL; -// } -//} -// -// public static org.hl7.fhir.r4.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r5.model.Media.MediaStatus src) throws FHIRException { -// if (src == null) -// return null; -// switch (src) { -// case PREPARATION: return org.hl7.fhir.r4.model.Media.MediaStatus.PREPARATION; -// case INPROGRESS: return org.hl7.fhir.r4.model.Media.MediaStatus.INPROGRESS; -// case NOTDONE: return org.hl7.fhir.r4.model.Media.MediaStatus.NOTDONE; -// case ONHOLD: return org.hl7.fhir.r4.model.Media.MediaStatus.ONHOLD; -// case STOPPED: return org.hl7.fhir.r4.model.Media.MediaStatus.STOPPED; -// case COMPLETED: return org.hl7.fhir.r4.model.Media.MediaStatus.COMPLETED; -// case ENTEREDINERROR: return org.hl7.fhir.r4.model.Media.MediaStatus.ENTEREDINERROR; -// case UNKNOWN: return org.hl7.fhir.r4.model.Media.MediaStatus.UNKNOWN; -// default: return org.hl7.fhir.r4.model.Media.MediaStatus.NULL; -// } -//} - + public static org.hl7.fhir.r5.model.DocumentReference convertMedia(org.hl7.fhir.r4.model.Media src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference(); + copyDomainResource(src, tgt); + // for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) + // tgt.addIdentifier(convertIdentifier(t)); + // for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) + // tgt.addBasedOn(convertReference(t)); + // for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) + // tgt.addPartOf(convertReference(t)); + // if (src.hasStatus()) + // tgt.setStatus(convertMediaStatus(src.getStatus())); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // if (src.hasModality()) + // tgt.setModality(convertCodeableConcept(src.getModality())); + // if (src.hasView()) + // tgt.setView(convertCodeableConcept(src.getView())); + // if (src.hasSubject()) + // tgt.setSubject(convertReference(src.getSubject())); + // if (src.hasEncounter()) + // tgt.setEncounter(convertReference(src.getEncounter())); + // if (src.hasCreated()) + // tgt.setCreated(convertType(src.getCreated())); + // if (src.hasIssued()) + // tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + // if (src.hasOperator()) + // tgt.setOperator(convertReference(src.getOperator())); + // for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) + // tgt.addReasonCode(convertCodeableConcept(t)); + // if (src.hasBodySite()) + // tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + // if (src.hasDeviceName()) + // tgt.setDeviceNameElement(convertString(src.getDeviceNameElement())); + // if (src.hasDevice()) + // tgt.setDevice(convertReference(src.getDevice())); + // if (src.hasHeight()) + // tgt.setHeightElement(convertPositiveInt(src.getHeightElement())); + // if (src.hasWidth()) + // tgt.setWidthElement(convertPositiveInt(src.getWidthElement())); + // if (src.hasFrames()) + // tgt.setFramesElement(convertPositiveInt(src.getFramesElement())); + // if (src.hasDuration()) + // tgt.setDurationElement(convertDecimal(src.getDurationElement())); + // if (src.hasContent()) + // tgt.setContent(convertAttachment(src.getContent())); + // for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) + // tgt.addNote(convertAnnotation(t)); + return tgt; + } + /** + * Todo: how do you decide that it maps to a media? + * @param src + * @return + * @throws FHIRException + */ + public static org.hl7.fhir.r4.model.Media convertMedia(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Media tgt = new org.hl7.fhir.r4.model.Media(); + copyDomainResource(src, tgt); + // for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + // tgt.addIdentifier(convertIdentifier(t)); + // for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) + // tgt.addBasedOn(convertReference(t)); + // for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) + // tgt.addPartOf(convertReference(t)); + // if (src.hasStatus()) + // tgt.setStatus(convertMediaStatus(src.getStatus())); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // if (src.hasModality()) + // tgt.setModality(convertCodeableConcept(src.getModality())); + // if (src.hasView()) + // tgt.setView(convertCodeableConcept(src.getView())); + // if (src.hasSubject()) + // tgt.setSubject(convertReference(src.getSubject())); + // if (src.hasEncounter()) + // tgt.setEncounter(convertReference(src.getEncounter())); + // if (src.hasCreated()) + // tgt.setCreated(convertType(src.getCreated())); + // if (src.hasIssued()) + // tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + // if (src.hasOperator()) + // tgt.setOperator(convertReference(src.getOperator())); + // for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode()) + // tgt.addReasonCode(convertCodeableConcept(t)); + // if (src.hasBodySite()) + // tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + // if (src.hasDeviceName()) + // tgt.setDeviceNameElement(convertString(src.getDeviceNameElement())); + // if (src.hasDevice()) + // tgt.setDevice(convertReference(src.getDevice())); + // if (src.hasHeight()) + // tgt.setHeightElement(convertPositiveInt(src.getHeightElement())); + // if (src.hasWidth()) + // tgt.setWidthElement(convertPositiveInt(src.getWidthElement())); + // if (src.hasFrames()) + // tgt.setFramesElement(convertPositiveInt(src.getFramesElement())); + // if (src.hasDuration()) + // tgt.setDurationElement(convertDecimal(src.getDurationElement())); + // if (src.hasContent()) + // tgt.setContent(convertAttachment(src.getContent())); + // for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) + // tgt.addNote(convertAnnotation(t)); + return tgt; + } + // public static org.hl7.fhir.r5.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r4.model.Media.MediaStatus src) throws FHIRException { + // if (src == null) + // return null; + // switch (src) { + // case PREPARATION: return org.hl7.fhir.r5.model.Media.MediaStatus.PREPARATION; + // case INPROGRESS: return org.hl7.fhir.r5.model.Media.MediaStatus.INPROGRESS; + // case NOTDONE: return org.hl7.fhir.r5.model.Media.MediaStatus.NOTDONE; + // case ONHOLD: return org.hl7.fhir.r5.model.Media.MediaStatus.ONHOLD; + // case STOPPED: return org.hl7.fhir.r5.model.Media.MediaStatus.STOPPED; + // case COMPLETED: return org.hl7.fhir.r5.model.Media.MediaStatus.COMPLETED; + // case ENTEREDINERROR: return org.hl7.fhir.r5.model.Media.MediaStatus.ENTEREDINERROR; + // case UNKNOWN: return org.hl7.fhir.r5.model.Media.MediaStatus.UNKNOWN; + // default: return org.hl7.fhir.r5.model.Media.MediaStatus.NULL; + // } + // } + // + // public static org.hl7.fhir.r4.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r5.model.Media.MediaStatus src) throws FHIRException { + // if (src == null) + // return null; + // switch (src) { + // case PREPARATION: return org.hl7.fhir.r4.model.Media.MediaStatus.PREPARATION; + // case INPROGRESS: return org.hl7.fhir.r4.model.Media.MediaStatus.INPROGRESS; + // case NOTDONE: return org.hl7.fhir.r4.model.Media.MediaStatus.NOTDONE; + // case ONHOLD: return org.hl7.fhir.r4.model.Media.MediaStatus.ONHOLD; + // case STOPPED: return org.hl7.fhir.r4.model.Media.MediaStatus.STOPPED; + // case COMPLETED: return org.hl7.fhir.r4.model.Media.MediaStatus.COMPLETED; + // case ENTEREDINERROR: return org.hl7.fhir.r4.model.Media.MediaStatus.ENTEREDINERROR; + // case UNKNOWN: return org.hl7.fhir.r4.model.Media.MediaStatus.UNKNOWN; + // default: return org.hl7.fhir.r4.model.Media.MediaStatus.NULL; + // } + // } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Medication.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Medication.java index 56398e102..300396050 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Medication.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Medication.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,133 +50,140 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Medication extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Medication convertMedication(org.hl7.fhir.r4.model.Medication src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Medication tgt = new org.hl7.fhir.r5.model.Medication(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasStatus()) - tgt.setStatus(convertMedicationStatus(src.getStatus())); - if (src.hasManufacturer()) - tgt.setManufacturer(convertReference(src.getManufacturer())); - if (src.hasForm()) - tgt.setDoseForm(convertCodeableConcept(src.getForm())); - if (src.hasAmount()) - tgt.setAmount(convertRatio(src.getAmount())); - for (org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent t : src.getIngredient()) - tgt.addIngredient(convertMedicationIngredientComponent(t)); - if (src.hasBatch()) - tgt.setBatch(convertMedicationBatchComponent(src.getBatch())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Medication convertMedication(org.hl7.fhir.r5.model.Medication src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Medication tgt = new org.hl7.fhir.r4.model.Medication(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasStatus()) - tgt.setStatus(convertMedicationStatus(src.getStatus())); - if (src.hasManufacturer()) - tgt.setManufacturer(convertReference(src.getManufacturer())); - if (src.hasDoseForm()) - tgt.setForm(convertCodeableConcept(src.getDoseForm())); - if (src.hasAmount()) - tgt.setAmount(convertRatio(src.getAmount())); - for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient()) - tgt.addIngredient(convertMedicationIngredientComponent(t)); - if (src.hasBatch()) - tgt.setBatch(convertMedicationBatchComponent(src.getBatch())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Medication.MedicationStatusCodes convertMedicationStatus(org.hl7.fhir.r4.model.Medication.MedicationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ACTIVE; - case INACTIVE: return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Medication.MedicationStatus convertMedicationStatus(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Medication.MedicationStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r4.model.Medication.MedicationStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Medication.MedicationStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Medication.MedicationStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent(); - copyElement(src, tgt); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - if (src.hasIsActive()) - tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); - if (src.hasStrength()) - tgt.setStrength(convertRatio(src.getStrength())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent(); - copyElement(src, tgt); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - if (src.hasIsActive()) - tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); - if (src.hasStrengthRatio()) - tgt.setStrength(convertRatio(src.getStrengthRatio())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r4.model.Medication.MedicationBatchComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationBatchComponent(); - copyElement(src, tgt); - if (src.hasLotNumber()) - tgt.setLotNumberElement(convertString(src.getLotNumberElement())); - if (src.hasExpirationDate()) - tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r5.model.Medication.MedicationBatchComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r4.model.Medication.MedicationBatchComponent(); - copyElement(src, tgt); - if (src.hasLotNumber()) - tgt.setLotNumberElement(convertString(src.getLotNumberElement())); - if (src.hasExpirationDate()) - tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.Medication convertMedication(org.hl7.fhir.r4.model.Medication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Medication tgt = new org.hl7.fhir.r5.model.Medication(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatus(convertMedicationStatus(src.getStatus())); + if (src.hasManufacturer()) + tgt.setManufacturer(convertReference(src.getManufacturer())); + if (src.hasForm()) + tgt.setDoseForm(convertCodeableConcept(src.getForm())); + if (src.hasAmount()) + tgt.setAmount(convertRatio(src.getAmount())); + if (src.hasIngredient()) { + for (org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + } + if (src.hasBatch()) + tgt.setBatch(convertMedicationBatchComponent(src.getBatch())); + return tgt; + } + public static org.hl7.fhir.r4.model.Medication convertMedication(org.hl7.fhir.r5.model.Medication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Medication tgt = new org.hl7.fhir.r4.model.Medication(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatus(convertMedicationStatus(src.getStatus())); + if (src.hasManufacturer()) + tgt.setManufacturer(convertReference(src.getManufacturer())); + if (src.hasDoseForm()) + tgt.setForm(convertCodeableConcept(src.getDoseForm())); + if (src.hasAmount()) + tgt.setAmount(convertRatio(src.getAmount())); + if (src.hasIngredient()) { + for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationIngredientComponent(t)); + } + if (src.hasBatch()) + tgt.setBatch(convertMedicationBatchComponent(src.getBatch())); + return tgt; + } + public static org.hl7.fhir.r5.model.Medication.MedicationStatusCodes convertMedicationStatus(org.hl7.fhir.r4.model.Medication.MedicationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Medication.MedicationStatus convertMedicationStatus(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Medication.MedicationStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r4.model.Medication.MedicationStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Medication.MedicationStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Medication.MedicationStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent(); + copyElement(src, tgt); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + if (src.hasIsActive()) + tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); + if (src.hasStrength()) + tgt.setStrength(convertRatio(src.getStrength())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent(); + copyElement(src, tgt); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + if (src.hasIsActive()) + tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); + if (src.hasStrengthRatio()) + tgt.setStrength(convertRatio(src.getStrengthRatio())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r4.model.Medication.MedicationBatchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationBatchComponent(); + copyElement(src, tgt); + if (src.hasLotNumber()) + tgt.setLotNumberElement(convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r5.model.Medication.MedicationBatchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r4.model.Medication.MedicationBatchComponent(); + copyElement(src, tgt); + if (src.hasLotNumber()) + tgt.setLotNumberElement(convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationAdministration.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationAdministration.java index 5ac2236f0..e4f93a584 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationAdministration.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationAdministration.java @@ -19,8 +19,6 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeType; import org.hl7.fhir.r5.model.CodeableReference; @@ -29,7 +27,6 @@ import org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationSt import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -58,187 +55,204 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MedicationAdministration extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r4.model.MedicationAdministration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationAdministration tgt = new org.hl7.fhir.r5.model.MedicationAdministration(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason()) - tgt.addStatusReason(convertCodeableConcept(t)); - if (src.hasCategory()) - tgt.addCategory(convertCodeableConcept(src.getCategory())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasContext()) - tgt.setEncounter(convertReference(src.getContext())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - if (src.hasEffective()) - tgt.setOccurence(convertType(src.getEffective())); - for (org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - for (org.hl7.fhir.r4.model.Reference t : src.getDevice()) - tgt.addDevice(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasDosage()) - tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); - for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) - tgt.addEventHistory(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r4.model.MedicationAdministration src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationAdministration tgt = new org.hl7.fhir.r5.model.MedicationAdministration(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiates()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); + if (src.hasStatusReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason()) tgt.addStatusReason(convertCodeableConcept(t)); + } + if (src.hasCategory()) + tgt.addCategory(convertCodeableConcept(src.getCategory())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setEncounter(convertReference(src.getContext())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasEffective()) + tgt.setOccurence(convertType(src.getEffective())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasDevice()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDevice()) tgt.addDevice(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosage()) + tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); + if (src.hasEventHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r5.model.MedicationAdministration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationAdministration tgt = new org.hl7.fhir.r4.model.MedicationAdministration(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiates().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) - tgt.addStatusReason(convertCodeableConcept(t)); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setContext(convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - if (src.hasOccurence()) - tgt.setEffective(convertType(src.getOccurence())); - for (org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - for (org.hl7.fhir.r5.model.Reference t : src.getDevice()) - tgt.addDevice(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasDosage()) - tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); - for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) - tgt.addEventHistory(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r5.model.MedicationAdministration src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationAdministration tgt = new org.hl7.fhir.r4.model.MedicationAdministration(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiates().add(convertUri(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); + if (src.hasStatusReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) tgt.addStatusReason(convertCodeableConcept(t)); + } + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setContext(convertReference(src.getEncounter())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasOccurence()) + tgt.setEffective(convertType(src.getOccurence())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + } + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasDevice()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDevice()) tgt.addDevice(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosage()) + tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); + if (src.hasEventHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(convertReference(t)); + } + return tgt; + } - private static CodeType convertMedicationAdministrationStatus(Enumeration src) { - if (src == null) - return null; - CodeType tgt = new CodeType(); - copyElement(src, tgt); - tgt.setValue(src.getCode()); - return tgt; - } + private static CodeType convertMedicationAdministrationStatus(Enumeration src) { + if (src == null) + return null; + CodeType tgt = new CodeType(); + copyElement(src, tgt); + if (src.hasCode()) { + tgt.setValue(src.getCode()); + } + return tgt; + } - private static Enumeration convertMedicationAdministrationStatus(CodeType src) { - if (src == null) - return null; - Enumeration tgt = new Enumeration(); - copyElement(src, tgt); - tgt.setValue(MedicationAdministrationStatusCodes.fromCode(src.getCode())); - return tgt; - } + private static Enumeration convertMedicationAdministrationStatus(CodeType src) { + if (src == null) + return null; + Enumeration tgt = new Enumeration(); + copyElement(src, tgt); + if (src.hasCode()) { + tgt.setValue(MedicationAdministrationStatusCodes.fromCode(src.getCode())); + } + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent(); - copyElement(src, tgt); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasSite()) - tgt.setSite(convertCodeableConcept(src.getSite())); - if (src.hasRoute()) - tgt.setRoute(convertCodeableConcept(src.getRoute())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasDose()) - tgt.setDose(convertSimpleQuantity(src.getDose())); - if (src.hasRate()) - tgt.setRate(convertType(src.getRate())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent(); - copyElement(src, tgt); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasSite()) - tgt.setSite(convertCodeableConcept(src.getSite())); - if (src.hasRoute()) - tgt.setRoute(convertCodeableConcept(src.getRoute())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasDose()) - tgt.setDose(convertSimpleQuantity(src.getDose())); - if (src.hasRate()) - tgt.setRate(convertType(src.getRate())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent(); + copyElement(src, tgt); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasSite()) + tgt.setSite(convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(convertCodeableConcept(src.getRoute())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasDose()) + tgt.setDose(convertSimpleQuantity(src.getDose())); + if (src.hasRate()) + tgt.setRate(convertType(src.getRate())); + return tgt; + } + public static org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent(); + copyElement(src, tgt); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasSite()) + tgt.setSite(convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(convertCodeableConcept(src.getRoute())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasDose()) + tgt.setDose(convertSimpleQuantity(src.getDose())); + if (src.hasRate()) + tgt.setRate(convertType(src.getRate())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationDispense.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationDispense.java index f6e678878..0f1ee6a7f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationDispense.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationDispense.java @@ -19,15 +19,12 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -56,199 +53,220 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MedicationDispense extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r4.model.MedicationDispense src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationDispense tgt = new org.hl7.fhir.r5.model.MedicationDispense(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatusElement(convertMedicationStatus(src.getStatusElement())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertType(src.getStatusReason())); - if (src.hasCategory()) - tgt.addCategory(convertCodeableConcept(src.getCategory())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasContext()) - tgt.setEncounter(convertReference(src.getContext())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - for (org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.Reference t : src.getAuthorizingPrescription()) - tgt.addAuthorizingPrescription(convertReference(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasDaysSupply()) - tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply())); - if (src.hasWhenPrepared()) - tgt.setWhenPreparedElement(convertDateTime(src.getWhenPreparedElement())); - if (src.hasWhenHandedOver()) - tgt.setWhenHandedOverElement(convertDateTime(src.getWhenHandedOverElement())); - if (src.hasDestination()) - tgt.setDestination(convertReference(src.getDestination())); - for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) - tgt.addReceiver(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) - tgt.addDosageInstruction(convertDosage(t)); - if (src.hasSubstitution()) - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); - for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) - tgt.addDetectedIssue(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) - tgt.addEventHistory(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r4.model.MedicationDispense src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationDispense tgt = new org.hl7.fhir.r5.model.MedicationDispense(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertType(src.getStatusReason())); + if (src.hasCategory()) + tgt.addCategory(convertCodeableConcept(src.getCategory())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setEncounter(convertReference(src.getContext())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(convertReference(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDaysSupply()) + tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply())); + if (src.hasWhenPrepared()) + tgt.setWhenPreparedElement(convertDateTime(src.getWhenPreparedElement())); + if (src.hasWhenHandedOver()) + tgt.setWhenHandedOverElement(convertDateTime(src.getWhenHandedOverElement())); + if (src.hasDestination()) + tgt.setDestination(convertReference(src.getDestination())); + if (src.hasReceiver()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertDosage(t)); + } + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r5.model.MedicationDispense src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationDispense tgt = new org.hl7.fhir.r4.model.MedicationDispense(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatusElement(convertStatus(src.getStatusElement())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertType(src.getStatusReason())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setContext(convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - for (org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription()) - tgt.addAuthorizingPrescription(convertReference(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasDaysSupply()) - tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply())); - if (src.hasWhenPrepared()) - tgt.setWhenPreparedElement(convertDateTime(src.getWhenPreparedElement())); - if (src.hasWhenHandedOver()) - tgt.setWhenHandedOverElement(convertDateTime(src.getWhenHandedOverElement())); - if (src.hasDestination()) - tgt.setDestination(convertReference(src.getDestination())); - for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) - tgt.addReceiver(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) - tgt.addDosageInstruction(convertDosage(t)); - if (src.hasSubstitution()) - tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); - for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) - tgt.addDetectedIssue(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) - tgt.addEventHistory(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r5.model.MedicationDispense src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationDispense tgt = new org.hl7.fhir.r4.model.MedicationDispense(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatusElement(convertStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertType(src.getStatusReason())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setContext(convertReference(src.getEncounter())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasAuthorizingPrescription()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(convertReference(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDaysSupply()) + tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply())); + if (src.hasWhenPrepared()) + tgt.setWhenPreparedElement(convertDateTime(src.getWhenPreparedElement())); + if (src.hasWhenHandedOver()) + tgt.setWhenHandedOverElement(convertDateTime(src.getWhenHandedOverElement())); + if (src.hasDestination()) + tgt.setDestination(convertReference(src.getDestination())); + if (src.hasReceiver()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertDosage(t)); + } + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(convertReference(t)); + } + return tgt; + } - private static CodeType convertStatus(org.hl7.fhir.r5.model.Enumeration src) { - if (src == null) - return null; - CodeType tgt = new CodeType(); - copyElement(src, tgt); - if (src.getValue() == MedicationDispenseStatusCodes.DECLINED) - tgt.setValue("stopped"); - else - tgt.setValue(src.getValueAsString()); - return tgt; - } + private static CodeType convertStatus(org.hl7.fhir.r5.model.Enumeration src) { + if (src == null) + return null; + CodeType tgt = new CodeType(); + copyElement(src, tgt); + if (src.getValue() == MedicationDispenseStatusCodes.DECLINED) + tgt.setValue("stopped"); + else + tgt.setValue(src.getValueAsString()); + return tgt; + } - private static org.hl7.fhir.r5.model.Enumeration convertMedicationStatus(org.hl7.fhir.r4.model.CodeType src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration(); - copyElement(src, tgt); - tgt.setValue(MedicationDispenseStatusCodes.fromCode(src.getCode())); - return tgt; - } - public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } + private static org.hl7.fhir.r5.model.Enumeration convertMedicationStatus(org.hl7.fhir.r4.model.CodeType src) { + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration(); + copyElement(src, tgt); + if (src.hasCode()) { + tgt.setValue(MedicationDispenseStatusCodes.fromCode(src.getCode())); + } + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); - copyElement(src, tgt); - if (src.hasWasSubstituted()) - tgt.setWasSubstitutedElement(convertBoolean(src.getWasSubstitutedElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getResponsibleParty()) - tgt.setResponsibleParty(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); - copyElement(src, tgt); - if (src.hasWasSubstituted()) - tgt.setWasSubstitutedElement(convertBoolean(src.getWasSubstitutedElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - if (src.hasResponsibleParty()) - tgt.addResponsibleParty(convertReference(src.getResponsibleParty())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + return tgt; + } + public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); + copyElement(src, tgt); + if (src.hasWasSubstituted()) + tgt.setWasSubstitutedElement(convertBoolean(src.getWasSubstitutedElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) { + for (org.hl7.fhir.r4.model.Reference t : src.getResponsibleParty()) tgt.setResponsibleParty(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); + copyElement(src, tgt); + if (src.hasWasSubstituted()) + tgt.setWasSubstitutedElement(convertBoolean(src.getWasSubstitutedElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasResponsibleParty()) + tgt.addResponsibleParty(convertReference(src.getResponsibleParty())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationKnowledge.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationKnowledge.java index fd7419979..7960712e8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationKnowledge.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationKnowledge.java @@ -19,15 +19,12 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -56,537 +53,556 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MedicationKnowledge extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r4.model.MedicationKnowledge src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge tgt = new org.hl7.fhir.r5.model.MedicationKnowledge(); - copyDomainResource(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasStatus()) - tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement())); - if (src.hasManufacturer()) - tgt.setManufacturer(convertReference(src.getManufacturer())); - if (src.hasDoseForm()) - tgt.setDoseForm(convertCodeableConcept(src.getDoseForm())); - if (src.hasAmount()) - tgt.setAmount(convertSimpleQuantity(src.getAmount())); - for (org.hl7.fhir.r4.model.StringType t : src.getSynonym()) - tgt.getSynonym().add(convertString(t)); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge()) - tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getAssociatedMedication()) - tgt.addAssociatedMedication(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProductType()) - tgt.addProductType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph()) - tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t)); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient()) - tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t)); - if (src.hasPreparationInstruction()) - tgt.setPreparationInstructionElement(convertMarkdown(src.getPreparationInstructionElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getIntendedRoute()) - tgt.addIntendedRoute(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost()) - tgt.addCost(convertMedicationKnowledgeCostComponent(t)); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram()) - tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t)); -// for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines()) -// tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t)); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification()) - tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t)); - if (src.hasPackaging()) - tgt.setPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging())); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic()) - tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t)); -// for (org.hl7.fhir.r4.model.Reference t : src.getContraindication()) -// tgt.addContraindication(convertReference(t)); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory()) - tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t)); -// for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics()) -// tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r4.model.MedicationKnowledge src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge tgt = new org.hl7.fhir.r5.model.MedicationKnowledge(); + copyDomainResource(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement())); + if (src.hasManufacturer()) + tgt.setManufacturer(convertReference(src.getManufacturer())); + if (src.hasDoseForm()) + tgt.setDoseForm(convertCodeableConcept(src.getDoseForm())); + if (src.hasAmount()) + tgt.setAmount(convertSimpleQuantity(src.getAmount())); + if (src.hasSynonym()) { + for (org.hl7.fhir.r4.model.StringType t : src.getSynonym()) tgt.getSynonym().add(convertString(t)); + } + if (src.hasRelatedMedicationKnowledge()) { + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge()) tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t)); + } + if (src.hasAssociatedMedication()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAssociatedMedication()) tgt.addAssociatedMedication(convertReference(t)); + } + if (src.hasProductType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProductType()) tgt.addProductType(convertCodeableConcept(t)); + } + if (src.hasMonograph()) { + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph()) tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t)); + } + if (src.hasPreparationInstruction()) + tgt.setPreparationInstructionElement(convertMarkdown(src.getPreparationInstructionElement())); + if (src.hasIntendedRoute()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getIntendedRoute()) tgt.addIntendedRoute(convertCodeableConcept(t)); + } + if (src.hasCost()) { + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost()) tgt.addCost(convertMedicationKnowledgeCostComponent(t)); + } + if (src.hasMonitoringProgram()) { + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram()) tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t)); + } + // for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines()) + // tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t)); + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification()) tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t)); + if (src.hasPackaging()) + tgt.setPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging())); + if (src.hasDrugCharacteristic()) { + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic()) tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t)); + } + // for (org.hl7.fhir.r4.model.Reference t : src.getContraindication()) + // tgt.addContraindication(convertReference(t)); + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory()) tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t)); + // for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics()) + // tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t)); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r5.model.MedicationKnowledge src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge tgt = new org.hl7.fhir.r4.model.MedicationKnowledge(); - copyDomainResource(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasStatus()) - tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement())); - if (src.hasManufacturer()) - tgt.setManufacturer(convertReference(src.getManufacturer())); - if (src.hasDoseForm()) - tgt.setDoseForm(convertCodeableConcept(src.getDoseForm())); - if (src.hasAmount()) - tgt.setAmount(convertSimpleQuantity(src.getAmount())); - for (org.hl7.fhir.r5.model.StringType t : src.getSynonym()) - tgt.getSynonym().add(convertString(t)); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge()) - tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getAssociatedMedication()) - tgt.addAssociatedMedication(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProductType()) - tgt.addProductType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph()) - tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t)); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient()) - tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t)); - if (src.hasPreparationInstruction()) - tgt.setPreparationInstructionElement(convertMarkdown(src.getPreparationInstructionElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getIntendedRoute()) - tgt.addIntendedRoute(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost()) - tgt.addCost(convertMedicationKnowledgeCostComponent(t)); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram()) - tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t)); -// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines()) -// tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t)); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification()) - tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t)); - if (src.hasPackaging()) - tgt.setPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging())); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic()) - tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t)); -// for (org.hl7.fhir.r5.model.Reference t : src.getContraindication()) -// tgt.addContraindication(convertReference(t)); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory()) - tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t)); -// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics()) -// tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r5.model.MedicationKnowledge src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge tgt = new org.hl7.fhir.r4.model.MedicationKnowledge(); + copyDomainResource(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement())); + if (src.hasManufacturer()) + tgt.setManufacturer(convertReference(src.getManufacturer())); + if (src.hasDoseForm()) + tgt.setDoseForm(convertCodeableConcept(src.getDoseForm())); + if (src.hasAmount()) + tgt.setAmount(convertSimpleQuantity(src.getAmount())); + if (src.hasSynonym()) { + for (org.hl7.fhir.r5.model.StringType t : src.getSynonym()) tgt.getSynonym().add(convertString(t)); + } + if (src.hasRelatedMedicationKnowledge()) { + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge()) tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t)); + } + if (src.hasAssociatedMedication()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAssociatedMedication()) tgt.addAssociatedMedication(convertReference(t)); + } + if (src.hasProductType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProductType()) tgt.addProductType(convertCodeableConcept(t)); + } + if (src.hasMonograph()) { + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph()) tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t)); + } + if (src.hasPreparationInstruction()) + tgt.setPreparationInstructionElement(convertMarkdown(src.getPreparationInstructionElement())); + if (src.hasIntendedRoute()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getIntendedRoute()) tgt.addIntendedRoute(convertCodeableConcept(t)); + } + if (src.hasCost()) { + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost()) tgt.addCost(convertMedicationKnowledgeCostComponent(t)); + } + if (src.hasMonitoringProgram()) { + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram()) tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t)); + } + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines()) + // tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification()) tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t)); + if (src.hasPackaging()) + tgt.setPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging())); + if (src.hasDrugCharacteristic()) { + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic()) tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t)); + } + // for (org.hl7.fhir.r5.model.Reference t : src.getContraindication()) + // tgt.addContraindication(convertReference(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory()) tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t)); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics()) + // tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t)); + return tgt; + } - private static CodeType convertMedicationKnowledgeStatus(Enumeration src) { - if (src == null) - return null; - CodeType tgt = new CodeType(); - copyElement(src, tgt); - tgt.setValue(src.getValueAsString()); - return tgt; - } + private static CodeType convertMedicationKnowledgeStatus(Enumeration src) { + if (src == null) + return null; + CodeType tgt = new CodeType(); + copyElement(src, tgt); + if (src.hasValue()) { + tgt.setValue(src.getValueAsString()); + } + return tgt; + } - private static Enumeration convertMedicationKnowledgeStatus(CodeType src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration(); - copyElement(src, tgt); - tgt.setValue(MedicationKnowledgeStatusCodes.fromCode(src.getCode())); - return tgt; - } + private static Enumeration convertMedicationKnowledgeStatus(CodeType src) { + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration(); + copyElement(src, tgt); + if (src.hasCode()) { + tgt.setValue(MedicationKnowledgeStatusCodes.fromCode(src.getCode())); + } + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.Reference t : src.getReference()) - tgt.addReference(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReference()) tgt.addReference(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.Reference t : src.getReference()) - tgt.addReference(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasReference()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent(); - copyElement(src, tgt); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - if (src.hasIsActive()) - tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); - if (src.hasStrength()) - tgt.setStrength(convertRatio(src.getStrength())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent(); + copyElement(src, tgt); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + if (src.hasIsActive()) + tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); + if (src.hasStrength()) + tgt.setStrength(convertRatio(src.getStrength())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent(); - copyElement(src, tgt); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - if (src.hasIsActive()) - tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); - if (src.hasStrengthRatio()) - tgt.setStrength(convertRatio(src.getStrengthRatio())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent(); + copyElement(src, tgt); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + if (src.hasIsActive()) + tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement())); + if (src.hasStrengthRatio()) + tgt.setStrength(convertRatio(src.getStrengthRatio())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSource()) - tgt.setSourceElement(convertString(src.getSourceElement())); - if (src.hasCost()) - tgt.setCost(convertMoney(src.getCost())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSourceElement(convertString(src.getSourceElement())); + if (src.hasCost()) + tgt.setCost(convertMoney(src.getCost())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSource()) - tgt.setSourceElement(convertString(src.getSourceElement())); - if (src.hasCost()) - tgt.setCost(convertMoney(src.getCost())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSourceElement(convertString(src.getSourceElement())); + if (src.hasCost()) + tgt.setCost(convertMoney(src.getCost())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + return tgt; + } -// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent(); -// copyElement(src, tgt); -// for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage()) -// tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t)); -// if (src.hasIndication()) -// tgt.setIndication(convertType(src.getIndication())); -// for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics()) -// tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t)); -// return tgt; -// } -// -// public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent(); -// copyElement(src, tgt); -// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage()) -// tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t)); -// if (src.hasIndication()) -// tgt.setIndication(convertType(src.getIndication())); -// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics()) -// tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t)); -// return tgt; -// } -// -// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent(); -// copyElement(src, tgt); -// if (src.hasType()) -// tgt.setType(convertCodeableConcept(src.getType())); -// for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) -// tgt.addDosage(convertDosage(t)); -// return tgt; -// } -// -// public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent(); -// copyElement(src, tgt); -// if (src.hasType()) -// tgt.setType(convertCodeableConcept(src.getType())); -// for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) -// tgt.addDosage(convertDosage(t)); -// return tgt; -// } -// -// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(); -// copyElement(src, tgt); -// if (src.hasCharacteristic()) -// tgt.setCharacteristic(convertType(src.getCharacteristic())); -// for (org.hl7.fhir.r4.model.StringType t : src.getValue()) -// tgt.getValue().add(convertString(t)); -// return tgt; -// } -// -// public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(); -// copyElement(src, tgt); -// if (src.hasCharacteristic()) -// tgt.setCharacteristic(convertType(src.getCharacteristic())); -// for (org.hl7.fhir.r5.model.StringType t : src.getValue()) -// tgt.getValue().add(convertString(t)); -// return tgt; -// } + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage()) + // tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t)); + // if (src.hasIndication()) + // tgt.setIndication(convertType(src.getIndication())); + // for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics()) + // tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage()) + // tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t)); + // if (src.hasIndication()) + // tgt.setIndication(convertType(src.getIndication())); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics()) + // tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent(); + // copyElement(src, tgt); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) + // tgt.addDosage(convertDosage(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent(); + // copyElement(src, tgt); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) + // tgt.addDosage(convertDosage(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(); + // copyElement(src, tgt); + // if (src.hasCharacteristic()) + // tgt.setCharacteristic(convertType(src.getCharacteristic())); + // for (org.hl7.fhir.r4.model.StringType t : src.getValue()) + // tgt.getValue().add(convertString(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(); + // copyElement(src, tgt); + // if (src.hasCharacteristic()) + // tgt.setCharacteristic(convertType(src.getCharacteristic())); + // for (org.hl7.fhir.r5.model.StringType t : src.getValue()) + // tgt.getValue().add(convertString(t)); + // return tgt; + // } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasClassification()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getClassification()) tgt.addClassification(convertCodeableConcept(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getClassification()) - tgt.addClassification(convertCodeableConcept(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasClassification()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getClassification()) tgt.addClassification(convertCodeableConcept(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getClassification()) - tgt.addClassification(convertCodeableConcept(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent(); + copyElement(src, tgt); + if (src.hasRegulatoryAuthority()) + tgt.setRegulatoryAuthority(convertReference(src.getRegulatoryAuthority())); + if (src.hasSubstitution()) { + for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution()) tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t)); + } + // for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule()) + // tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t)); + if (src.hasMaxDispense()) + tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent(); - copyElement(src, tgt); - if (src.hasRegulatoryAuthority()) - tgt.setRegulatoryAuthority(convertReference(src.getRegulatoryAuthority())); - for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution()) - tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t)); -// for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule()) -// tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t)); - if (src.hasMaxDispense()) - tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense())); - return tgt; - } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent(); + copyElement(src, tgt); + if (src.hasRegulatoryAuthority()) + tgt.setRegulatoryAuthority(convertReference(src.getRegulatoryAuthority())); + if (src.hasSubstitution()) { + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution()) tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t)); + } + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule()) + // tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t)); + if (src.hasMaxDispense()) + tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense())); + return tgt; + } - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent(); - copyElement(src, tgt); - if (src.hasRegulatoryAuthority()) - tgt.setRegulatoryAuthority(convertReference(src.getRegulatoryAuthority())); - for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution()) - tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t)); -// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule()) -// tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t)); - if (src.hasMaxDispense()) - tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense())); - return tgt; - } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowedElement(convertBoolean(src.getAllowedElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAllowed()) - tgt.setAllowedElement(convertBoolean(src.getAllowedElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasAllowed()) - tgt.setAllowedElement(convertBoolean(src.getAllowedElement())); - return tgt; - } - -// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent(); -// copyElement(src, tgt); -// if (src.hasSchedule()) -// tgt.setSchedule(convertCodeableConcept(src.getSchedule())); -// return tgt; -// } -// -// public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent(); -// copyElement(src, tgt); -// if (src.hasSchedule()) -// tgt.setSchedule(convertCodeableConcept(src.getSchedule())); -// return tgt; -// } -// - public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasPeriod()) - tgt.setPeriod(convertDuration(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasPeriod()) - tgt.setPeriod(convertDuration(src.getPeriod())); - return tgt; - } - -// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent(); -// copyElement(src, tgt); -// for (org.hl7.fhir.r4.model.Quantity t : src.getAreaUnderCurve()) -// tgt.addAreaUnderCurve(convertSimpleQuantity(t)); -// for (org.hl7.fhir.r4.model.Quantity t : src.getLethalDose50()) -// tgt.addLethalDose50(convertSimpleQuantity(t)); -// if (src.hasHalfLifePeriod()) -// tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod())); -// return tgt; -// } -// -// public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException { -// if (src == null) -// return null; -// org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent(); -// copyElement(src, tgt); -// for (org.hl7.fhir.r5.model.Quantity t : src.getAreaUnderCurve()) -// tgt.addAreaUnderCurve(convertSimpleQuantity(t)); -// for (org.hl7.fhir.r5.model.Quantity t : src.getLethalDose50()) -// tgt.addLethalDose50(convertSimpleQuantity(t)); -// if (src.hasHalfLifePeriod()) -// tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod())); -// return tgt; -// } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowedElement(convertBoolean(src.getAllowedElement())); + return tgt; + } + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent(); + // copyElement(src, tgt); + // if (src.hasSchedule()) + // tgt.setSchedule(convertCodeableConcept(src.getSchedule())); + // return tgt; + // } + // + // public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent(); + // copyElement(src, tgt); + // if (src.hasSchedule()) + // tgt.setSchedule(convertCodeableConcept(src.getSchedule())); + // return tgt; + // } + // + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasPeriod()) + tgt.setPeriod(convertDuration(src.getPeriod())); + return tgt; + } + public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasPeriod()) + tgt.setPeriod(convertDuration(src.getPeriod())); + return tgt; + } + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r4.model.Quantity t : src.getAreaUnderCurve()) + // tgt.addAreaUnderCurve(convertSimpleQuantity(t)); + // for (org.hl7.fhir.r4.model.Quantity t : src.getLethalDose50()) + // tgt.addLethalDose50(convertSimpleQuantity(t)); + // if (src.hasHalfLifePeriod()) + // tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod())); + // return tgt; + // } + // + // public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r5.model.Quantity t : src.getAreaUnderCurve()) + // tgt.addAreaUnderCurve(convertSimpleQuantity(t)); + // for (org.hl7.fhir.r5.model.Quantity t : src.getLethalDose50()) + // tgt.addLethalDose50(convertSimpleQuantity(t)); + // if (src.hasHalfLifePeriod()) + // tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod())); + // return tgt; + // } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationRequest.java index 25e9eafba..95d65bfd5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationRequest.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,341 +50,406 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MedicationRequest extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r4.model.MedicationRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationRequest tgt = new org.hl7.fhir.r5.model.MedicationRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertMedicationRequestStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasIntent()) - tgt.setIntent(convertMedicationRequestIntent(src.getIntent())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertMedicationRequestPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasReportedBooleanType()) - tgt.setReportedElement(convertBoolean(src.getReportedBooleanType())); - if (src.hasReportedReference()) - tgt.setInformationSource(convertReference(src.getReportedReference())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - if (src.hasPerformerType()) - tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason().setConcept(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason().setReference(convertReference(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasCourseOfTherapyType()) - tgt.setCourseOfTherapyType(convertCodeableConcept(src.getCourseOfTherapyType())); - for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) - tgt.addDosageInstruction(convertDosage(t)); - if (src.hasDispenseRequest()) - tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); - if (src.hasSubstitution()) - tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); - if (src.hasPriorPrescription()) - tgt.setPriorPrescription(convertReference(src.getPriorPrescription())); - for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) - tgt.addDetectedIssue(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) - tgt.addEventHistory(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r5.model.MedicationRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationRequest tgt = new org.hl7.fhir.r4.model.MedicationRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertMedicationRequestStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasIntent()) - tgt.setIntent(convertMedicationRequestIntent(src.getIntent())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertMedicationRequestPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasReported()) - tgt.setReported(convertBoolean(src.getReportedElement())); - if (src.hasInformationSource()) - tgt.setReported(convertReference(src.getInformationSource())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) - tgt.addSupportingInformation(convertReference(t)); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - if (src.hasPerformerType()) - tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - for (org.hl7.fhir.r5.model.CodeableReference t : src.getReason()) { - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); + public static org.hl7.fhir.r5.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r4.model.MedicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest tgt = new org.hl7.fhir.r5.model.MedicationRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertMedicationRequestStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasIntent()) + tgt.setIntent(convertMedicationRequestIntent(src.getIntent())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertMedicationRequestPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasReportedBooleanType()) + tgt.setReportedElement(convertBoolean(src.getReportedBooleanType())); + if (src.hasReportedReference()) + tgt.setInformationSource(convertReference(src.getReportedReference())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasPerformerType()) + tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason().setConcept(convertCodeableConcept(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason().setReference(convertReference(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasCourseOfTherapyType()) + tgt.setCourseOfTherapyType(convertCodeableConcept(src.getCourseOfTherapyType())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertDosage(t)); + } + if (src.hasDispenseRequest()) + tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); + if (src.hasPriorPrescription()) + tgt.setPriorPrescription(convertReference(src.getPriorPrescription())); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory()) tgt.addEventHistory(convertReference(t)); + } + return tgt; } - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasCourseOfTherapyType()) - tgt.setCourseOfTherapyType(convertCodeableConcept(src.getCourseOfTherapyType())); - for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) - tgt.addDosageInstruction(convertDosage(t)); - if (src.hasDispenseRequest()) - tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); - if (src.hasSubstitution()) - tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); - if (src.hasPriorPrescription()) - tgt.setPriorPrescription(convertReference(src.getPriorPrescription())); - for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) - tgt.addDetectedIssue(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) - tgt.addEventHistory(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus convertMedicationRequestStatus(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ONHOLD; - case CANCELLED: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.CANCELLED; - case COMPLETED: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ENTEREDINERROR; - case STOPPED: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.STOPPED; - case DRAFT: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.DRAFT; - case UNKNOWN: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus convertMedicationRequestStatus(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ONHOLD; - case CANCELLED: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.CANCELLED; - case COMPLETED: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR; - case STOPPED: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.STOPPED; - case DRAFT: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.DRAFT; - case UNKNOWN: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent convertMedicationRequestIntent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PLAN; - case ORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.OPTION; - default: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent convertMedicationRequestIntent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PLAN; - case ORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.OPTION; - default: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertMedicationRequestPriority(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority convertMedicationRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.STAT; - default: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent(); - copyElement(src, tgt); - if (src.hasInitialFill()) - tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill())); - if (src.hasDispenseInterval()) - tgt.setDispenseInterval(convertDuration(src.getDispenseInterval())); - if (src.hasValidityPeriod()) - tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod())); - if (src.hasNumberOfRepeatsAllowed()) - tgt.setNumberOfRepeatsAllowedElement(convertUnsignedInt(src.getNumberOfRepeatsAllowedElement())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasExpectedSupplyDuration()) - tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration())); - if (src.hasPerformer()) - tgt.setDispenser(convertReference(src.getPerformer())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent(); - copyElement(src, tgt); - if (src.hasInitialFill()) - tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill())); - if (src.hasDispenseInterval()) - tgt.setDispenseInterval(convertDuration(src.getDispenseInterval())); - if (src.hasValidityPeriod()) - tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod())); - if (src.hasNumberOfRepeatsAllowed()) - tgt.setNumberOfRepeatsAllowedElement(convertUnsignedInt(src.getNumberOfRepeatsAllowedElement())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasExpectedSupplyDuration()) - tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration())); - if (src.hasDispenser()) - tgt.setPerformer(convertReference(src.getDispenser())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasDuration()) - tgt.setDuration(convertDuration(src.getDuration())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasDuration()) - tgt.setDuration(convertDuration(src.getDuration())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent(); - copyElement(src, tgt); - if (src.hasAllowed()) - tgt.setAllowed(convertType(src.getAllowed())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent(); - copyElement(src, tgt); - if (src.hasAllowed()) - tgt.setAllowed(convertType(src.getAllowed())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - return tgt; - } - + public static org.hl7.fhir.r4.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r5.model.MedicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationRequest tgt = new org.hl7.fhir.r4.model.MedicationRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertMedicationRequestStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasIntent()) + tgt.setIntent(convertMedicationRequestIntent(src.getIntent())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertMedicationRequestPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasReported()) + tgt.setReported(convertBoolean(src.getReportedElement())); + if (src.hasInformationSource()) + tgt.setReported(convertReference(src.getInformationSource())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasSupportingInformation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(convertReference(t)); + } + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasPerformerType()) + tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + for (org.hl7.fhir.r5.model.CodeableReference t : src.getReason()) { + if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasCourseOfTherapyType()) + tgt.setCourseOfTherapyType(convertCodeableConcept(src.getCourseOfTherapyType())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosageInstruction()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertDosage(t)); + } + if (src.hasDispenseRequest()) + tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); + if (src.hasPriorPrescription()) + tgt.setPriorPrescription(convertReference(src.getPriorPrescription())); + if (src.hasDetectedIssue()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) tgt.addDetectedIssue(convertReference(t)); + } + if (src.hasEventHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus convertMedicationRequestStatus(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ONHOLD; + case CANCELLED: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.CANCELLED; + case COMPLETED: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ENTEREDINERROR; + case STOPPED: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.STOPPED; + case DRAFT: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.DRAFT; + case UNKNOWN: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus convertMedicationRequestStatus(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ONHOLD; + case CANCELLED: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.CANCELLED; + case COMPLETED: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR; + case STOPPED: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.STOPPED; + case DRAFT: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.DRAFT; + case UNKNOWN: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent convertMedicationRequestIntent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PLAN; + case ORDER: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.OPTION; + default: + return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent convertMedicationRequestIntent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PLAN; + case ORDER: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.OPTION; + default: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertMedicationRequestPriority(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority convertMedicationRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.STAT; + default: + return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent(); + copyElement(src, tgt); + if (src.hasInitialFill()) + tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill())); + if (src.hasDispenseInterval()) + tgt.setDispenseInterval(convertDuration(src.getDispenseInterval())); + if (src.hasValidityPeriod()) + tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod())); + if (src.hasNumberOfRepeatsAllowed()) + tgt.setNumberOfRepeatsAllowedElement(convertUnsignedInt(src.getNumberOfRepeatsAllowedElement())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasExpectedSupplyDuration()) + tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration())); + if (src.hasPerformer()) + tgt.setDispenser(convertReference(src.getPerformer())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent(); + copyElement(src, tgt); + if (src.hasInitialFill()) + tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill())); + if (src.hasDispenseInterval()) + tgt.setDispenseInterval(convertDuration(src.getDispenseInterval())); + if (src.hasValidityPeriod()) + tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod())); + if (src.hasNumberOfRepeatsAllowed()) + tgt.setNumberOfRepeatsAllowedElement(convertUnsignedInt(src.getNumberOfRepeatsAllowedElement())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasExpectedSupplyDuration()) + tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration())); + if (src.hasDispenser()) + tgt.setPerformer(convertReference(src.getDispenser())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDuration()) + tgt.setDuration(convertDuration(src.getDuration())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasDuration()) + tgt.setDuration(convertDuration(src.getDuration())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent(); + copyElement(src, tgt); + if (src.hasAllowed()) + tgt.setAllowed(convertType(src.getAllowed())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent(); + copyElement(src, tgt); + if (src.hasAllowed()) + tgt.setAllowed(convertType(src.getAllowed())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationStatement.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationStatement.java index f8af93e12..b3609202a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationStatement.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MedicationStatement.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,129 +51,156 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MedicationStatement extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MedicationUsage convertMedicationStatement(org.hl7.fhir.r4.model.MedicationStatement src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MedicationUsage tgt = new org.hl7.fhir.r5.model.MedicationUsage(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason()) - tgt.addStatusReason(convertCodeableConcept(t)); - if (src.hasCategory()) - tgt.addCategory(convertCodeableConcept(src.getCategory())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasContext()) - tgt.setEncounter(convertReference(src.getContext())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasDateAsserted()) - tgt.setDateAssertedElement(convertDateTime(src.getDateAssertedElement())); - if (src.hasInformationSource()) - tgt.setInformationSource(convertReference(src.getInformationSource())); - for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) - tgt.addDerivedFrom(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) - tgt.addDosage(convertDosage(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MedicationStatement convertMedicationStatement(org.hl7.fhir.r5.model.MedicationUsage src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MedicationStatement tgt = new org.hl7.fhir.r4.model.MedicationStatement(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) - tgt.addStatusReason(convertCodeableConcept(t)); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); - if (src.hasMedication()) - tgt.setMedication(convertType(src.getMedication())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setContext(convertReference(src.getEncounter())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasDateAsserted()) - tgt.setDateAssertedElement(convertDateTime(src.getDateAssertedElement())); - if (src.hasInformationSource()) - tgt.setInformationSource(convertReference(src.getInformationSource())); - for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) - tgt.addDerivedFrom(convertReference(t)); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) - tgt.addDosage(convertDosage(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes convertMedicationStatementStatus(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ACTIVE; - case COMPLETED: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ENTEREDINERROR; - case INTENDED: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.INTENDED; - case STOPPED: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.STOPPED; - case ONHOLD: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ONHOLD; - case UNKNOWN: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN; - case NOTTAKEN: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NOTTAKEN; - default: return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus convertMedicationStatementStatus(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE; - case COMPLETED: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR; - case INTENDED: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED; - case STOPPED: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.STOPPED; - case ONHOLD: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ONHOLD; - case UNKNOWN: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.UNKNOWN; - case NOTTAKEN: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NOTTAKEN; - default: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.MedicationUsage convertMedicationStatement(org.hl7.fhir.r4.model.MedicationStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationUsage tgt = new org.hl7.fhir.r5.model.MedicationUsage(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + if (src.hasStatusReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason()) tgt.addStatusReason(convertCodeableConcept(t)); + } + if (src.hasCategory()) + tgt.addCategory(convertCodeableConcept(src.getCategory())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setEncounter(convertReference(src.getContext())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasDateAsserted()) + tgt.setDateAssertedElement(convertDateTime(src.getDateAssertedElement())); + if (src.hasInformationSource()) + tgt.setInformationSource(convertReference(src.getInformationSource())); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(convertReference(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosage()) { + for (org.hl7.fhir.r4.model.Dosage t : src.getDosage()) tgt.addDosage(convertDosage(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.MedicationStatement convertMedicationStatement(org.hl7.fhir.r5.model.MedicationUsage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MedicationStatement tgt = new org.hl7.fhir.r4.model.MedicationStatement(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertMedicationStatementStatus(src.getStatus())); + if (src.hasStatusReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) tgt.addStatusReason(convertCodeableConcept(t)); + } + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); + if (src.hasMedication()) + tgt.setMedication(convertType(src.getMedication())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setContext(convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasDateAsserted()) + tgt.setDateAssertedElement(convertDateTime(src.getDateAssertedElement())); + if (src.hasInformationSource()) + tgt.setInformationSource(convertReference(src.getInformationSource())); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(convertReference(t)); + } + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasDosage()) { + for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(convertDosage(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes convertMedicationStatementStatus(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ACTIVE; + case COMPLETED: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ENTEREDINERROR; + case INTENDED: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.INTENDED; + case STOPPED: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.STOPPED; + case ONHOLD: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ONHOLD; + case UNKNOWN: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN; + case NOTTAKEN: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NOTTAKEN; + default: + return org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus convertMedicationStatementStatus(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE; + case COMPLETED: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR; + case INTENDED: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED; + case STOPPED: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.STOPPED; + case ONHOLD: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ONHOLD; + case UNKNOWN: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.UNKNOWN; + case NOTTAKEN: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NOTTAKEN; + default: + return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageDefinition.java index 8291fe5e5..89bccffc5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,225 +50,256 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MessageDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MessageDefinition convertMessageDefinition(org.hl7.fhir.r4.model.MessageDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MessageDefinition tgt = new org.hl7.fhir.r5.model.MessageDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getReplaces()) - tgt.getReplaces().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasBase()) - tgt.setBaseElement(convertCanonical(src.getBaseElement())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getParent()) - tgt.getParent().add(convertCanonical(t)); - if (src.hasEvent()) - tgt.setEvent(convertType(src.getEvent())); - if (src.hasCategory()) - tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) - tgt.addFocus(convertMessageDefinitionFocusComponent(t)); - if (src.hasResponseRequired()) - tgt.setResponseRequired(convertMessageheaderResponseRequest(src.getResponseRequired())); - for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) - tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getGraph()) - tgt.getGraph().add(convertCanonical(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MessageDefinition convertMessageDefinition(org.hl7.fhir.r5.model.MessageDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MessageDefinition tgt = new org.hl7.fhir.r4.model.MessageDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) - tgt.getReplaces().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasBase()) - tgt.setBaseElement(convertCanonical(src.getBaseElement())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getParent()) - tgt.getParent().add(convertCanonical(t)); - if (src.hasEvent()) - tgt.setEvent(convertType(src.getEvent())); - if (src.hasCategory()) - tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); - for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) - tgt.addFocus(convertMessageDefinitionFocusComponent(t)); - if (src.hasResponseRequired()) - tgt.setResponseRequired(convertMessageheaderResponseRequest(src.getResponseRequired())); - for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) - tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getGraph()) - tgt.getGraph().add(convertCanonical(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory convertMessageSignificanceCategory(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CONSEQUENCE: return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE; - case CURRENCY: return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CURRENCY; - case NOTIFICATION: return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION; - default: return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NULL; - } -} - - public static org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory convertMessageSignificanceCategory(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CONSEQUENCE: return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE; - case CURRENCY: return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CURRENCY; - case NOTIFICATION: return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION; - default: return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NULL; - } -} - - public static org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest convertMessageheaderResponseRequest(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ALWAYS: return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS; - case ONERROR: return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONERROR; - case NEVER: return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NEVER; - case ONSUCCESS: return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS; - default: return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NULL; - } -} - - public static org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest convertMessageheaderResponseRequest(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ALWAYS: return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS; - case ONERROR: return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONERROR; - case NEVER: return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NEVER; - case ONSUCCESS: return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS; - default: return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NULL; - } -} - - public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent tgt = new org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - if (src.hasMin()) - tgt.setMinElement(convertUnsignedInt(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent tgt = new org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); - if (src.hasProfile()) - tgt.setProfileElement(convertCanonical(src.getProfileElement())); - if (src.hasMin()) - tgt.setMinElement(convertUnsignedInt(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent convertMessageDefinitionAllowedResponseComponent(org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent tgt = new org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent(); - copyElement(src, tgt); - if (src.hasMessage()) - tgt.setMessageElement(convertCanonical(src.getMessageElement())); - if (src.hasSituation()) - tgt.setSituationElement(convertMarkdown(src.getSituationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent convertMessageDefinitionAllowedResponseComponent(org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent tgt = new org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent(); - copyElement(src, tgt); - if (src.hasMessage()) - tgt.setMessageElement(convertCanonical(src.getMessageElement())); - if (src.hasSituation()) - tgt.setSituationElement(convertMarkdown(src.getSituationElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.MessageDefinition convertMessageDefinition(org.hl7.fhir.r4.model.MessageDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageDefinition tgt = new org.hl7.fhir.r5.model.MessageDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasReplaces()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getReplaces()) tgt.getReplaces().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasBase()) + tgt.setBaseElement(convertCanonical(src.getBaseElement())); + if (src.hasParent()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getParent()) tgt.getParent().add(convertCanonical(t)); + } + if (src.hasEvent()) + tgt.setEvent(convertType(src.getEvent())); + if (src.hasCategory()) + tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); + if (src.hasFocus()) { + for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + } + if (src.hasResponseRequired()) + tgt.setResponseRequired(convertMessageheaderResponseRequest(src.getResponseRequired())); + if (src.hasAllowedResponse()) { + for (org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + } + if (src.hasGraph()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getGraph()) tgt.getGraph().add(convertCanonical(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.MessageDefinition convertMessageDefinition(org.hl7.fhir.r5.model.MessageDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MessageDefinition tgt = new org.hl7.fhir.r4.model.MessageDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasReplaces()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) tgt.getReplaces().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasBase()) + tgt.setBaseElement(convertCanonical(src.getBaseElement())); + if (src.hasParent()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getParent()) tgt.getParent().add(convertCanonical(t)); + } + if (src.hasEvent()) + tgt.setEvent(convertType(src.getEvent())); + if (src.hasCategory()) + tgt.setCategory(convertMessageSignificanceCategory(src.getCategory())); + if (src.hasFocus()) { + for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + } + if (src.hasResponseRequired()) + tgt.setResponseRequired(convertMessageheaderResponseRequest(src.getResponseRequired())); + if (src.hasAllowedResponse()) { + for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + } + if (src.hasGraph()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getGraph()) tgt.getGraph().add(convertCanonical(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory convertMessageSignificanceCategory(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CONSEQUENCE: + return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE; + case CURRENCY: + return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CURRENCY; + case NOTIFICATION: + return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION; + default: + return org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NULL; + } + } + + public static org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory convertMessageSignificanceCategory(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CONSEQUENCE: + return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE; + case CURRENCY: + return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CURRENCY; + case NOTIFICATION: + return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION; + default: + return org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NULL; + } + } + + public static org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest convertMessageheaderResponseRequest(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ALWAYS: + return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS; + case ONERROR: + return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONERROR; + case NEVER: + return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NEVER; + case ONSUCCESS: + return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS; + default: + return org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NULL; + } + } + + public static org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest convertMessageheaderResponseRequest(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ALWAYS: + return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS; + case ONERROR: + return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONERROR; + case NEVER: + return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NEVER; + case ONSUCCESS: + return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS; + default: + return org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NULL; + } + } + + public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent tgt = new org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasMin()) + tgt.setMinElement(convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent tgt = new org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertResourceEnum(src.getCodeElement())); + if (src.hasProfile()) + tgt.setProfileElement(convertCanonical(src.getProfileElement())); + if (src.hasMin()) + tgt.setMinElement(convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent convertMessageDefinitionAllowedResponseComponent(org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent tgt = new org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent(); + copyElement(src, tgt); + if (src.hasMessage()) + tgt.setMessageElement(convertCanonical(src.getMessageElement())); + if (src.hasSituation()) + tgt.setSituationElement(convertMarkdown(src.getSituationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent convertMessageDefinitionAllowedResponseComponent(org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent tgt = new org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionAllowedResponseComponent(); + copyElement(src, tgt); + if (src.hasMessage()) + tgt.setMessageElement(convertCanonical(src.getMessageElement())); + if (src.hasSituation()) + tgt.setSituationElement(convertMarkdown(src.getSituationElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageHeader.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageHeader.java index 555c85d0d..d8f1bd8c0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageHeader.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MessageHeader.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,189 +50,196 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MessageHeader extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MessageHeader convertMessageHeader(org.hl7.fhir.r4.model.MessageHeader src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MessageHeader tgt = new org.hl7.fhir.r5.model.MessageHeader(); - copyDomainResource(src, tgt); - if (src.hasEvent()) - tgt.setEvent(convertType(src.getEvent())); - for (org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) - tgt.addDestination(convertMessageDestinationComponent(t)); - if (src.hasSender()) - tgt.setSender(convertReference(src.getSender())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - if (src.hasSource()) - tgt.setSource(convertMessageSourceComponent(src.getSource())); - if (src.hasResponsible()) - tgt.setResponsible(convertReference(src.getResponsible())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - if (src.hasResponse()) - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) - tgt.addFocus(convertReference(t)); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.MessageHeader convertMessageHeader(org.hl7.fhir.r4.model.MessageHeader src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader tgt = new org.hl7.fhir.r5.model.MessageHeader(); + copyDomainResource(src, tgt); + if (src.hasEvent()) + tgt.setEvent(convertType(src.getEvent())); + if (src.hasDestination()) { + for (org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasSender()) + tgt.setSender(convertReference(src.getSender())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(convertMessageSourceComponent(src.getSource())); + if (src.hasResponsible()) + tgt.setResponsible(convertReference(src.getResponsible())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + if (src.hasResponse()) + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + if (src.hasFocus()) { + for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) tgt.addFocus(convertReference(t)); + } + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.MessageHeader convertMessageHeader(org.hl7.fhir.r5.model.MessageHeader src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MessageHeader tgt = new org.hl7.fhir.r4.model.MessageHeader(); - copyDomainResource(src, tgt); - if (src.hasEvent()) - tgt.setEvent(convertType(src.getEvent())); - for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) - tgt.addDestination(convertMessageDestinationComponent(t)); - if (src.hasSender()) - tgt.setSender(convertReference(src.getSender())); - if (src.hasEnterer()) - tgt.setEnterer(convertReference(src.getEnterer())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - if (src.hasSource()) - tgt.setSource(convertMessageSourceComponent(src.getSource())); - if (src.hasResponsible()) - tgt.setResponsible(convertReference(src.getResponsible())); - if (src.hasReason()) - tgt.setReason(convertCodeableConcept(src.getReason())); - if (src.hasResponse()) - tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); - for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) - tgt.addFocus(convertReference(t)); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.MessageHeader convertMessageHeader(org.hl7.fhir.r5.model.MessageHeader src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MessageHeader tgt = new org.hl7.fhir.r4.model.MessageHeader(); + copyDomainResource(src, tgt); + if (src.hasEvent()) + tgt.setEvent(convertType(src.getEvent())); + if (src.hasDestination()) { + for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); + } + if (src.hasSender()) + tgt.setSender(convertReference(src.getSender())); + if (src.hasEnterer()) + tgt.setEnterer(convertReference(src.getEnterer())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(convertMessageSourceComponent(src.getSource())); + if (src.hasResponsible()) + tgt.setResponsible(convertReference(src.getResponsible())); + if (src.hasReason()) + tgt.setReason(convertCodeableConcept(src.getReason())); + if (src.hasResponse()) + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + if (src.hasFocus()) { + for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addFocus(convertReference(t)); + } + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent convertMessageDestinationComponent(org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTarget()) - tgt.setTarget(convertReference(src.getTarget())); - if (src.hasEndpoint()) - tgt.setEndpointElement(convertUrl(src.getEndpointElement())); - if (src.hasReceiver()) - tgt.setReceiver(convertReference(src.getReceiver())); - return tgt; - } + public static org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent convertMessageDestinationComponent(org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTarget()) + tgt.setTarget(convertReference(src.getTarget())); + if (src.hasEndpoint()) + tgt.setEndpointElement(convertUrl(src.getEndpointElement())); + if (src.hasReceiver()) + tgt.setReceiver(convertReference(src.getReceiver())); + return tgt; + } - public static org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent convertMessageDestinationComponent(org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTarget()) - tgt.setTarget(convertReference(src.getTarget())); - if (src.hasEndpoint()) - tgt.setEndpointElement(convertUrl(src.getEndpointElement())); - if (src.hasReceiver()) - tgt.setReceiver(convertReference(src.getReceiver())); - return tgt; - } + public static org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent convertMessageDestinationComponent(org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTarget()) + tgt.setTarget(convertReference(src.getTarget())); + if (src.hasEndpoint()) + tgt.setEndpointElement(convertUrl(src.getEndpointElement())); + if (src.hasReceiver()) + tgt.setReceiver(convertReference(src.getReceiver())); + return tgt; + } - public static org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent convertMessageSourceComponent(org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasSoftware()) - tgt.setSoftwareElement(convertString(src.getSoftwareElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasContact()) - tgt.setContact(convertContactPoint(src.getContact())); - if (src.hasEndpoint()) - tgt.setEndpointElement(convertUrl(src.getEndpointElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent convertMessageSourceComponent(org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasSoftware()) + tgt.setSoftwareElement(convertString(src.getSoftwareElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasContact()) + tgt.setContact(convertContactPoint(src.getContact())); + if (src.hasEndpoint()) + tgt.setEndpointElement(convertUrl(src.getEndpointElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent convertMessageSourceComponent(org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasSoftware()) - tgt.setSoftwareElement(convertString(src.getSoftwareElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasContact()) - tgt.setContact(convertContactPoint(src.getContact())); - if (src.hasEndpoint()) - tgt.setEndpointElement(convertUrl(src.getEndpointElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent convertMessageSourceComponent(org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageSourceComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasSoftware()) + tgt.setSoftwareElement(convertString(src.getSoftwareElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasContact()) + tgt.setContact(convertContactPoint(src.getContact())); + if (src.hasEndpoint()) + tgt.setEndpointElement(convertUrl(src.getEndpointElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifierElement(convertId(src.getIdentifierElement())); - if (src.hasCode()) - tgt.setCode(convertResponseType(src.getCode())); - if (src.hasDetails()) - tgt.setDetails(convertReference(src.getDetails())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifierElement(convertId(src.getIdentifierElement())); - if (src.hasCode()) - tgt.setCode(convertResponseType(src.getCode())); - if (src.hasDetails()) - tgt.setDetails(convertReference(src.getDetails())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MessageHeader.ResponseType convertResponseType(org.hl7.fhir.r4.model.MessageHeader.ResponseType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OK: return org.hl7.fhir.r5.model.MessageHeader.ResponseType.OK; - case TRANSIENTERROR: return org.hl7.fhir.r5.model.MessageHeader.ResponseType.TRANSIENTERROR; - case FATALERROR: return org.hl7.fhir.r5.model.MessageHeader.ResponseType.FATALERROR; - default: return org.hl7.fhir.r5.model.MessageHeader.ResponseType.NULL; - } -} - - public static org.hl7.fhir.r4.model.MessageHeader.ResponseType convertResponseType(org.hl7.fhir.r5.model.MessageHeader.ResponseType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OK: return org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK; - case TRANSIENTERROR: return org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR; - case FATALERROR: return org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR; - default: return org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL; - } -} + public static org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifierElement(convertId(src.getIdentifierElement())); + if (src.hasCode()) + tgt.setCode(convertResponseType(src.getCode())); + if (src.hasDetails()) + tgt.setDetails(convertReference(src.getDetails())); + return tgt; + } + public static org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifierElement(convertId(src.getIdentifierElement())); + if (src.hasCode()) + tgt.setCode(convertResponseType(src.getCode())); + if (src.hasDetails()) + tgt.setDetails(convertReference(src.getDetails())); + return tgt; + } + public static org.hl7.fhir.r5.model.MessageHeader.ResponseType convertResponseType(org.hl7.fhir.r4.model.MessageHeader.ResponseType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OK: + return org.hl7.fhir.r5.model.MessageHeader.ResponseType.OK; + case TRANSIENTERROR: + return org.hl7.fhir.r5.model.MessageHeader.ResponseType.TRANSIENTERROR; + case FATALERROR: + return org.hl7.fhir.r5.model.MessageHeader.ResponseType.FATALERROR; + default: + return org.hl7.fhir.r5.model.MessageHeader.ResponseType.NULL; + } + } + + public static org.hl7.fhir.r4.model.MessageHeader.ResponseType convertResponseType(org.hl7.fhir.r5.model.MessageHeader.ResponseType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OK: + return org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK; + case TRANSIENTERROR: + return org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR; + case FATALERROR: + return org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR; + default: + return org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MolecularSequence.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MolecularSequence.java index 5ff329299..24ad30970 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MolecularSequence.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/MolecularSequence.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,537 +50,598 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class MolecularSequence extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.MolecularSequence convertMolecularSequence(org.hl7.fhir.r4.model.MolecularSequence src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence tgt = new org.hl7.fhir.r5.model.MolecularSequence(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasType()) - tgt.setType(convertSequenceType(src.getType())); - if (src.hasCoordinateSystem()) - tgt.setCoordinateSystemElement(convertInteger(src.getCoordinateSystemElement())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasSpecimen()) - tgt.setSpecimen(convertReference(src.getSpecimen())); - if (src.hasDevice()) - tgt.setDevice(convertReference(src.getDevice())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - if (src.hasReferenceSeq()) - tgt.setReferenceSeq(convertMolecularSequenceReferenceSeqComponent(src.getReferenceSeq())); - for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) - tgt.addVariant(convertMolecularSequenceVariantComponent(t)); - if (src.hasObservedSeq()) - tgt.setObservedSeqElement(convertString(src.getObservedSeqElement())); - for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) - tgt.addQuality(convertMolecularSequenceQualityComponent(t)); - if (src.hasReadCoverage()) - tgt.setReadCoverageElement(convertInteger(src.getReadCoverageElement())); - for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) - tgt.addRepository(convertMolecularSequenceRepositoryComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPointer()) - tgt.addPointer(convertReference(t)); - for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent t : src.getStructureVariant()) - tgt.addStructureVariant(convertMolecularSequenceStructureVariantComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence convertMolecularSequence(org.hl7.fhir.r5.model.MolecularSequence src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence tgt = new org.hl7.fhir.r4.model.MolecularSequence(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasType()) - tgt.setType(convertSequenceType(src.getType())); - if (src.hasCoordinateSystem()) - tgt.setCoordinateSystemElement(convertInteger(src.getCoordinateSystemElement())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasSpecimen()) - tgt.setSpecimen(convertReference(src.getSpecimen())); - if (src.hasDevice()) - tgt.setDevice(convertReference(src.getDevice())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - if (src.hasReferenceSeq()) - tgt.setReferenceSeq(convertMolecularSequenceReferenceSeqComponent(src.getReferenceSeq())); - for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) - tgt.addVariant(convertMolecularSequenceVariantComponent(t)); - if (src.hasObservedSeq()) - tgt.setObservedSeqElement(convertString(src.getObservedSeqElement())); - for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) - tgt.addQuality(convertMolecularSequenceQualityComponent(t)); - if (src.hasReadCoverage()) - tgt.setReadCoverageElement(convertInteger(src.getReadCoverageElement())); - for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) - tgt.addRepository(convertMolecularSequenceRepositoryComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPointer()) - tgt.addPointer(convertReference(t)); - for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent t : src.getStructureVariant()) - tgt.addStructureVariant(convertMolecularSequenceStructureVariantComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.SequenceType convertSequenceType(org.hl7.fhir.r4.model.MolecularSequence.SequenceType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AA: return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.AA; - case DNA: return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.DNA; - case RNA: return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.RNA; - default: return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.NULL; - } -} - - public static org.hl7.fhir.r4.model.MolecularSequence.SequenceType convertSequenceType(org.hl7.fhir.r5.model.MolecularSequence.SequenceType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AA: return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.AA; - case DNA: return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.DNA; - case RNA: return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.RNA; - default: return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.NULL; - } -} - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent convertMolecularSequenceReferenceSeqComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent(); - copyElement(src, tgt); - if (src.hasChromosome()) - tgt.setChromosome(convertCodeableConcept(src.getChromosome())); - if (src.hasGenomeBuild()) - tgt.setGenomeBuildElement(convertString(src.getGenomeBuildElement())); - if (src.hasOrientation()) - tgt.setOrientation(convertOrientationType(src.getOrientation())); - if (src.hasReferenceSeqId()) - tgt.setReferenceSeqId(convertCodeableConcept(src.getReferenceSeqId())); - if (src.hasReferenceSeqPointer()) - tgt.setReferenceSeqPointer(convertReference(src.getReferenceSeqPointer())); - if (src.hasReferenceSeqString()) - tgt.setReferenceSeqStringElement(convertString(src.getReferenceSeqStringElement())); - if (src.hasStrand()) - tgt.setStrand(convertStrandType(src.getStrand())); - if (src.hasWindowStart()) - tgt.setWindowStartElement(convertInteger(src.getWindowStartElement())); - if (src.hasWindowEnd()) - tgt.setWindowEndElement(convertInteger(src.getWindowEndElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent convertMolecularSequenceReferenceSeqComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent(); - copyElement(src, tgt); - if (src.hasChromosome()) - tgt.setChromosome(convertCodeableConcept(src.getChromosome())); - if (src.hasGenomeBuild()) - tgt.setGenomeBuildElement(convertString(src.getGenomeBuildElement())); - if (src.hasOrientation()) - tgt.setOrientation(convertOrientationType(src.getOrientation())); - if (src.hasReferenceSeqId()) - tgt.setReferenceSeqId(convertCodeableConcept(src.getReferenceSeqId())); - if (src.hasReferenceSeqPointer()) - tgt.setReferenceSeqPointer(convertReference(src.getReferenceSeqPointer())); - if (src.hasReferenceSeqString()) - tgt.setReferenceSeqStringElement(convertString(src.getReferenceSeqStringElement())); - if (src.hasStrand()) - tgt.setStrand(convertStrandType(src.getStrand())); - if (src.hasWindowStart()) - tgt.setWindowStartElement(convertInteger(src.getWindowStartElement())); - if (src.hasWindowEnd()) - tgt.setWindowEndElement(convertInteger(src.getWindowEndElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.OrientationType convertOrientationType(org.hl7.fhir.r4.model.MolecularSequence.OrientationType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SENSE: return org.hl7.fhir.r5.model.MolecularSequence.OrientationType.SENSE; - case ANTISENSE: return org.hl7.fhir.r5.model.MolecularSequence.OrientationType.ANTISENSE; - default: return org.hl7.fhir.r5.model.MolecularSequence.OrientationType.NULL; - } -} - - public static org.hl7.fhir.r4.model.MolecularSequence.OrientationType convertOrientationType(org.hl7.fhir.r5.model.MolecularSequence.OrientationType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SENSE: return org.hl7.fhir.r4.model.MolecularSequence.OrientationType.SENSE; - case ANTISENSE: return org.hl7.fhir.r4.model.MolecularSequence.OrientationType.ANTISENSE; - default: return org.hl7.fhir.r4.model.MolecularSequence.OrientationType.NULL; - } -} - - public static org.hl7.fhir.r5.model.MolecularSequence.StrandType convertStrandType(org.hl7.fhir.r4.model.MolecularSequence.StrandType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case WATSON: return org.hl7.fhir.r5.model.MolecularSequence.StrandType.WATSON; - case CRICK: return org.hl7.fhir.r5.model.MolecularSequence.StrandType.CRICK; - default: return org.hl7.fhir.r5.model.MolecularSequence.StrandType.NULL; - } -} - - public static org.hl7.fhir.r4.model.MolecularSequence.StrandType convertStrandType(org.hl7.fhir.r5.model.MolecularSequence.StrandType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case WATSON: return org.hl7.fhir.r4.model.MolecularSequence.StrandType.WATSON; - case CRICK: return org.hl7.fhir.r4.model.MolecularSequence.StrandType.CRICK; - default: return org.hl7.fhir.r4.model.MolecularSequence.StrandType.NULL; - } -} - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent convertMolecularSequenceVariantComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent(); - copyElement(src, tgt); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - if (src.hasObservedAllele()) - tgt.setObservedAlleleElement(convertString(src.getObservedAlleleElement())); - if (src.hasReferenceAllele()) - tgt.setReferenceAlleleElement(convertString(src.getReferenceAlleleElement())); - if (src.hasCigar()) - tgt.setCigarElement(convertString(src.getCigarElement())); - if (src.hasVariantPointer()) - tgt.setVariantPointer(convertReference(src.getVariantPointer())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent convertMolecularSequenceVariantComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent(); - copyElement(src, tgt); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - if (src.hasObservedAllele()) - tgt.setObservedAlleleElement(convertString(src.getObservedAlleleElement())); - if (src.hasReferenceAllele()) - tgt.setReferenceAlleleElement(convertString(src.getReferenceAlleleElement())); - if (src.hasCigar()) - tgt.setCigarElement(convertString(src.getCigarElement())); - if (src.hasVariantPointer()) - tgt.setVariantPointer(convertReference(src.getVariantPointer())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent convertMolecularSequenceQualityComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertQualityType(src.getType())); - if (src.hasStandardSequence()) - tgt.setStandardSequence(convertCodeableConcept(src.getStandardSequence())); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - if (src.hasScore()) - tgt.setScore(convertQuantity(src.getScore())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasTruthTP()) - tgt.setTruthTPElement(convertDecimal(src.getTruthTPElement())); - if (src.hasQueryTP()) - tgt.setQueryTPElement(convertDecimal(src.getQueryTPElement())); - if (src.hasTruthFN()) - tgt.setTruthFNElement(convertDecimal(src.getTruthFNElement())); - if (src.hasQueryFP()) - tgt.setQueryFPElement(convertDecimal(src.getQueryFPElement())); - if (src.hasGtFP()) - tgt.setGtFPElement(convertDecimal(src.getGtFPElement())); - if (src.hasPrecision()) - tgt.setPrecisionElement(convertDecimal(src.getPrecisionElement())); - if (src.hasRecall()) - tgt.setRecallElement(convertDecimal(src.getRecallElement())); - if (src.hasFScore()) - tgt.setFScoreElement(convertDecimal(src.getFScoreElement())); - if (src.hasRoc()) - tgt.setRoc(convertMolecularSequenceQualityRocComponent(src.getRoc())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent convertMolecularSequenceQualityComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertQualityType(src.getType())); - if (src.hasStandardSequence()) - tgt.setStandardSequence(convertCodeableConcept(src.getStandardSequence())); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - if (src.hasScore()) - tgt.setScore(convertQuantity(src.getScore())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasTruthTP()) - tgt.setTruthTPElement(convertDecimal(src.getTruthTPElement())); - if (src.hasQueryTP()) - tgt.setQueryTPElement(convertDecimal(src.getQueryTPElement())); - if (src.hasTruthFN()) - tgt.setTruthFNElement(convertDecimal(src.getTruthFNElement())); - if (src.hasQueryFP()) - tgt.setQueryFPElement(convertDecimal(src.getQueryFPElement())); - if (src.hasGtFP()) - tgt.setGtFPElement(convertDecimal(src.getGtFPElement())); - if (src.hasPrecision()) - tgt.setPrecisionElement(convertDecimal(src.getPrecisionElement())); - if (src.hasRecall()) - tgt.setRecallElement(convertDecimal(src.getRecallElement())); - if (src.hasFScore()) - tgt.setFScoreElement(convertDecimal(src.getFScoreElement())); - if (src.hasRoc()) - tgt.setRoc(convertMolecularSequenceQualityRocComponent(src.getRoc())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.QualityType convertQualityType(org.hl7.fhir.r4.model.MolecularSequence.QualityType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INDEL: return org.hl7.fhir.r5.model.MolecularSequence.QualityType.INDEL; - case SNP: return org.hl7.fhir.r5.model.MolecularSequence.QualityType.SNP; - case UNKNOWN: return org.hl7.fhir.r5.model.MolecularSequence.QualityType.UNKNOWN; - default: return org.hl7.fhir.r5.model.MolecularSequence.QualityType.NULL; - } -} - - public static org.hl7.fhir.r4.model.MolecularSequence.QualityType convertQualityType(org.hl7.fhir.r5.model.MolecularSequence.QualityType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INDEL: return org.hl7.fhir.r4.model.MolecularSequence.QualityType.INDEL; - case SNP: return org.hl7.fhir.r4.model.MolecularSequence.QualityType.SNP; - case UNKNOWN: return org.hl7.fhir.r4.model.MolecularSequence.QualityType.UNKNOWN; - default: return org.hl7.fhir.r4.model.MolecularSequence.QualityType.NULL; - } -} - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent convertMolecularSequenceQualityRocComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.IntegerType t : src.getScore()) - tgt.getScore().add(convertInteger(t)); - for (org.hl7.fhir.r4.model.IntegerType t : src.getNumTP()) - tgt.getNumTP().add(convertInteger(t)); - for (org.hl7.fhir.r4.model.IntegerType t : src.getNumFP()) - tgt.getNumFP().add(convertInteger(t)); - for (org.hl7.fhir.r4.model.IntegerType t : src.getNumFN()) - tgt.getNumFN().add(convertInteger(t)); - for (org.hl7.fhir.r4.model.DecimalType t : src.getPrecision()) - tgt.getPrecision().add(convertDecimal(t)); - for (org.hl7.fhir.r4.model.DecimalType t : src.getSensitivity()) - tgt.getSensitivity().add(convertDecimal(t)); - for (org.hl7.fhir.r4.model.DecimalType t : src.getFMeasure()) - tgt.getFMeasure().add(convertDecimal(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent convertMolecularSequenceQualityRocComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.IntegerType t : src.getScore()) - tgt.getScore().add(convertInteger(t)); - for (org.hl7.fhir.r5.model.IntegerType t : src.getNumTP()) - tgt.getNumTP().add(convertInteger(t)); - for (org.hl7.fhir.r5.model.IntegerType t : src.getNumFP()) - tgt.getNumFP().add(convertInteger(t)); - for (org.hl7.fhir.r5.model.IntegerType t : src.getNumFN()) - tgt.getNumFN().add(convertInteger(t)); - for (org.hl7.fhir.r5.model.DecimalType t : src.getPrecision()) - tgt.getPrecision().add(convertDecimal(t)); - for (org.hl7.fhir.r5.model.DecimalType t : src.getSensitivity()) - tgt.getSensitivity().add(convertDecimal(t)); - for (org.hl7.fhir.r5.model.DecimalType t : src.getFMeasure()) - tgt.getFMeasure().add(convertDecimal(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent convertMolecularSequenceRepositoryComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertRepositoryType(src.getType())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDatasetId()) - tgt.setDatasetIdElement(convertString(src.getDatasetIdElement())); - if (src.hasVariantsetId()) - tgt.setVariantsetIdElement(convertString(src.getVariantsetIdElement())); - if (src.hasReadsetId()) - tgt.setReadsetIdElement(convertString(src.getReadsetIdElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent convertMolecularSequenceRepositoryComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertRepositoryType(src.getType())); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDatasetId()) - tgt.setDatasetIdElement(convertString(src.getDatasetIdElement())); - if (src.hasVariantsetId()) - tgt.setVariantsetIdElement(convertString(src.getVariantsetIdElement())); - if (src.hasReadsetId()) - tgt.setReadsetIdElement(convertString(src.getReadsetIdElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.RepositoryType convertRepositoryType(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DIRECTLINK: return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.DIRECTLINK; - case OPENAPI: return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.OPENAPI; - case LOGIN: return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.LOGIN; - case OAUTH: return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.OAUTH; - case OTHER: return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.OTHER; - default: return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.NULL; - } -} - - public static org.hl7.fhir.r4.model.MolecularSequence.RepositoryType convertRepositoryType(org.hl7.fhir.r5.model.MolecularSequence.RepositoryType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DIRECTLINK: return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.DIRECTLINK; - case OPENAPI: return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OPENAPI; - case LOGIN: return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.LOGIN; - case OAUTH: return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OAUTH; - case OTHER: return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OTHER; - default: return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.NULL; - } -} - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent convertMolecularSequenceStructureVariantComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent(); - copyElement(src, tgt); - if (src.hasVariantType()) - tgt.setVariantType(convertCodeableConcept(src.getVariantType())); - if (src.hasExact()) - tgt.setExactElement(convertBoolean(src.getExactElement())); - if (src.hasLength()) - tgt.setLengthElement(convertInteger(src.getLengthElement())); - if (src.hasOuter()) - tgt.setOuter(convertMolecularSequenceStructureVariantOuterComponent(src.getOuter())); - if (src.hasInner()) - tgt.setInner(convertMolecularSequenceStructureVariantInnerComponent(src.getInner())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent convertMolecularSequenceStructureVariantComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent(); - copyElement(src, tgt); - if (src.hasVariantType()) - tgt.setVariantType(convertCodeableConcept(src.getVariantType())); - if (src.hasExact()) - tgt.setExactElement(convertBoolean(src.getExactElement())); - if (src.hasLength()) - tgt.setLengthElement(convertInteger(src.getLengthElement())); - if (src.hasOuter()) - tgt.setOuter(convertMolecularSequenceStructureVariantOuterComponent(src.getOuter())); - if (src.hasInner()) - tgt.setInner(convertMolecularSequenceStructureVariantInnerComponent(src.getInner())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent convertMolecularSequenceStructureVariantOuterComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent(); - copyElement(src, tgt); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent convertMolecularSequenceStructureVariantOuterComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent(); - copyElement(src, tgt); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent convertMolecularSequenceStructureVariantInnerComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent(); - copyElement(src, tgt); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent convertMolecularSequenceStructureVariantInnerComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent(); - copyElement(src, tgt); - if (src.hasStart()) - tgt.setStartElement(convertInteger(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInteger(src.getEndElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.MolecularSequence convertMolecularSequence(org.hl7.fhir.r4.model.MolecularSequence src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence tgt = new org.hl7.fhir.r5.model.MolecularSequence(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasType()) + tgt.setType(convertSequenceType(src.getType())); + if (src.hasCoordinateSystem()) + tgt.setCoordinateSystemElement(convertInteger(src.getCoordinateSystemElement())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasSpecimen()) + tgt.setSpecimen(convertReference(src.getSpecimen())); + if (src.hasDevice()) + tgt.setDevice(convertReference(src.getDevice())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasReferenceSeq()) + tgt.setReferenceSeq(convertMolecularSequenceReferenceSeqComponent(src.getReferenceSeq())); + if (src.hasVariant()) { + for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertMolecularSequenceVariantComponent(t)); + } + if (src.hasObservedSeq()) + tgt.setObservedSeqElement(convertString(src.getObservedSeqElement())); + if (src.hasQuality()) { + for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertMolecularSequenceQualityComponent(t)); + } + if (src.hasReadCoverage()) + tgt.setReadCoverageElement(convertInteger(src.getReadCoverageElement())); + if (src.hasRepository()) { + for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertMolecularSequenceRepositoryComponent(t)); + } + if (src.hasPointer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPointer()) tgt.addPointer(convertReference(t)); + } + if (src.hasStructureVariant()) { + for (org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent t : src.getStructureVariant()) tgt.addStructureVariant(convertMolecularSequenceStructureVariantComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.MolecularSequence convertMolecularSequence(org.hl7.fhir.r5.model.MolecularSequence src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence tgt = new org.hl7.fhir.r4.model.MolecularSequence(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasType()) + tgt.setType(convertSequenceType(src.getType())); + if (src.hasCoordinateSystem()) + tgt.setCoordinateSystemElement(convertInteger(src.getCoordinateSystemElement())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasSpecimen()) + tgt.setSpecimen(convertReference(src.getSpecimen())); + if (src.hasDevice()) + tgt.setDevice(convertReference(src.getDevice())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasReferenceSeq()) + tgt.setReferenceSeq(convertMolecularSequenceReferenceSeqComponent(src.getReferenceSeq())); + if (src.hasVariant()) { + for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent t : src.getVariant()) tgt.addVariant(convertMolecularSequenceVariantComponent(t)); + } + if (src.hasObservedSeq()) + tgt.setObservedSeqElement(convertString(src.getObservedSeqElement())); + if (src.hasQuality()) { + for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent t : src.getQuality()) tgt.addQuality(convertMolecularSequenceQualityComponent(t)); + } + if (src.hasReadCoverage()) + tgt.setReadCoverageElement(convertInteger(src.getReadCoverageElement())); + if (src.hasRepository()) { + for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent t : src.getRepository()) tgt.addRepository(convertMolecularSequenceRepositoryComponent(t)); + } + if (src.hasPointer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPointer()) tgt.addPointer(convertReference(t)); + } + if (src.hasStructureVariant()) { + for (org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent t : src.getStructureVariant()) tgt.addStructureVariant(convertMolecularSequenceStructureVariantComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.MolecularSequence.SequenceType convertSequenceType(org.hl7.fhir.r4.model.MolecularSequence.SequenceType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AA: + return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.AA; + case DNA: + return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.DNA; + case RNA: + return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.RNA; + default: + return org.hl7.fhir.r5.model.MolecularSequence.SequenceType.NULL; + } + } + + public static org.hl7.fhir.r4.model.MolecularSequence.SequenceType convertSequenceType(org.hl7.fhir.r5.model.MolecularSequence.SequenceType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AA: + return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.AA; + case DNA: + return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.DNA; + case RNA: + return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.RNA; + default: + return org.hl7.fhir.r4.model.MolecularSequence.SequenceType.NULL; + } + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent convertMolecularSequenceReferenceSeqComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent(); + copyElement(src, tgt); + if (src.hasChromosome()) + tgt.setChromosome(convertCodeableConcept(src.getChromosome())); + if (src.hasGenomeBuild()) + tgt.setGenomeBuildElement(convertString(src.getGenomeBuildElement())); + if (src.hasOrientation()) + tgt.setOrientation(convertOrientationType(src.getOrientation())); + if (src.hasReferenceSeqId()) + tgt.setReferenceSeqId(convertCodeableConcept(src.getReferenceSeqId())); + if (src.hasReferenceSeqPointer()) + tgt.setReferenceSeqPointer(convertReference(src.getReferenceSeqPointer())); + if (src.hasReferenceSeqString()) + tgt.setReferenceSeqStringElement(convertString(src.getReferenceSeqStringElement())); + if (src.hasStrand()) + tgt.setStrand(convertStrandType(src.getStrand())); + if (src.hasWindowStart()) + tgt.setWindowStartElement(convertInteger(src.getWindowStartElement())); + if (src.hasWindowEnd()) + tgt.setWindowEndElement(convertInteger(src.getWindowEndElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent convertMolecularSequenceReferenceSeqComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceReferenceSeqComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceReferenceSeqComponent(); + copyElement(src, tgt); + if (src.hasChromosome()) + tgt.setChromosome(convertCodeableConcept(src.getChromosome())); + if (src.hasGenomeBuild()) + tgt.setGenomeBuildElement(convertString(src.getGenomeBuildElement())); + if (src.hasOrientation()) + tgt.setOrientation(convertOrientationType(src.getOrientation())); + if (src.hasReferenceSeqId()) + tgt.setReferenceSeqId(convertCodeableConcept(src.getReferenceSeqId())); + if (src.hasReferenceSeqPointer()) + tgt.setReferenceSeqPointer(convertReference(src.getReferenceSeqPointer())); + if (src.hasReferenceSeqString()) + tgt.setReferenceSeqStringElement(convertString(src.getReferenceSeqStringElement())); + if (src.hasStrand()) + tgt.setStrand(convertStrandType(src.getStrand())); + if (src.hasWindowStart()) + tgt.setWindowStartElement(convertInteger(src.getWindowStartElement())); + if (src.hasWindowEnd()) + tgt.setWindowEndElement(convertInteger(src.getWindowEndElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MolecularSequence.OrientationType convertOrientationType(org.hl7.fhir.r4.model.MolecularSequence.OrientationType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SENSE: + return org.hl7.fhir.r5.model.MolecularSequence.OrientationType.SENSE; + case ANTISENSE: + return org.hl7.fhir.r5.model.MolecularSequence.OrientationType.ANTISENSE; + default: + return org.hl7.fhir.r5.model.MolecularSequence.OrientationType.NULL; + } + } + + public static org.hl7.fhir.r4.model.MolecularSequence.OrientationType convertOrientationType(org.hl7.fhir.r5.model.MolecularSequence.OrientationType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SENSE: + return org.hl7.fhir.r4.model.MolecularSequence.OrientationType.SENSE; + case ANTISENSE: + return org.hl7.fhir.r4.model.MolecularSequence.OrientationType.ANTISENSE; + default: + return org.hl7.fhir.r4.model.MolecularSequence.OrientationType.NULL; + } + } + + public static org.hl7.fhir.r5.model.MolecularSequence.StrandType convertStrandType(org.hl7.fhir.r4.model.MolecularSequence.StrandType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case WATSON: + return org.hl7.fhir.r5.model.MolecularSequence.StrandType.WATSON; + case CRICK: + return org.hl7.fhir.r5.model.MolecularSequence.StrandType.CRICK; + default: + return org.hl7.fhir.r5.model.MolecularSequence.StrandType.NULL; + } + } + + public static org.hl7.fhir.r4.model.MolecularSequence.StrandType convertStrandType(org.hl7.fhir.r5.model.MolecularSequence.StrandType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case WATSON: + return org.hl7.fhir.r4.model.MolecularSequence.StrandType.WATSON; + case CRICK: + return org.hl7.fhir.r4.model.MolecularSequence.StrandType.CRICK; + default: + return org.hl7.fhir.r4.model.MolecularSequence.StrandType.NULL; + } + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent convertMolecularSequenceVariantComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent(); + copyElement(src, tgt); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + if (src.hasObservedAllele()) + tgt.setObservedAlleleElement(convertString(src.getObservedAlleleElement())); + if (src.hasReferenceAllele()) + tgt.setReferenceAlleleElement(convertString(src.getReferenceAlleleElement())); + if (src.hasCigar()) + tgt.setCigarElement(convertString(src.getCigarElement())); + if (src.hasVariantPointer()) + tgt.setVariantPointer(convertReference(src.getVariantPointer())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent convertMolecularSequenceVariantComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceVariantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent(); + copyElement(src, tgt); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + if (src.hasObservedAllele()) + tgt.setObservedAlleleElement(convertString(src.getObservedAlleleElement())); + if (src.hasReferenceAllele()) + tgt.setReferenceAlleleElement(convertString(src.getReferenceAlleleElement())); + if (src.hasCigar()) + tgt.setCigarElement(convertString(src.getCigarElement())); + if (src.hasVariantPointer()) + tgt.setVariantPointer(convertReference(src.getVariantPointer())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent convertMolecularSequenceQualityComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertQualityType(src.getType())); + if (src.hasStandardSequence()) + tgt.setStandardSequence(convertCodeableConcept(src.getStandardSequence())); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + if (src.hasScore()) + tgt.setScore(convertQuantity(src.getScore())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasTruthTP()) + tgt.setTruthTPElement(convertDecimal(src.getTruthTPElement())); + if (src.hasQueryTP()) + tgt.setQueryTPElement(convertDecimal(src.getQueryTPElement())); + if (src.hasTruthFN()) + tgt.setTruthFNElement(convertDecimal(src.getTruthFNElement())); + if (src.hasQueryFP()) + tgt.setQueryFPElement(convertDecimal(src.getQueryFPElement())); + if (src.hasGtFP()) + tgt.setGtFPElement(convertDecimal(src.getGtFPElement())); + if (src.hasPrecision()) + tgt.setPrecisionElement(convertDecimal(src.getPrecisionElement())); + if (src.hasRecall()) + tgt.setRecallElement(convertDecimal(src.getRecallElement())); + if (src.hasFScore()) + tgt.setFScoreElement(convertDecimal(src.getFScoreElement())); + if (src.hasRoc()) + tgt.setRoc(convertMolecularSequenceQualityRocComponent(src.getRoc())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent convertMolecularSequenceQualityComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertQualityType(src.getType())); + if (src.hasStandardSequence()) + tgt.setStandardSequence(convertCodeableConcept(src.getStandardSequence())); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + if (src.hasScore()) + tgt.setScore(convertQuantity(src.getScore())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasTruthTP()) + tgt.setTruthTPElement(convertDecimal(src.getTruthTPElement())); + if (src.hasQueryTP()) + tgt.setQueryTPElement(convertDecimal(src.getQueryTPElement())); + if (src.hasTruthFN()) + tgt.setTruthFNElement(convertDecimal(src.getTruthFNElement())); + if (src.hasQueryFP()) + tgt.setQueryFPElement(convertDecimal(src.getQueryFPElement())); + if (src.hasGtFP()) + tgt.setGtFPElement(convertDecimal(src.getGtFPElement())); + if (src.hasPrecision()) + tgt.setPrecisionElement(convertDecimal(src.getPrecisionElement())); + if (src.hasRecall()) + tgt.setRecallElement(convertDecimal(src.getRecallElement())); + if (src.hasFScore()) + tgt.setFScoreElement(convertDecimal(src.getFScoreElement())); + if (src.hasRoc()) + tgt.setRoc(convertMolecularSequenceQualityRocComponent(src.getRoc())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MolecularSequence.QualityType convertQualityType(org.hl7.fhir.r4.model.MolecularSequence.QualityType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INDEL: + return org.hl7.fhir.r5.model.MolecularSequence.QualityType.INDEL; + case SNP: + return org.hl7.fhir.r5.model.MolecularSequence.QualityType.SNP; + case UNKNOWN: + return org.hl7.fhir.r5.model.MolecularSequence.QualityType.UNKNOWN; + default: + return org.hl7.fhir.r5.model.MolecularSequence.QualityType.NULL; + } + } + + public static org.hl7.fhir.r4.model.MolecularSequence.QualityType convertQualityType(org.hl7.fhir.r5.model.MolecularSequence.QualityType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INDEL: + return org.hl7.fhir.r4.model.MolecularSequence.QualityType.INDEL; + case SNP: + return org.hl7.fhir.r4.model.MolecularSequence.QualityType.SNP; + case UNKNOWN: + return org.hl7.fhir.r4.model.MolecularSequence.QualityType.UNKNOWN; + default: + return org.hl7.fhir.r4.model.MolecularSequence.QualityType.NULL; + } + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent convertMolecularSequenceQualityRocComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent(); + copyElement(src, tgt); + if (src.hasScore()) { + for (org.hl7.fhir.r4.model.IntegerType t : src.getScore()) tgt.getScore().add(convertInteger(t)); + } + if (src.hasNumTP()) { + for (org.hl7.fhir.r4.model.IntegerType t : src.getNumTP()) tgt.getNumTP().add(convertInteger(t)); + } + if (src.hasNumFP()) { + for (org.hl7.fhir.r4.model.IntegerType t : src.getNumFP()) tgt.getNumFP().add(convertInteger(t)); + } + if (src.hasNumFN()) { + for (org.hl7.fhir.r4.model.IntegerType t : src.getNumFN()) tgt.getNumFN().add(convertInteger(t)); + } + if (src.hasPrecision()) { + for (org.hl7.fhir.r4.model.DecimalType t : src.getPrecision()) tgt.getPrecision().add(convertDecimal(t)); + } + if (src.hasSensitivity()) { + for (org.hl7.fhir.r4.model.DecimalType t : src.getSensitivity()) tgt.getSensitivity().add(convertDecimal(t)); + } + if (src.hasFMeasure()) { + for (org.hl7.fhir.r4.model.DecimalType t : src.getFMeasure()) tgt.getFMeasure().add(convertDecimal(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent convertMolecularSequenceQualityRocComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceQualityRocComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceQualityRocComponent(); + copyElement(src, tgt); + if (src.hasScore()) { + for (org.hl7.fhir.r5.model.IntegerType t : src.getScore()) tgt.getScore().add(convertInteger(t)); + } + if (src.hasNumTP()) { + for (org.hl7.fhir.r5.model.IntegerType t : src.getNumTP()) tgt.getNumTP().add(convertInteger(t)); + } + if (src.hasNumFP()) { + for (org.hl7.fhir.r5.model.IntegerType t : src.getNumFP()) tgt.getNumFP().add(convertInteger(t)); + } + if (src.hasNumFN()) { + for (org.hl7.fhir.r5.model.IntegerType t : src.getNumFN()) tgt.getNumFN().add(convertInteger(t)); + } + if (src.hasPrecision()) { + for (org.hl7.fhir.r5.model.DecimalType t : src.getPrecision()) tgt.getPrecision().add(convertDecimal(t)); + } + if (src.hasSensitivity()) { + for (org.hl7.fhir.r5.model.DecimalType t : src.getSensitivity()) tgt.getSensitivity().add(convertDecimal(t)); + } + if (src.hasFMeasure()) { + for (org.hl7.fhir.r5.model.DecimalType t : src.getFMeasure()) tgt.getFMeasure().add(convertDecimal(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent convertMolecularSequenceRepositoryComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertRepositoryType(src.getType())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDatasetId()) + tgt.setDatasetIdElement(convertString(src.getDatasetIdElement())); + if (src.hasVariantsetId()) + tgt.setVariantsetIdElement(convertString(src.getVariantsetIdElement())); + if (src.hasReadsetId()) + tgt.setReadsetIdElement(convertString(src.getReadsetIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent convertMolecularSequenceRepositoryComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceRepositoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceRepositoryComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertRepositoryType(src.getType())); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDatasetId()) + tgt.setDatasetIdElement(convertString(src.getDatasetIdElement())); + if (src.hasVariantsetId()) + tgt.setVariantsetIdElement(convertString(src.getVariantsetIdElement())); + if (src.hasReadsetId()) + tgt.setReadsetIdElement(convertString(src.getReadsetIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MolecularSequence.RepositoryType convertRepositoryType(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DIRECTLINK: + return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.DIRECTLINK; + case OPENAPI: + return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.OPENAPI; + case LOGIN: + return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.LOGIN; + case OAUTH: + return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.OAUTH; + case OTHER: + return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.OTHER; + default: + return org.hl7.fhir.r5.model.MolecularSequence.RepositoryType.NULL; + } + } + + public static org.hl7.fhir.r4.model.MolecularSequence.RepositoryType convertRepositoryType(org.hl7.fhir.r5.model.MolecularSequence.RepositoryType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DIRECTLINK: + return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.DIRECTLINK; + case OPENAPI: + return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OPENAPI; + case LOGIN: + return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.LOGIN; + case OAUTH: + return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OAUTH; + case OTHER: + return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OTHER; + default: + return org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.NULL; + } + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent convertMolecularSequenceStructureVariantComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent(); + copyElement(src, tgt); + if (src.hasVariantType()) + tgt.setVariantType(convertCodeableConcept(src.getVariantType())); + if (src.hasExact()) + tgt.setExactElement(convertBoolean(src.getExactElement())); + if (src.hasLength()) + tgt.setLengthElement(convertInteger(src.getLengthElement())); + if (src.hasOuter()) + tgt.setOuter(convertMolecularSequenceStructureVariantOuterComponent(src.getOuter())); + if (src.hasInner()) + tgt.setInner(convertMolecularSequenceStructureVariantInnerComponent(src.getInner())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent convertMolecularSequenceStructureVariantComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantComponent(); + copyElement(src, tgt); + if (src.hasVariantType()) + tgt.setVariantType(convertCodeableConcept(src.getVariantType())); + if (src.hasExact()) + tgt.setExactElement(convertBoolean(src.getExactElement())); + if (src.hasLength()) + tgt.setLengthElement(convertInteger(src.getLengthElement())); + if (src.hasOuter()) + tgt.setOuter(convertMolecularSequenceStructureVariantOuterComponent(src.getOuter())); + if (src.hasInner()) + tgt.setInner(convertMolecularSequenceStructureVariantInnerComponent(src.getInner())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent convertMolecularSequenceStructureVariantOuterComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent(); + copyElement(src, tgt); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent convertMolecularSequenceStructureVariantOuterComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantOuterComponent(); + copyElement(src, tgt); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent convertMolecularSequenceStructureVariantInnerComponent(org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent tgt = new org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent(); + copyElement(src, tgt); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent convertMolecularSequenceStructureVariantInnerComponent(org.hl7.fhir.r5.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent tgt = new org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceStructureVariantInnerComponent(); + copyElement(src, tgt); + if (src.hasStart()) + tgt.setStartElement(convertInteger(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInteger(src.getEndElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NamingSystem.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NamingSystem.java index 14174188b..bdc153e4b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NamingSystem.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NamingSystem.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,161 +50,182 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class NamingSystem extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.NamingSystem convertNamingSystem(org.hl7.fhir.r4.model.NamingSystem src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NamingSystem tgt = new org.hl7.fhir.r5.model.NamingSystem(); - copyDomainResource(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasKind()) - tgt.setKind(convertNamingSystemType(src.getKind())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasResponsible()) - tgt.setResponsibleElement(convertString(src.getResponsibleElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) - tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.NamingSystem convertNamingSystem(org.hl7.fhir.r5.model.NamingSystem src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NamingSystem tgt = new org.hl7.fhir.r4.model.NamingSystem(); - copyDomainResource(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasKind()) - tgt.setKind(convertNamingSystemType(src.getKind())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasResponsible()) - tgt.setResponsibleElement(convertString(src.getResponsibleElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) - tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemType convertNamingSystemType(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CODESYSTEM: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.CODESYSTEM; - case IDENTIFIER: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.IDENTIFIER; - case ROOT: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.ROOT; - default: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.NULL; - } -} - - public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemType convertNamingSystemType(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CODESYSTEM: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM; - case IDENTIFIER: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER; - case ROOT: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT; - default: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL; - } -} - - public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasPreferred()) - tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertNamingSystemIdentifierType(src.getType())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasPreferred()) - tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } - - public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType convertNamingSystemIdentifierType(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OID: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OID; - case UUID: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.UUID; - case URI: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.URI; - case OTHER: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OTHER; - default: return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.NULL; - } -} - - public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType convertNamingSystemIdentifierType(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OID: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID; - case UUID: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID; - case URI: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI; - case OTHER: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER; - default: return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL; - } -} + public static org.hl7.fhir.r5.model.NamingSystem convertNamingSystem(org.hl7.fhir.r4.model.NamingSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NamingSystem tgt = new org.hl7.fhir.r5.model.NamingSystem(); + copyDomainResource(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasKind()) + tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasResponsible()) + tgt.setResponsibleElement(convertString(src.getResponsibleElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasUniqueId()) { + for (org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.NamingSystem convertNamingSystem(org.hl7.fhir.r5.model.NamingSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NamingSystem tgt = new org.hl7.fhir.r4.model.NamingSystem(); + copyDomainResource(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasKind()) + tgt.setKind(convertNamingSystemType(src.getKind())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasResponsible()) + tgt.setResponsibleElement(convertString(src.getResponsibleElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasUniqueId()) { + for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemType convertNamingSystemType(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CODESYSTEM: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.CODESYSTEM; + case IDENTIFIER: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.IDENTIFIER; + case ROOT: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.ROOT; + default: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.NULL; + } + } + + public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemType convertNamingSystemType(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CODESYSTEM: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM; + case IDENTIFIER: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER; + case ROOT: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT; + default: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL; + } + } + + public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasPreferred()) + tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertNamingSystemIdentifierType(src.getType())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasPreferred()) + tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType convertNamingSystemIdentifierType(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OID: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OID; + case UUID: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.UUID; + case URI: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.URI; + case OTHER: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OTHER; + default: + return org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.NULL; + } + } + + public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType convertNamingSystemIdentifierType(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OID: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID; + case UUID: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID; + case URI: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI; + case OTHER: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER; + default: + return org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NutritionOrder.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NutritionOrder.java index 892669ca4..0ce790ce6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NutritionOrder.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/NutritionOrder.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,363 +50,426 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class NutritionOrder extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.NutritionOrder convertNutritionOrder(org.hl7.fhir.r4.model.NutritionOrder src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NutritionOrder tgt = new org.hl7.fhir.r5.model.NutritionOrder(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) - tgt.getInstantiates().add(convertUri(t)); - if (src.hasStatus()) - tgt.setStatus(convertNutritionOrderStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertNutritiionOrderIntent(src.getIntent())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDateTime()) - tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); - if (src.hasOrderer()) - tgt.setOrderer(convertReference(src.getOrderer())); - for (org.hl7.fhir.r4.model.Reference t : src.getAllergyIntolerance()) - tgt.addAllergyIntolerance(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFoodPreferenceModifier()) - tgt.addFoodPreferenceModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getExcludeFoodModifier()) - tgt.addExcludeFoodModifier(convertCodeableConcept(t)); - if (src.hasOralDiet()) - tgt.setOralDiet(convertNutritionOrderOralDietComponent(src.getOralDiet())); - for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent t : src.getSupplement()) - tgt.addSupplement(convertNutritionOrderSupplementComponent(t)); - if (src.hasEnteralFormula()) - tgt.setEnteralFormula(convertNutritionOrderEnteralFormulaComponent(src.getEnteralFormula())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.NutritionOrder convertNutritionOrder(org.hl7.fhir.r5.model.NutritionOrder src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NutritionOrder tgt = new org.hl7.fhir.r4.model.NutritionOrder(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiates()) - tgt.getInstantiates().add(convertUri(t)); - if (src.hasStatus()) - tgt.setStatus(convertNutritionOrderStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertNutritiionOrderIntent(src.getIntent())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDateTime()) - tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); - if (src.hasOrderer()) - tgt.setOrderer(convertReference(src.getOrderer())); - for (org.hl7.fhir.r5.model.Reference t : src.getAllergyIntolerance()) - tgt.addAllergyIntolerance(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFoodPreferenceModifier()) - tgt.addFoodPreferenceModifier(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getExcludeFoodModifier()) - tgt.addExcludeFoodModifier(convertCodeableConcept(t)); - if (src.hasOralDiet()) - tgt.setOralDiet(convertNutritionOrderOralDietComponent(src.getOralDiet())); - for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent t : src.getSupplement()) - tgt.addSupplement(convertNutritionOrderSupplementComponent(t)); - if (src.hasEnteralFormula()) - tgt.setEnteralFormula(convertNutritionOrderEnteralFormulaComponent(src.getEnteralFormula())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertNutritionOrderStatus(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus convertNutritionOrderStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertNutritiionOrderIntent(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; - default: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent convertNutritiionOrderIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.OPTION; - default: return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Timing t : src.getSchedule()) - tgt.addSchedule(convertTiming(t)); - for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent t : src.getNutrient()) - tgt.addNutrient(convertNutritionOrderOralDietNutrientComponent(t)); - for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent t : src.getTexture()) - tgt.addTexture(convertNutritionOrderOralDietTextureComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFluidConsistencyType()) - tgt.addFluidConsistencyType(convertCodeableConcept(t)); - if (src.hasInstruction()) - tgt.setInstructionElement(convertString(src.getInstructionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Timing t : src.getSchedule()) - tgt.addSchedule(convertTiming(t)); - for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent t : src.getNutrient()) - tgt.addNutrient(convertNutritionOrderOralDietNutrientComponent(t)); - for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent t : src.getTexture()) - tgt.addTexture(convertNutritionOrderOralDietTextureComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFluidConsistencyType()) - tgt.addFluidConsistencyType(convertCodeableConcept(t)); - if (src.hasInstruction()) - tgt.setInstructionElement(convertString(src.getInstructionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent(); - copyElement(src, tgt); - if (src.hasModifier()) - tgt.setModifier(convertCodeableConcept(src.getModifier())); - if (src.hasAmount()) - tgt.setAmount(convertSimpleQuantity(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent(); - copyElement(src, tgt); - if (src.hasModifier()) - tgt.setModifier(convertCodeableConcept(src.getModifier())); - if (src.hasAmount()) - tgt.setAmount(convertSimpleQuantity(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent convertNutritionOrderOralDietTextureComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent(); - copyElement(src, tgt); - if (src.hasModifier()) - tgt.setModifier(convertCodeableConcept(src.getModifier())); - if (src.hasFoodType()) - tgt.setFoodType(convertCodeableConcept(src.getFoodType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent convertNutritionOrderOralDietTextureComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent(); - copyElement(src, tgt); - if (src.hasModifier()) - tgt.setModifier(convertCodeableConcept(src.getModifier())); - if (src.hasFoodType()) - tgt.setFoodType(convertCodeableConcept(src.getFoodType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent convertNutritionOrderSupplementComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasProductName()) - tgt.setProductNameElement(convertString(src.getProductNameElement())); - for (org.hl7.fhir.r4.model.Timing t : src.getSchedule()) - tgt.addSchedule(convertTiming(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasInstruction()) - tgt.setInstructionElement(convertString(src.getInstructionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent convertNutritionOrderSupplementComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasProductName()) - tgt.setProductNameElement(convertString(src.getProductNameElement())); - for (org.hl7.fhir.r5.model.Timing t : src.getSchedule()) - tgt.addSchedule(convertTiming(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasInstruction()) - tgt.setInstructionElement(convertString(src.getInstructionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent(); - copyElement(src, tgt); - if (src.hasBaseFormulaType()) - tgt.setBaseFormulaType(convertCodeableConcept(src.getBaseFormulaType())); - if (src.hasBaseFormulaProductName()) - tgt.setBaseFormulaProductNameElement(convertString(src.getBaseFormulaProductNameElement())); - if (src.hasAdditiveType()) - tgt.setAdditiveType(convertCodeableConcept(src.getAdditiveType())); - if (src.hasAdditiveProductName()) - tgt.setAdditiveProductNameElement(convertString(src.getAdditiveProductNameElement())); - if (src.hasCaloricDensity()) - tgt.setCaloricDensity(convertSimpleQuantity(src.getCaloricDensity())); - if (src.hasRouteofAdministration()) - tgt.setRouteofAdministration(convertCodeableConcept(src.getRouteofAdministration())); - for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent t : src.getAdministration()) - tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t)); - if (src.hasMaxVolumeToDeliver()) - tgt.setMaxVolumeToDeliver(convertSimpleQuantity(src.getMaxVolumeToDeliver())); - if (src.hasAdministrationInstruction()) - tgt.setAdministrationInstructionElement(convertString(src.getAdministrationInstructionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent(); - copyElement(src, tgt); - if (src.hasBaseFormulaType()) - tgt.setBaseFormulaType(convertCodeableConcept(src.getBaseFormulaType())); - if (src.hasBaseFormulaProductName()) - tgt.setBaseFormulaProductNameElement(convertString(src.getBaseFormulaProductNameElement())); - if (src.hasAdditiveType()) - tgt.setAdditiveType(convertCodeableConcept(src.getAdditiveType())); - if (src.hasAdditiveProductName()) - tgt.setAdditiveProductNameElement(convertString(src.getAdditiveProductNameElement())); - if (src.hasCaloricDensity()) - tgt.setCaloricDensity(convertSimpleQuantity(src.getCaloricDensity())); - if (src.hasRouteofAdministration()) - tgt.setRouteofAdministration(convertCodeableConcept(src.getRouteofAdministration())); - for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent t : src.getAdministration()) - tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t)); - if (src.hasMaxVolumeToDeliver()) - tgt.setMaxVolumeToDeliver(convertSimpleQuantity(src.getMaxVolumeToDeliver())); - if (src.hasAdministrationInstruction()) - tgt.setAdministrationInstructionElement(convertString(src.getAdministrationInstructionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent convertNutritionOrderEnteralFormulaAdministrationComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent(); - copyElement(src, tgt); - if (src.hasSchedule()) - tgt.setSchedule(convertTiming(src.getSchedule())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasRate()) - tgt.setRate(convertType(src.getRate())); - return tgt; - } - - public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent convertNutritionOrderEnteralFormulaAdministrationComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent(); - copyElement(src, tgt); - if (src.hasSchedule()) - tgt.setSchedule(convertTiming(src.getSchedule())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasRate()) - tgt.setRate(convertType(src.getRate())); - return tgt; - } + public static org.hl7.fhir.r5.model.NutritionOrder convertNutritionOrder(org.hl7.fhir.r4.model.NutritionOrder src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder tgt = new org.hl7.fhir.r5.model.NutritionOrder(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasInstantiates()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) tgt.getInstantiates().add(convertUri(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertNutritionOrderStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertNutritiionOrderIntent(src.getIntent())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDateTime()) + tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); + if (src.hasOrderer()) + tgt.setOrderer(convertReference(src.getOrderer())); + if (src.hasAllergyIntolerance()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAllergyIntolerance()) tgt.addAllergyIntolerance(convertReference(t)); + } + if (src.hasFoodPreferenceModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFoodPreferenceModifier()) tgt.addFoodPreferenceModifier(convertCodeableConcept(t)); + } + if (src.hasExcludeFoodModifier()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getExcludeFoodModifier()) tgt.addExcludeFoodModifier(convertCodeableConcept(t)); + } + if (src.hasOralDiet()) + tgt.setOralDiet(convertNutritionOrderOralDietComponent(src.getOralDiet())); + if (src.hasSupplement()) { + for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent t : src.getSupplement()) tgt.addSupplement(convertNutritionOrderSupplementComponent(t)); + } + if (src.hasEnteralFormula()) + tgt.setEnteralFormula(convertNutritionOrderEnteralFormulaComponent(src.getEnteralFormula())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.NutritionOrder convertNutritionOrder(org.hl7.fhir.r5.model.NutritionOrder src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NutritionOrder tgt = new org.hl7.fhir.r4.model.NutritionOrder(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasInstantiates()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiates()) tgt.getInstantiates().add(convertUri(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertNutritionOrderStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertNutritiionOrderIntent(src.getIntent())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDateTime()) + tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement())); + if (src.hasOrderer()) + tgt.setOrderer(convertReference(src.getOrderer())); + if (src.hasAllergyIntolerance()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAllergyIntolerance()) tgt.addAllergyIntolerance(convertReference(t)); + } + if (src.hasFoodPreferenceModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFoodPreferenceModifier()) tgt.addFoodPreferenceModifier(convertCodeableConcept(t)); + } + if (src.hasExcludeFoodModifier()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getExcludeFoodModifier()) tgt.addExcludeFoodModifier(convertCodeableConcept(t)); + } + if (src.hasOralDiet()) + tgt.setOralDiet(convertNutritionOrderOralDietComponent(src.getOralDiet())); + if (src.hasSupplement()) { + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent t : src.getSupplement()) tgt.addSupplement(convertNutritionOrderSupplementComponent(t)); + } + if (src.hasEnteralFormula()) + tgt.setEnteralFormula(convertNutritionOrderEnteralFormulaComponent(src.getEnteralFormula())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertNutritionOrderStatus(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus convertNutritionOrderStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertNutritiionOrderIntent(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent convertNutritiionOrderIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.OPTION; + default: + return org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent(); + copyElement(src, tgt); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasSchedule()) { + for (org.hl7.fhir.r4.model.Timing t : src.getSchedule()) tgt.addSchedule(convertTiming(t)); + } + if (src.hasNutrient()) { + for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent t : src.getNutrient()) tgt.addNutrient(convertNutritionOrderOralDietNutrientComponent(t)); + } + if (src.hasTexture()) { + for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent t : src.getTexture()) tgt.addTexture(convertNutritionOrderOralDietTextureComponent(t)); + } + if (src.hasFluidConsistencyType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFluidConsistencyType()) tgt.addFluidConsistencyType(convertCodeableConcept(t)); + } + if (src.hasInstruction()) + tgt.setInstructionElement(convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent(); + copyElement(src, tgt); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasSchedule()) { + for (org.hl7.fhir.r5.model.Timing t : src.getSchedule()) tgt.addSchedule(convertTiming(t)); + } + if (src.hasNutrient()) { + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent t : src.getNutrient()) tgt.addNutrient(convertNutritionOrderOralDietNutrientComponent(t)); + } + if (src.hasTexture()) { + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent t : src.getTexture()) tgt.addTexture(convertNutritionOrderOralDietTextureComponent(t)); + } + if (src.hasFluidConsistencyType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFluidConsistencyType()) tgt.addFluidConsistencyType(convertCodeableConcept(t)); + } + if (src.hasInstruction()) + tgt.setInstructionElement(convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent(); + copyElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(convertCodeableConcept(src.getModifier())); + if (src.hasAmount()) + tgt.setAmount(convertSimpleQuantity(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietNutrientComponent(); + copyElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(convertCodeableConcept(src.getModifier())); + if (src.hasAmount()) + tgt.setAmount(convertSimpleQuantity(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent convertNutritionOrderOralDietTextureComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent(); + copyElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(convertCodeableConcept(src.getModifier())); + if (src.hasFoodType()) + tgt.setFoodType(convertCodeableConcept(src.getFoodType())); + return tgt; + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent convertNutritionOrderOralDietTextureComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietTextureComponent(); + copyElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(convertCodeableConcept(src.getModifier())); + if (src.hasFoodType()) + tgt.setFoodType(convertCodeableConcept(src.getFoodType())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent convertNutritionOrderSupplementComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasProductName()) + tgt.setProductNameElement(convertString(src.getProductNameElement())); + if (src.hasSchedule()) { + for (org.hl7.fhir.r4.model.Timing t : src.getSchedule()) tgt.addSchedule(convertTiming(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasInstruction()) + tgt.setInstructionElement(convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent convertNutritionOrderSupplementComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderSupplementComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasProductName()) + tgt.setProductNameElement(convertString(src.getProductNameElement())); + if (src.hasSchedule()) { + for (org.hl7.fhir.r5.model.Timing t : src.getSchedule()) tgt.addSchedule(convertTiming(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasInstruction()) + tgt.setInstructionElement(convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent(); + copyElement(src, tgt); + if (src.hasBaseFormulaType()) + tgt.setBaseFormulaType(convertCodeableConcept(src.getBaseFormulaType())); + if (src.hasBaseFormulaProductName()) + tgt.setBaseFormulaProductNameElement(convertString(src.getBaseFormulaProductNameElement())); + if (src.hasAdditiveType()) + tgt.setAdditiveType(convertCodeableConcept(src.getAdditiveType())); + if (src.hasAdditiveProductName()) + tgt.setAdditiveProductNameElement(convertString(src.getAdditiveProductNameElement())); + if (src.hasCaloricDensity()) + tgt.setCaloricDensity(convertSimpleQuantity(src.getCaloricDensity())); + if (src.hasRouteofAdministration()) + tgt.setRouteofAdministration(convertCodeableConcept(src.getRouteofAdministration())); + if (src.hasAdministration()) { + for (org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent t : src.getAdministration()) tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t)); + } + if (src.hasMaxVolumeToDeliver()) + tgt.setMaxVolumeToDeliver(convertSimpleQuantity(src.getMaxVolumeToDeliver())); + if (src.hasAdministrationInstruction()) + tgt.setAdministrationInstructionElement(convertString(src.getAdministrationInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaComponent(); + copyElement(src, tgt); + if (src.hasBaseFormulaType()) + tgt.setBaseFormulaType(convertCodeableConcept(src.getBaseFormulaType())); + if (src.hasBaseFormulaProductName()) + tgt.setBaseFormulaProductNameElement(convertString(src.getBaseFormulaProductNameElement())); + if (src.hasAdditiveType()) + tgt.setAdditiveType(convertCodeableConcept(src.getAdditiveType())); + if (src.hasAdditiveProductName()) + tgt.setAdditiveProductNameElement(convertString(src.getAdditiveProductNameElement())); + if (src.hasCaloricDensity()) + tgt.setCaloricDensity(convertSimpleQuantity(src.getCaloricDensity())); + if (src.hasRouteofAdministration()) + tgt.setRouteofAdministration(convertCodeableConcept(src.getRouteofAdministration())); + if (src.hasAdministration()) { + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent t : src.getAdministration()) tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t)); + } + if (src.hasMaxVolumeToDeliver()) + tgt.setMaxVolumeToDeliver(convertSimpleQuantity(src.getMaxVolumeToDeliver())); + if (src.hasAdministrationInstruction()) + tgt.setAdministrationInstructionElement(convertString(src.getAdministrationInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent convertNutritionOrderEnteralFormulaAdministrationComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent(); + copyElement(src, tgt); + if (src.hasSchedule()) + tgt.setSchedule(convertTiming(src.getSchedule())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasRate()) + tgt.setRate(convertType(src.getRate())); + return tgt; + } + + public static org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent convertNutritionOrderEnteralFormulaAdministrationComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent tgt = new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent(); + copyElement(src, tgt); + if (src.hasSchedule()) + tgt.setSchedule(convertTiming(src.getSchedule())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasRate()) + tgt.setRate(convertType(src.getRate())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Observation.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Observation.java index 47e1d5ebb..695a31c52 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Observation.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Observation.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,231 +50,274 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Observation extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Observation convertObservation(org.hl7.fhir.r4.model.Observation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Observation tgt = new org.hl7.fhir.r5.model.Observation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) - tgt.addFocus(convertReference(t)); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasIssued()) - tgt.setIssuedElement(convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasDataAbsentReason()) - tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getInterpretation()) - tgt.addInterpretation(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasSpecimen()) - tgt.setSpecimen(convertReference(src.getSpecimen())); - if (src.hasDevice()) - tgt.setDevice(convertReference(src.getDevice())); - for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) - tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getHasMember()) - tgt.addHasMember(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) - tgt.addDerivedFrom(convertReference(t)); - for (org.hl7.fhir.r4.model.Observation.ObservationComponentComponent t : src.getComponent()) - tgt.addComponent(convertObservationComponentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Observation convertObservation(org.hl7.fhir.r5.model.Observation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Observation tgt = new org.hl7.fhir.r4.model.Observation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertObservationStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) - tgt.addFocus(convertReference(t)); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasEffective()) - tgt.setEffective(convertType(src.getEffective())); - if (src.hasIssued()) - tgt.setIssuedElement(convertInstant(src.getIssuedElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasDataAbsentReason()) - tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation()) - tgt.addInterpretation(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasSpecimen()) - tgt.setSpecimen(convertReference(src.getSpecimen())); - if (src.hasDevice()) - tgt.setDevice(convertReference(src.getDevice())); - for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) - tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getHasMember()) - tgt.addHasMember(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) - tgt.addDerivedFrom(convertReference(t)); - for (org.hl7.fhir.r5.model.Observation.ObservationComponentComponent t : src.getComponent()) - tgt.addComponent(convertObservationComponentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ObservationStatus convertObservationStatus(org.hl7.fhir.r4.model.Observation.ObservationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED; - case PRELIMINARY: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL; - case AMENDED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Observation.ObservationStatus convertObservationStatus(org.hl7.fhir.r5.model.Enumerations.ObservationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r4.model.Observation.ObservationStatus.REGISTERED; - case PRELIMINARY: return org.hl7.fhir.r4.model.Observation.ObservationStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL; - case AMENDED: return org.hl7.fhir.r4.model.Observation.ObservationStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r4.model.Observation.ObservationStatus.CORRECTED; - case CANCELLED: return org.hl7.fhir.r4.model.Observation.ObservationStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Observation.ObservationStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.Observation.ObservationStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.Observation.ObservationStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent(); - copyElement(src, tgt); - if (src.hasLow()) - tgt.setLow(convertSimpleQuantity(src.getLow())); - if (src.hasHigh()) - tgt.setHigh(convertSimpleQuantity(src.getHigh())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAppliesTo()) - tgt.addAppliesTo(convertCodeableConcept(t)); - if (src.hasAge()) - tgt.setAge(convertRange(src.getAge())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent(); - copyElement(src, tgt); - if (src.hasLow()) - tgt.setLow(convertSimpleQuantity(src.getLow())); - if (src.hasHigh()) - tgt.setHigh(convertSimpleQuantity(src.getHigh())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) - tgt.addAppliesTo(convertCodeableConcept(t)); - if (src.hasAge()) - tgt.setAge(convertRange(src.getAge())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Observation.ObservationComponentComponent convertObservationComponentComponent(org.hl7.fhir.r4.model.Observation.ObservationComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationComponentComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasDataAbsentReason()) - tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getInterpretation()) - tgt.addInterpretation(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) - tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Observation.ObservationComponentComponent convertObservationComponentComponent(org.hl7.fhir.r5.model.Observation.ObservationComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r4.model.Observation.ObservationComponentComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasDataAbsentReason()) - tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation()) - tgt.addInterpretation(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) - tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Observation convertObservation(org.hl7.fhir.r4.model.Observation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Observation tgt = new org.hl7.fhir.r5.model.Observation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertObservationStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasFocus()) { + for (org.hl7.fhir.r4.model.Reference t : src.getFocus()) tgt.addFocus(convertReference(t)); + } + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasInterpretation()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getInterpretation()) tgt.addInterpretation(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasSpecimen()) + tgt.setSpecimen(convertReference(src.getSpecimen())); + if (src.hasDevice()) + tgt.setDevice(convertReference(src.getDevice())); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasHasMember()) { + for (org.hl7.fhir.r4.model.Reference t : src.getHasMember()) tgt.addHasMember(convertReference(t)); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(convertReference(t)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r4.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Observation convertObservation(org.hl7.fhir.r5.model.Observation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Observation tgt = new org.hl7.fhir.r4.model.Observation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertObservationStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasFocus()) { + for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addFocus(convertReference(t)); + } + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasInterpretation()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation()) tgt.addInterpretation(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasSpecimen()) + tgt.setSpecimen(convertReference(src.getSpecimen())); + if (src.hasDevice()) + tgt.setDevice(convertReference(src.getDevice())); + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + if (src.hasHasMember()) { + for (org.hl7.fhir.r5.model.Reference t : src.getHasMember()) tgt.addHasMember(convertReference(t)); + } + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) tgt.addDerivedFrom(convertReference(t)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r5.model.Observation.ObservationComponentComponent t : src.getComponent()) tgt.addComponent(convertObservationComponentComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.ObservationStatus convertObservationStatus(org.hl7.fhir.r4.model.Observation.ObservationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED; + case PRELIMINARY: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Observation.ObservationStatus convertObservationStatus(org.hl7.fhir.r5.model.Enumerations.ObservationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.REGISTERED; + case PRELIMINARY: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.CORRECTED; + case CANCELLED: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Observation.ObservationStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent(); + copyElement(src, tgt); + if (src.hasLow()) + tgt.setLow(convertSimpleQuantity(src.getLow())); + if (src.hasHigh()) + tgt.setHigh(convertSimpleQuantity(src.getHigh())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(convertCodeableConcept(t)); + } + if (src.hasAge()) + tgt.setAge(convertRange(src.getAge())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent(); + copyElement(src, tgt); + if (src.hasLow()) + tgt.setLow(convertSimpleQuantity(src.getLow())); + if (src.hasHigh()) + tgt.setHigh(convertSimpleQuantity(src.getHigh())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(convertCodeableConcept(t)); + } + if (src.hasAge()) + tgt.setAge(convertRange(src.getAge())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Observation.ObservationComponentComponent convertObservationComponentComponent(org.hl7.fhir.r4.model.Observation.ObservationComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationComponentComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasInterpretation()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getInterpretation()) tgt.addInterpretation(convertCodeableConcept(t)); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Observation.ObservationComponentComponent convertObservationComponentComponent(org.hl7.fhir.r5.model.Observation.ObservationComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r4.model.Observation.ObservationComponentComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasInterpretation()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation()) tgt.addInterpretation(convertCodeableConcept(t)); + } + if (src.hasReferenceRange()) { + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java index 7d7ce8da5..f326c6aa5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,219 +50,255 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ObservationDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ObservationDefinition convertObservationDefinition(org.hl7.fhir.r4.model.ObservationDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ObservationDefinition tgt = new org.hl7.fhir.r5.model.ObservationDefinition(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.setIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Enumeration t : src.getPermittedDataType()) - copyElement(t, tgt.addPermittedDataTypeElement().setValue(convertObservationDataType(t.getValue()))); - if (src.hasMultipleResultsAllowed()) - tgt.setMultipleResultsAllowedElement(convertBoolean(src.getMultipleResultsAllowedElement())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasPreferredReportName()) - tgt.setPreferredReportNameElement(convertString(src.getPreferredReportNameElement())); - if (src.hasQuantitativeDetails()) - tgt.setQuantitativeDetails(convertObservationDefinitionQuantitativeDetailsComponent(src.getQuantitativeDetails())); - for (org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent t : src.getQualifiedInterval()) - tgt.addQualifiedInterval(convertObservationDefinitionQualifiedIntervalComponent(t)); - if (src.hasValidCodedValueSet()) - tgt.setValidCodedValueSet(convertReference(src.getValidCodedValueSet())); - if (src.hasNormalCodedValueSet()) - tgt.setNormalCodedValueSet(convertReference(src.getNormalCodedValueSet())); - if (src.hasAbnormalCodedValueSet()) - tgt.setAbnormalCodedValueSet(convertReference(src.getAbnormalCodedValueSet())); - if (src.hasCriticalCodedValueSet()) - tgt.setCriticalCodedValueSet(convertReference(src.getCriticalCodedValueSet())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ObservationDefinition convertObservationDefinition(org.hl7.fhir.r5.model.ObservationDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ObservationDefinition tgt = new org.hl7.fhir.r4.model.ObservationDefinition(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasIdentifier()) - tgt.addIdentifier(convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getPermittedDataType()) - copyElement(t, tgt.addPermittedDataTypeElement().setValue(convertObservationDataType(t.getValue()))); - if (src.hasMultipleResultsAllowed()) - tgt.setMultipleResultsAllowedElement(convertBoolean(src.getMultipleResultsAllowedElement())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasPreferredReportName()) - tgt.setPreferredReportNameElement(convertString(src.getPreferredReportNameElement())); - if (src.hasQuantitativeDetails()) - tgt.setQuantitativeDetails(convertObservationDefinitionQuantitativeDetailsComponent(src.getQuantitativeDetails())); - for (org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent t : src.getQualifiedInterval()) - tgt.addQualifiedInterval(convertObservationDefinitionQualifiedIntervalComponent(t)); - if (src.hasValidCodedValueSet()) - tgt.setValidCodedValueSet(convertReference(src.getValidCodedValueSet())); - if (src.hasNormalCodedValueSet()) - tgt.setNormalCodedValueSet(convertReference(src.getNormalCodedValueSet())); - if (src.hasAbnormalCodedValueSet()) - tgt.setAbnormalCodedValueSet(convertReference(src.getAbnormalCodedValueSet())); - if (src.hasCriticalCodedValueSet()) - tgt.setCriticalCodedValueSet(convertReference(src.getCriticalCodedValueSet())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType convertObservationDataType(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUANTITY: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.QUANTITY; - case CODEABLECONCEPT: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT; - case STRING: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.STRING; - case BOOLEAN: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.BOOLEAN; - case INTEGER: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.INTEGER; - case RANGE: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RANGE; - case RATIO: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RATIO; - case SAMPLEDDATA: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA; - case TIME: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.TIME; - case DATETIME: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.DATETIME; - case PERIOD: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.PERIOD; - default: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.NULL; - } -} - - public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType convertObservationDataType(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUANTITY: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.QUANTITY; - case CODEABLECONCEPT: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT; - case STRING: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.STRING; - case BOOLEAN: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.BOOLEAN; - case INTEGER: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.INTEGER; - case RANGE: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RANGE; - case RATIO: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RATIO; - case SAMPLEDDATA: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA; - case TIME: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.TIME; - case DATETIME: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.DATETIME; - case PERIOD: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.PERIOD; - default: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.NULL; - } -} - - public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent convertObservationDefinitionQuantitativeDetailsComponent(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent tgt = new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent(); - copyElement(src, tgt); - if (src.hasCustomaryUnit()) - tgt.setCustomaryUnit(convertCodeableConcept(src.getCustomaryUnit())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasConversionFactor()) - tgt.setConversionFactorElement(convertDecimal(src.getConversionFactorElement())); - if (src.hasDecimalPrecision()) - tgt.setDecimalPrecisionElement(convertInteger(src.getDecimalPrecisionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent convertObservationDefinitionQuantitativeDetailsComponent(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent tgt = new org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent(); - copyElement(src, tgt); - if (src.hasCustomaryUnit()) - tgt.setCustomaryUnit(convertCodeableConcept(src.getCustomaryUnit())); - if (src.hasUnit()) - tgt.setUnit(convertCodeableConcept(src.getUnit())); - if (src.hasConversionFactor()) - tgt.setConversionFactorElement(convertDecimal(src.getConversionFactorElement())); - if (src.hasDecimalPrecision()) - tgt.setDecimalPrecisionElement(convertInteger(src.getDecimalPrecisionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent convertObservationDefinitionQualifiedIntervalComponent(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent tgt = new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertObservationRangeCategory(src.getCategory())); - if (src.hasRange()) - tgt.setRange(convertRange(src.getRange())); - if (src.hasContext()) - tgt.setContext(convertCodeableConcept(src.getContext())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAppliesTo()) - tgt.addAppliesTo(convertCodeableConcept(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasAge()) - tgt.setAge(convertRange(src.getAge())); - if (src.hasGestationalAge()) - tgt.setGestationalAge(convertRange(src.getGestationalAge())); - if (src.hasCondition()) - tgt.setConditionElement(convertString(src.getConditionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent convertObservationDefinitionQualifiedIntervalComponent(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent tgt = new org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertObservationRangeCategory(src.getCategory())); - if (src.hasRange()) - tgt.setRange(convertRange(src.getRange())); - if (src.hasContext()) - tgt.setContext(convertCodeableConcept(src.getContext())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) - tgt.addAppliesTo(convertCodeableConcept(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasAge()) - tgt.setAge(convertRange(src.getAge())); - if (src.hasGestationalAge()) - tgt.setGestationalAge(convertRange(src.getGestationalAge())); - if (src.hasCondition()) - tgt.setConditionElement(convertString(src.getConditionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory convertObservationRangeCategory(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REFERENCE: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.REFERENCE; - case CRITICAL: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.CRITICAL; - case ABSOLUTE: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE; - default: return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.NULL; - } -} - - public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory convertObservationRangeCategory(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REFERENCE: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.REFERENCE; - case CRITICAL: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.CRITICAL; - case ABSOLUTE: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE; - default: return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.NULL; - } -} + public static org.hl7.fhir.r5.model.ObservationDefinition convertObservationDefinition(org.hl7.fhir.r4.model.ObservationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ObservationDefinition tgt = new org.hl7.fhir.r5.model.ObservationDefinition(); + copyDomainResource(src, tgt); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.setIdentifier(convertIdentifier(t)); + } + if (src.hasPermittedDataType()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getPermittedDataType()) copyElement(t, tgt.addPermittedDataTypeElement().setValue(convertObservationDataType(t.getValue()))); + } + if (src.hasMultipleResultsAllowed()) + tgt.setMultipleResultsAllowedElement(convertBoolean(src.getMultipleResultsAllowedElement())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasPreferredReportName()) + tgt.setPreferredReportNameElement(convertString(src.getPreferredReportNameElement())); + if (src.hasQuantitativeDetails()) + tgt.setQuantitativeDetails(convertObservationDefinitionQuantitativeDetailsComponent(src.getQuantitativeDetails())); + if (src.hasQualifiedInterval()) { + for (org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent t : src.getQualifiedInterval()) tgt.addQualifiedInterval(convertObservationDefinitionQualifiedIntervalComponent(t)); + } + if (src.hasValidCodedValueSet()) + tgt.setValidCodedValueSet(convertReference(src.getValidCodedValueSet())); + if (src.hasNormalCodedValueSet()) + tgt.setNormalCodedValueSet(convertReference(src.getNormalCodedValueSet())); + if (src.hasAbnormalCodedValueSet()) + tgt.setAbnormalCodedValueSet(convertReference(src.getAbnormalCodedValueSet())); + if (src.hasCriticalCodedValueSet()) + tgt.setCriticalCodedValueSet(convertReference(src.getCriticalCodedValueSet())); + return tgt; + } + public static org.hl7.fhir.r4.model.ObservationDefinition convertObservationDefinition(org.hl7.fhir.r5.model.ObservationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ObservationDefinition tgt = new org.hl7.fhir.r4.model.ObservationDefinition(); + copyDomainResource(src, tgt); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) + tgt.addIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasPermittedDataType()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getPermittedDataType()) copyElement(t, tgt.addPermittedDataTypeElement().setValue(convertObservationDataType(t.getValue()))); + } + if (src.hasMultipleResultsAllowed()) + tgt.setMultipleResultsAllowedElement(convertBoolean(src.getMultipleResultsAllowedElement())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasPreferredReportName()) + tgt.setPreferredReportNameElement(convertString(src.getPreferredReportNameElement())); + if (src.hasQuantitativeDetails()) + tgt.setQuantitativeDetails(convertObservationDefinitionQuantitativeDetailsComponent(src.getQuantitativeDetails())); + if (src.hasQualifiedInterval()) { + for (org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent t : src.getQualifiedInterval()) tgt.addQualifiedInterval(convertObservationDefinitionQualifiedIntervalComponent(t)); + } + if (src.hasValidCodedValueSet()) + tgt.setValidCodedValueSet(convertReference(src.getValidCodedValueSet())); + if (src.hasNormalCodedValueSet()) + tgt.setNormalCodedValueSet(convertReference(src.getNormalCodedValueSet())); + if (src.hasAbnormalCodedValueSet()) + tgt.setAbnormalCodedValueSet(convertReference(src.getAbnormalCodedValueSet())); + if (src.hasCriticalCodedValueSet()) + tgt.setCriticalCodedValueSet(convertReference(src.getCriticalCodedValueSet())); + return tgt; + } + public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType convertObservationDataType(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUANTITY: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.QUANTITY; + case CODEABLECONCEPT: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT; + case STRING: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.STRING; + case BOOLEAN: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.BOOLEAN; + case INTEGER: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.INTEGER; + case RANGE: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RANGE; + case RATIO: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RATIO; + case SAMPLEDDATA: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA; + case TIME: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.TIME; + case DATETIME: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.DATETIME; + case PERIOD: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.PERIOD; + default: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.NULL; + } + } + + public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType convertObservationDataType(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUANTITY: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.QUANTITY; + case CODEABLECONCEPT: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT; + case STRING: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.STRING; + case BOOLEAN: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.BOOLEAN; + case INTEGER: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.INTEGER; + case RANGE: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RANGE; + case RATIO: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RATIO; + case SAMPLEDDATA: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA; + case TIME: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.TIME; + case DATETIME: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.DATETIME; + case PERIOD: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.PERIOD; + default: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.NULL; + } + } + + public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent convertObservationDefinitionQuantitativeDetailsComponent(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent tgt = new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent(); + copyElement(src, tgt); + if (src.hasCustomaryUnit()) + tgt.setCustomaryUnit(convertCodeableConcept(src.getCustomaryUnit())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasConversionFactor()) + tgt.setConversionFactorElement(convertDecimal(src.getConversionFactorElement())); + if (src.hasDecimalPrecision()) + tgt.setDecimalPrecisionElement(convertInteger(src.getDecimalPrecisionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent convertObservationDefinitionQuantitativeDetailsComponent(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent tgt = new org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent(); + copyElement(src, tgt); + if (src.hasCustomaryUnit()) + tgt.setCustomaryUnit(convertCodeableConcept(src.getCustomaryUnit())); + if (src.hasUnit()) + tgt.setUnit(convertCodeableConcept(src.getUnit())); + if (src.hasConversionFactor()) + tgt.setConversionFactorElement(convertDecimal(src.getConversionFactorElement())); + if (src.hasDecimalPrecision()) + tgt.setDecimalPrecisionElement(convertInteger(src.getDecimalPrecisionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent convertObservationDefinitionQualifiedIntervalComponent(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent tgt = new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertObservationRangeCategory(src.getCategory())); + if (src.hasRange()) + tgt.setRange(convertRange(src.getRange())); + if (src.hasContext()) + tgt.setContext(convertCodeableConcept(src.getContext())); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(convertCodeableConcept(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasAge()) + tgt.setAge(convertRange(src.getAge())); + if (src.hasGestationalAge()) + tgt.setGestationalAge(convertRange(src.getGestationalAge())); + if (src.hasCondition()) + tgt.setConditionElement(convertString(src.getConditionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent convertObservationDefinitionQualifiedIntervalComponent(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent tgt = new org.hl7.fhir.r4.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertObservationRangeCategory(src.getCategory())); + if (src.hasRange()) + tgt.setRange(convertRange(src.getRange())); + if (src.hasContext()) + tgt.setContext(convertCodeableConcept(src.getContext())); + if (src.hasAppliesTo()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(convertCodeableConcept(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasAge()) + tgt.setAge(convertRange(src.getAge())); + if (src.hasGestationalAge()) + tgt.setGestationalAge(convertRange(src.getGestationalAge())); + if (src.hasCondition()) + tgt.setConditionElement(convertString(src.getConditionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory convertObservationRangeCategory(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REFERENCE: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.REFERENCE; + case CRITICAL: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.CRITICAL; + case ABSOLUTE: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE; + default: + return org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.NULL; + } + } + + public static org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory convertObservationRangeCategory(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REFERENCE: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.REFERENCE; + case CRITICAL: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.CRITICAL; + case ABSOLUTE: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE; + default: + return org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationDefinition.java index 8014241b9..cefe00227 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationDefinition.java @@ -19,21 +19,16 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Enumerations.ResourceTypeEnum; - import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -62,303 +57,330 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class OperationDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.OperationDefinition convertOperationDefinition(org.hl7.fhir.r4.model.OperationDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OperationDefinition tgt = new org.hl7.fhir.r5.model.OperationDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasKind()) - tgt.setKind(convertOperationKind(src.getKind())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasAffectsState()) - tgt.setAffectsStateElement(convertBoolean(src.getAffectsStateElement())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasComment()) - tgt.setCommentElement(convertMarkdown(src.getCommentElement())); - if (src.hasBase()) - tgt.setBaseElement(convertCanonical(src.getBaseElement())); - for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) - tgt.getResource().add(convertResourceEnum(t)); - if (src.hasSystem()) - tgt.setSystemElement(convertBoolean(src.getSystemElement())); - if (src.hasType()) - tgt.setTypeElement(convertBoolean(src.getTypeElement())); - if (src.hasInstance()) - tgt.setInstanceElement(convertBoolean(src.getInstanceElement())); - if (src.hasInputProfile()) - tgt.setInputProfileElement(convertCanonical(src.getInputProfileElement())); - if (src.hasOutputProfile()) - tgt.setOutputProfileElement(convertCanonical(src.getOutputProfileElement())); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) - tgt.addParameter(convertOperationDefinitionParameterComponent(t)); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) - tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.OperationDefinition convertOperationDefinition(org.hl7.fhir.r5.model.OperationDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OperationDefinition tgt = new org.hl7.fhir.r4.model.OperationDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasKind()) - tgt.setKind(convertOperationKind(src.getKind())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasAffectsState()) - tgt.setAffectsStateElement(convertBoolean(src.getAffectsStateElement())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasComment()) - tgt.setCommentElement(convertMarkdown(src.getCommentElement())); - if (src.hasBase()) - tgt.setBaseElement(convertCanonical(src.getBaseElement())); - for (CodeType t : src.getResource()) - tgt.getResource().add(convertResourceEnum(t)); - if (src.hasSystem()) - tgt.setSystemElement(convertBoolean(src.getSystemElement())); - if (src.hasType()) - tgt.setTypeElement(convertBoolean(src.getTypeElement())); - if (src.hasInstance()) - tgt.setInstanceElement(convertBoolean(src.getInstanceElement())); - if (src.hasInputProfile()) - tgt.setInputProfileElement(convertCanonical(src.getInputProfileElement())); - if (src.hasOutputProfile()) - tgt.setOutputProfileElement(convertCanonical(src.getOutputProfileElement())); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) - tgt.addParameter(convertOperationDefinitionParameterComponent(t)); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) - tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.OperationDefinition.OperationKind convertOperationKind(org.hl7.fhir.r4.model.OperationDefinition.OperationKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OPERATION: return org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION; - case QUERY: return org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY; - default: return org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL; - } -} - - public static org.hl7.fhir.r4.model.OperationDefinition.OperationKind convertOperationKind(org.hl7.fhir.r5.model.OperationDefinition.OperationKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OPERATION: return org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION; - case QUERY: return org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY; - default: return org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertCode(src.getNameElement())); - if (src.hasUse()) - tgt.setUse(convertOperationParameterUse(src.getUse())); - if (src.hasMin()) - tgt.setMinElement(convertInteger(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - if (src.hasType()) - tgt.getTypeElement().setValue(org.hl7.fhir.r5.model.Enumerations.FHIRAllTypes.fromCode(src.getType())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getTargetProfile()) - tgt.getTargetProfile().add(convertCanonical(t)); - if (src.hasSearchType()) - tgt.setSearchType(Enumerations.convertSearchParamType(src.getSearchType())); - if (src.hasBinding()) - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent t : src.getReferencedFrom()) - tgt.addReferencedFrom(convertOperationDefinitionParameterReferencedFromComponent(t)); - for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) - tgt.addPart(convertOperationDefinitionParameterComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertCode(src.getNameElement())); - if (src.hasUse()) - tgt.setUse(convertOperationParameterUse(src.getUse())); - if (src.hasMin()) - tgt.setMinElement(convertInteger(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - if (src.hasType()) - tgt.setTypeElement(new org.hl7.fhir.r4.model.CodeType(src.getType().toCode())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getTargetProfile()) - tgt.getTargetProfile().add(convertCanonical(t)); - if (src.hasSearchType()) - tgt.setSearchType(Enumerations.convertSearchParamType(src.getSearchType())); - if (src.hasBinding()) - tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent t : src.getReferencedFrom()) - tgt.addReferencedFrom(convertOperationDefinitionParameterReferencedFromComponent(t)); - for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) - tgt.addPart(convertOperationDefinitionParameterComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.OperationParameterUse convertOperationParameterUse(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case IN: return org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN; - case OUT: return org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT; - default: return org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL; - } -} - - public static org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse convertOperationParameterUse(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case IN: return org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN; - case OUT: return org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT; - default: return org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL; - } -} - - public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); - copyElement(src, tgt); - if (src.hasStrength()) - tgt.setStrength(Enumerations.convertBindingStrength(src.getStrength())); - if (src.hasValueSet()) - tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); - copyElement(src, tgt); - if (src.hasStrength()) - tgt.setStrength(Enumerations.convertBindingStrength(src.getStrength())); - if (src.hasValueSet()) - tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent convertOperationDefinitionParameterReferencedFromComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent(); - copyElement(src, tgt); - if (src.hasSource()) - tgt.setSourceElement(convertString(src.getSourceElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertString(src.getSourceIdElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent convertOperationDefinitionParameterReferencedFromComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent(); - copyElement(src, tgt); - if (src.hasSource()) - tgt.setSourceElement(convertString(src.getSourceElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertString(src.getSourceIdElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent convertOperationDefinitionOverloadComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.StringType t : src.getParameterName()) - tgt.getParameterName().add(convertString(t)); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent convertOperationDefinitionOverloadComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.StringType t : src.getParameterName()) - tgt.getParameterName().add(convertString(t)); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.OperationDefinition convertOperationDefinition(org.hl7.fhir.r4.model.OperationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition tgt = new org.hl7.fhir.r5.model.OperationDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasKind()) + tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasAffectsState()) + tgt.setAffectsStateElement(convertBoolean(src.getAffectsStateElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasComment()) + tgt.setCommentElement(convertMarkdown(src.getCommentElement())); + if (src.hasBase()) + tgt.setBaseElement(convertCanonical(src.getBaseElement())); + if (src.hasResource()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getResource()) tgt.getResource().add(convertResourceEnum(t)); + } + if (src.hasSystem()) + tgt.setSystemElement(convertBoolean(src.getSystemElement())); + if (src.hasType()) + tgt.setTypeElement(convertBoolean(src.getTypeElement())); + if (src.hasInstance()) + tgt.setInstanceElement(convertBoolean(src.getInstanceElement())); + if (src.hasInputProfile()) + tgt.setInputProfileElement(convertCanonical(src.getInputProfileElement())); + if (src.hasOutputProfile()) + tgt.setOutputProfileElement(convertCanonical(src.getOutputProfileElement())); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } + if (src.hasOverload()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.OperationDefinition convertOperationDefinition(org.hl7.fhir.r5.model.OperationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OperationDefinition tgt = new org.hl7.fhir.r4.model.OperationDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasKind()) + tgt.setKind(convertOperationKind(src.getKind())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasAffectsState()) + tgt.setAffectsStateElement(convertBoolean(src.getAffectsStateElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasComment()) + tgt.setCommentElement(convertMarkdown(src.getCommentElement())); + if (src.hasBase()) + tgt.setBaseElement(convertCanonical(src.getBaseElement())); + if (src.hasResource()) { + for (CodeType t : src.getResource()) tgt.getResource().add(convertResourceEnum(t)); + } + if (src.hasSystem()) + tgt.setSystemElement(convertBoolean(src.getSystemElement())); + if (src.hasType()) + tgt.setTypeElement(convertBoolean(src.getTypeElement())); + if (src.hasInstance()) + tgt.setInstanceElement(convertBoolean(src.getInstanceElement())); + if (src.hasInputProfile()) + tgt.setInputProfileElement(convertCanonical(src.getInputProfileElement())); + if (src.hasOutputProfile()) + tgt.setOutputProfileElement(convertCanonical(src.getOutputProfileElement())); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + } + if (src.hasOverload()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.OperationDefinition.OperationKind convertOperationKind(org.hl7.fhir.r4.model.OperationDefinition.OperationKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OPERATION: + return org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION; + case QUERY: + return org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY; + default: + return org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL; + } + } + + public static org.hl7.fhir.r4.model.OperationDefinition.OperationKind convertOperationKind(org.hl7.fhir.r5.model.OperationDefinition.OperationKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OPERATION: + return org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION; + case QUERY: + return org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY; + default: + return org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertCode(src.getNameElement())); + if (src.hasUse()) + tgt.setUse(convertOperationParameterUse(src.getUse())); + if (src.hasMin()) + tgt.setMinElement(convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + if (src.hasType()) + tgt.getTypeElement().setValue(org.hl7.fhir.r5.model.Enumerations.FHIRAllTypes.fromCode(src.getType())); + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getTargetProfile()) tgt.getTargetProfile().add(convertCanonical(t)); + } + if (src.hasSearchType()) + tgt.setSearchType(Enumerations.convertSearchParamType(src.getSearchType())); + if (src.hasBinding()) + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + if (src.hasReferencedFrom()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent t : src.getReferencedFrom()) tgt.addReferencedFrom(convertOperationDefinitionParameterReferencedFromComponent(t)); + } + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertCode(src.getNameElement())); + if (src.hasUse()) + tgt.setUse(convertOperationParameterUse(src.getUse())); + if (src.hasMin()) + tgt.setMinElement(convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + if (src.hasType()) + tgt.setTypeElement(new org.hl7.fhir.r4.model.CodeType(src.getType().toCode())); + if (src.hasTargetProfile()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getTargetProfile()) tgt.getTargetProfile().add(convertCanonical(t)); + } + if (src.hasSearchType()) + tgt.setSearchType(Enumerations.convertSearchParamType(src.getSearchType())); + if (src.hasBinding()) + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + if (src.hasReferencedFrom()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent t : src.getReferencedFrom()) tgt.addReferencedFrom(convertOperationDefinitionParameterReferencedFromComponent(t)); + } + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) tgt.addPart(convertOperationDefinitionParameterComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.OperationParameterUse convertOperationParameterUse(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case IN: + return org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN; + case OUT: + return org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT; + default: + return org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL; + } + } + + public static org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse convertOperationParameterUse(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case IN: + return org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN; + case OUT: + return org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT; + default: + return org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL; + } + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); + copyElement(src, tgt); + if (src.hasStrength()) + tgt.setStrength(Enumerations.convertBindingStrength(src.getStrength())); + if (src.hasValueSet()) + tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); + copyElement(src, tgt); + if (src.hasStrength()) + tgt.setStrength(Enumerations.convertBindingStrength(src.getStrength())); + if (src.hasValueSet()) + tgt.setValueSetElement(convertCanonical(src.getValueSetElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent convertOperationDefinitionParameterReferencedFromComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent(); + copyElement(src, tgt); + if (src.hasSource()) + tgt.setSourceElement(convertString(src.getSourceElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertString(src.getSourceIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent convertOperationDefinitionParameterReferencedFromComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent(); + copyElement(src, tgt); + if (src.hasSource()) + tgt.setSourceElement(convertString(src.getSourceElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertString(src.getSourceIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent convertOperationDefinitionOverloadComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent(); + copyElement(src, tgt); + if (src.hasParameterName()) { + for (org.hl7.fhir.r4.model.StringType t : src.getParameterName()) tgt.getParameterName().add(convertString(t)); + } + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent convertOperationDefinitionOverloadComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionOverloadComponent(); + copyElement(src, tgt); + if (src.hasParameterName()) { + for (org.hl7.fhir.r5.model.StringType t : src.getParameterName()) tgt.getParameterName().add(convertString(t)); + } + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationOutcome.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationOutcome.java index 9c7d328ac..e241230bf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationOutcome.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OperationOutcome.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,173 +50,248 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class OperationOutcome extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r4.model.OperationOutcome src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OperationOutcome tgt = new org.hl7.fhir.r5.model.OperationOutcome(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) - tgt.addIssue(convertOperationOutcomeIssueComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r4.model.OperationOutcome src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationOutcome tgt = new org.hl7.fhir.r5.model.OperationOutcome(); + copyDomainResource(src, tgt); + if (src.hasIssue()) { + for (org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r5.model.OperationOutcome src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OperationOutcome tgt = new org.hl7.fhir.r4.model.OperationOutcome(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) - tgt.addIssue(convertOperationOutcomeIssueComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r5.model.OperationOutcome src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OperationOutcome tgt = new org.hl7.fhir.r4.model.OperationOutcome(); + copyDomainResource(src, tgt); + if (src.hasIssue()) { + for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent(); - copyElement(src, tgt); - if (src.hasSeverity()) - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - if (src.hasCode()) - tgt.setCode(convertIssueType(src.getCode())); - if (src.hasDetails()) - tgt.setDetails(convertCodeableConcept(src.getDetails())); - if (src.hasDiagnostics()) - tgt.setDiagnosticsElement(convertString(src.getDiagnosticsElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) - tgt.getLocation().add(convertString(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getExpression()) - tgt.getExpression().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent(); - copyElement(src, tgt); - if (src.hasSeverity()) - tgt.setSeverity(convertIssueSeverity(src.getSeverity())); - if (src.hasCode()) - tgt.setCode(convertIssueType(src.getCode())); - if (src.hasDetails()) - tgt.setDetails(convertCodeableConcept(src.getDetails())); - if (src.hasDiagnostics()) - tgt.setDiagnosticsElement(convertString(src.getDiagnosticsElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) - tgt.getLocation().add(convertString(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getExpression()) - tgt.getExpression().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity convertIssueSeverity(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FATAL: return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL; - case ERROR: return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR; - case WARNING: return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING; - case INFORMATION: return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION; - default: return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL; - } -} - - public static org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity convertIssueSeverity(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FATAL: return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL; - case ERROR: return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR; - case WARNING: return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING; - case INFORMATION: return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION; - default: return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL; - } -} - - public static org.hl7.fhir.r5.model.OperationOutcome.IssueType convertIssueType(org.hl7.fhir.r4.model.OperationOutcome.IssueType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INVALID: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID; - case STRUCTURE: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE; - case REQUIRED: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED; - case VALUE: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE; - case INVARIANT: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT; - case SECURITY: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY; - case LOGIN: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN; - case UNKNOWN: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN; - case EXPIRED: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED; - case FORBIDDEN: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN; - case SUPPRESSED: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED; - case PROCESSING: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING; - case NOTSUPPORTED: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED; - case DUPLICATE: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE; - case MULTIPLEMATCHES: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.MULTIPLEMATCHES; - case NOTFOUND: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND; - case DELETED: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.DELETED; - case TOOLONG: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG; - case CODEINVALID: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID; - case EXTENSION: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION; - case TOOCOSTLY: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY; - case BUSINESSRULE: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE; - case CONFLICT: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT; - case TRANSIENT: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT; - case LOCKERROR: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR; - case NOSTORE: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE; - case EXCEPTION: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION; - case TIMEOUT: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT; - case INCOMPLETE: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE; - case THROTTLED: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED; - case INFORMATIONAL: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL; - default: return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL; - } -} - - public static org.hl7.fhir.r4.model.OperationOutcome.IssueType convertIssueType(org.hl7.fhir.r5.model.OperationOutcome.IssueType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INVALID: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID; - case STRUCTURE: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE; - case REQUIRED: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED; - case VALUE: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE; - case INVARIANT: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT; - case SECURITY: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY; - case LOGIN: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN; - case UNKNOWN: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN; - case EXPIRED: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED; - case FORBIDDEN: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN; - case SUPPRESSED: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED; - case PROCESSING: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING; - case NOTSUPPORTED: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED; - case DUPLICATE: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE; - case MULTIPLEMATCHES: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.MULTIPLEMATCHES; - case NOTFOUND: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND; - case DELETED: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.DELETED; - case TOOLONG: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG; - case CODEINVALID: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID; - case EXTENSION: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION; - case TOOCOSTLY: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY; - case BUSINESSRULE: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE; - case CONFLICT: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT; - case TRANSIENT: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT; - case LOCKERROR: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR; - case NOSTORE: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE; - case EXCEPTION: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION; - case TIMEOUT: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT; - case INCOMPLETE: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE; - case THROTTLED: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED; - case INFORMATIONAL: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL; - default: return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL; - } -} + public static org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent(); + copyElement(src, tgt); + if (src.hasSeverity()) + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + if (src.hasCode()) + tgt.setCode(convertIssueType(src.getCode())); + if (src.hasDetails()) + tgt.setDetails(convertCodeableConcept(src.getDetails())); + if (src.hasDiagnostics()) + tgt.setDiagnosticsElement(convertString(src.getDiagnosticsElement())); + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.StringType t : src.getLocation()) tgt.getLocation().add(convertString(t)); + } + if (src.hasExpression()) { + for (org.hl7.fhir.r4.model.StringType t : src.getExpression()) tgt.getExpression().add(convertString(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent(); + copyElement(src, tgt); + if (src.hasSeverity()) + tgt.setSeverity(convertIssueSeverity(src.getSeverity())); + if (src.hasCode()) + tgt.setCode(convertIssueType(src.getCode())); + if (src.hasDetails()) + tgt.setDetails(convertCodeableConcept(src.getDetails())); + if (src.hasDiagnostics()) + tgt.setDiagnosticsElement(convertString(src.getDiagnosticsElement())); + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.getLocation().add(convertString(t)); + } + if (src.hasExpression()) { + for (org.hl7.fhir.r5.model.StringType t : src.getExpression()) tgt.getExpression().add(convertString(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity convertIssueSeverity(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FATAL: + return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL; + case ERROR: + return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR; + case WARNING: + return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING; + case INFORMATION: + return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION; + default: + return org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL; + } + } + + public static org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity convertIssueSeverity(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FATAL: + return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL; + case ERROR: + return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR; + case WARNING: + return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING; + case INFORMATION: + return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION; + default: + return org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL; + } + } + + public static org.hl7.fhir.r5.model.OperationOutcome.IssueType convertIssueType(org.hl7.fhir.r4.model.OperationOutcome.IssueType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INVALID: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID; + case STRUCTURE: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE; + case REQUIRED: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED; + case VALUE: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE; + case INVARIANT: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT; + case SECURITY: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY; + case LOGIN: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN; + case UNKNOWN: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN; + case EXPIRED: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED; + case FORBIDDEN: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN; + case SUPPRESSED: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED; + case PROCESSING: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING; + case NOTSUPPORTED: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED; + case DUPLICATE: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE; + case MULTIPLEMATCHES: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.MULTIPLEMATCHES; + case NOTFOUND: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND; + case DELETED: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.DELETED; + case TOOLONG: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG; + case CODEINVALID: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID; + case EXTENSION: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION; + case TOOCOSTLY: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY; + case BUSINESSRULE: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE; + case CONFLICT: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT; + case TRANSIENT: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT; + case LOCKERROR: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR; + case NOSTORE: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE; + case EXCEPTION: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION; + case TIMEOUT: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT; + case INCOMPLETE: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE; + case THROTTLED: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED; + case INFORMATIONAL: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL; + default: + return org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL; + } + } + + public static org.hl7.fhir.r4.model.OperationOutcome.IssueType convertIssueType(org.hl7.fhir.r5.model.OperationOutcome.IssueType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INVALID: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID; + case STRUCTURE: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE; + case REQUIRED: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED; + case VALUE: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE; + case INVARIANT: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT; + case SECURITY: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY; + case LOGIN: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN; + case UNKNOWN: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN; + case EXPIRED: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED; + case FORBIDDEN: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN; + case SUPPRESSED: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED; + case PROCESSING: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING; + case NOTSUPPORTED: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED; + case DUPLICATE: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE; + case MULTIPLEMATCHES: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.MULTIPLEMATCHES; + case NOTFOUND: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND; + case DELETED: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.DELETED; + case TOOLONG: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG; + case CODEINVALID: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID; + case EXTENSION: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION; + case TOOCOSTLY: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY; + case BUSINESSRULE: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE; + case CONFLICT: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT; + case TRANSIENT: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT; + case LOCKERROR: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR; + case NOSTORE: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE; + case EXCEPTION: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION; + case TIMEOUT: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT; + case INCOMPLETE: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE; + case THROTTLED: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED; + case INFORMATIONAL: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL; + default: + return org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Organization.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Organization.java index 2ba71f796..b9ced0f59 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Organization.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Organization.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,99 +50,110 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Organization extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Organization convertOrganization(org.hl7.fhir.r4.model.Organization src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Organization tgt = new org.hl7.fhir.r5.model.Organization(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - for (org.hl7.fhir.r4.model.Organization.OrganizationContactComponent t : src.getContact()) - tgt.addContact(convertOrganizationContactComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Organization convertOrganization(org.hl7.fhir.r4.model.Organization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Organization tgt = new org.hl7.fhir.r5.model.Organization(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r4.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Organization convertOrganization(org.hl7.fhir.r5.model.Organization src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Organization tgt = new org.hl7.fhir.r4.model.Organization(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) - tgt.getAlias().add(convertString(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasPartOf()) - tgt.setPartOf(convertReference(src.getPartOf())); - for (org.hl7.fhir.r5.model.Organization.OrganizationContactComponent t : src.getContact()) - tgt.addContact(convertOrganizationContactComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Organization.OrganizationContactComponent convertOrganizationContactComponent(org.hl7.fhir.r4.model.Organization.OrganizationContactComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.r5.model.Organization.OrganizationContactComponent(); - copyElement(src, tgt); - if (src.hasPurpose()) - tgt.setPurpose(convertCodeableConcept(src.getPurpose())); - if (src.hasName()) - tgt.setName(convertHumanName(src.getName())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Organization.OrganizationContactComponent convertOrganizationContactComponent(org.hl7.fhir.r5.model.Organization.OrganizationContactComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.r4.model.Organization.OrganizationContactComponent(); - copyElement(src, tgt); - if (src.hasPurpose()) - tgt.setPurpose(convertCodeableConcept(src.getPurpose())); - if (src.hasName()) - tgt.setName(convertHumanName(src.getName())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - return tgt; - } + public static org.hl7.fhir.r4.model.Organization convertOrganization(org.hl7.fhir.r5.model.Organization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Organization tgt = new org.hl7.fhir.r4.model.Organization(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasAlias()) { + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(convertString(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasPartOf()) + tgt.setPartOf(convertReference(src.getPartOf())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.Organization.OrganizationContactComponent t : src.getContact()) tgt.addContact(convertOrganizationContactComponent(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Organization.OrganizationContactComponent convertOrganizationContactComponent(org.hl7.fhir.r4.model.Organization.OrganizationContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.r5.model.Organization.OrganizationContactComponent(); + copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(convertHumanName(src.getName())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + return tgt; + } + public static org.hl7.fhir.r4.model.Organization.OrganizationContactComponent convertOrganizationContactComponent(org.hl7.fhir.r5.model.Organization.OrganizationContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.r4.model.Organization.OrganizationContactComponent(); + copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(convertHumanName(src.getName())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OrganizationAffiliation.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OrganizationAffiliation.java index defb83309..6688690eb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OrganizationAffiliation.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/OrganizationAffiliation.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,75 +50,86 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class OrganizationAffiliation extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.OrganizationAffiliation convertOrganizationAffiliation(org.hl7.fhir.r4.model.OrganizationAffiliation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.OrganizationAffiliation tgt = new org.hl7.fhir.r5.model.OrganizationAffiliation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasParticipatingOrganization()) - tgt.setParticipatingOrganization(convertReference(src.getParticipatingOrganization())); - for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) - tgt.addLocation(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getHealthcareService()) - tgt.addHealthcareService(convertReference(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.OrganizationAffiliation convertOrganizationAffiliation(org.hl7.fhir.r5.model.OrganizationAffiliation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.OrganizationAffiliation tgt = new org.hl7.fhir.r4.model.OrganizationAffiliation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasParticipatingOrganization()) - tgt.setParticipatingOrganization(convertReference(src.getParticipatingOrganization())); - for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) - tgt.addNetwork(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) - tgt.addLocation(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) - tgt.addHealthcareService(convertReference(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } - + public static org.hl7.fhir.r5.model.OrganizationAffiliation convertOrganizationAffiliation(org.hl7.fhir.r4.model.OrganizationAffiliation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OrganizationAffiliation tgt = new org.hl7.fhir.r5.model.OrganizationAffiliation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasParticipatingOrganization()) + tgt.setParticipatingOrganization(convertReference(src.getParticipatingOrganization())); + if (src.hasNetwork()) { + for (org.hl7.fhir.r4.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.addLocation(convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.r4.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.OrganizationAffiliation convertOrganizationAffiliation(org.hl7.fhir.r5.model.OrganizationAffiliation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.OrganizationAffiliation tgt = new org.hl7.fhir.r4.model.OrganizationAffiliation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasParticipatingOrganization()) + tgt.setParticipatingOrganization(convertReference(src.getParticipatingOrganization())); + if (src.hasNetwork()) { + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(convertReference(t)); + } + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Parameters.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Parameters.java index 7da9eb325..8326939c1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Parameters.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Parameters.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,62 +50,62 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Parameters extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Parameters convertParameters(org.hl7.fhir.r4.model.Parameters src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Parameters tgt = new org.hl7.fhir.r5.model.Parameters(); - copyResource(src, tgt); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) - tgt.addParameter(convertParametersParameterComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Parameters convertParameters(org.hl7.fhir.r4.model.Parameters src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Parameters tgt = new org.hl7.fhir.r5.model.Parameters(); + copyResource(src, tgt); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Parameters convertParameters(org.hl7.fhir.r5.model.Parameters src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Parameters tgt = new org.hl7.fhir.r4.model.Parameters(); - copyResource(src, tgt); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) - tgt.addParameter(convertParametersParameterComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Parameters convertParameters(org.hl7.fhir.r5.model.Parameters src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Parameters tgt = new org.hl7.fhir.r4.model.Parameters(); + copyResource(src, tgt); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) tgt.addParameter(convertParametersParameterComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasResource()) - tgt.setResource(convertResource(src.getResource())); - for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) - tgt.addPart(convertParametersParameterComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasResource()) - tgt.setResource(convertResource(src.getResource())); - for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) - tgt.addPart(convertParametersParameterComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasResource()) + tgt.setResource(convertResource(src.getResource())); + if (src.hasPart()) { + for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasResource()) + tgt.setResource(convertResource(src.getResource())); + if (src.hasPart()) { + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) tgt.addPart(convertParametersParameterComponent(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Patient.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Patient.java index fef054d92..3138f846b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Patient.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Patient.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,207 +50,234 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Patient extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Patient convertPatient(org.hl7.fhir.r4.model.Patient src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Patient tgt = new org.hl7.fhir.r5.model.Patient(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - if (src.hasDeceased()) - tgt.setDeceased(convertType(src.getDeceased())); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasMaritalStatus()) - tgt.setMaritalStatus(convertCodeableConcept(src.getMaritalStatus())); - if (src.hasMultipleBirth()) - tgt.setMultipleBirth(convertType(src.getMultipleBirth())); - for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) - tgt.addPhoto(convertAttachment(t)); - for (org.hl7.fhir.r4.model.Patient.ContactComponent t : src.getContact()) - tgt.addContact(convertContactComponent(t)); - for (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent t : src.getCommunication()) - tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getGeneralPractitioner()) - tgt.addGeneralPractitioner(convertReference(t)); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r4.model.Patient.PatientLinkComponent t : src.getLink()) - tgt.addLink(convertPatientLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Patient convertPatient(org.hl7.fhir.r4.model.Patient src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient tgt = new org.hl7.fhir.r5.model.Patient(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasDeceased()) + tgt.setDeceased(convertType(src.getDeceased())); + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasMaritalStatus()) + tgt.setMaritalStatus(convertCodeableConcept(src.getMaritalStatus())); + if (src.hasMultipleBirth()) + tgt.setMultipleBirth(convertType(src.getMultipleBirth())); + if (src.hasPhoto()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.r4.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(convertReference(t)); + } + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Patient convertPatient(org.hl7.fhir.r5.model.Patient src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Patient tgt = new org.hl7.fhir.r4.model.Patient(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - if (src.hasDeceased()) - tgt.setDeceased(convertType(src.getDeceased())); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasMaritalStatus()) - tgt.setMaritalStatus(convertCodeableConcept(src.getMaritalStatus())); - if (src.hasMultipleBirth()) - tgt.setMultipleBirth(convertType(src.getMultipleBirth())); - for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) - tgt.addPhoto(convertAttachment(t)); - for (org.hl7.fhir.r5.model.Patient.ContactComponent t : src.getContact()) - tgt.addContact(convertContactComponent(t)); - for (org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent t : src.getCommunication()) - tgt.addCommunication(convertPatientCommunicationComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getGeneralPractitioner()) - tgt.addGeneralPractitioner(convertReference(t)); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - for (org.hl7.fhir.r5.model.Patient.PatientLinkComponent t : src.getLink()) - tgt.addLink(convertPatientLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Patient convertPatient(org.hl7.fhir.r5.model.Patient src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Patient tgt = new org.hl7.fhir.r4.model.Patient(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasDeceased()) + tgt.setDeceased(convertType(src.getDeceased())); + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasMaritalStatus()) + tgt.setMaritalStatus(convertCodeableConcept(src.getMaritalStatus())); + if (src.hasMultipleBirth()) + tgt.setMultipleBirth(convertType(src.getMultipleBirth())); + if (src.hasPhoto()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(convertAttachment(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.Patient.ContactComponent t : src.getContact()) tgt.addContact(convertContactComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertPatientCommunicationComponent(t)); + } + if (src.hasGeneralPractitioner()) { + for (org.hl7.fhir.r5.model.Reference t : src.getGeneralPractitioner()) tgt.addGeneralPractitioner(convertReference(t)); + } + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Patient.PatientLinkComponent t : src.getLink()) tgt.addLink(convertPatientLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Patient.ContactComponent convertContactComponent(org.hl7.fhir.r4.model.Patient.ContactComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Patient.ContactComponent tgt = new org.hl7.fhir.r5.model.Patient.ContactComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) - tgt.addRelationship(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setName(convertHumanName(src.getName())); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } + public static org.hl7.fhir.r5.model.Patient.ContactComponent convertContactComponent(org.hl7.fhir.r4.model.Patient.ContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient.ContactComponent tgt = new org.hl7.fhir.r5.model.Patient.ContactComponent(); + copyElement(src, tgt); + if (src.hasRelationship()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setName(convertHumanName(src.getName())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } - public static org.hl7.fhir.r4.model.Patient.ContactComponent convertContactComponent(org.hl7.fhir.r5.model.Patient.ContactComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Patient.ContactComponent tgt = new org.hl7.fhir.r4.model.Patient.ContactComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) - tgt.addRelationship(convertCodeableConcept(t)); - if (src.hasName()) - tgt.setName(convertHumanName(src.getName())); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasAddress()) - tgt.setAddress(convertAddress(src.getAddress())); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - return tgt; - } + public static org.hl7.fhir.r4.model.Patient.ContactComponent convertContactComponent(org.hl7.fhir.r5.model.Patient.ContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Patient.ContactComponent tgt = new org.hl7.fhir.r4.model.Patient.ContactComponent(); + copyElement(src, tgt); + if (src.hasRelationship()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(convertCodeableConcept(t)); + } + if (src.hasName()) + tgt.setName(convertHumanName(src.getName())); + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) + tgt.setAddress(convertAddress(src.getAddress())); + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + return tgt; + } - public static org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - if (src.hasPreferred()) - tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - if (src.hasPreferred()) - tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.Patient.PatientLinkComponent convertPatientLinkComponent(org.hl7.fhir.r4.model.Patient.PatientLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientLinkComponent(); - copyElement(src, tgt); - if (src.hasOther()) - tgt.setOther(convertReference(src.getOther())); - if (src.hasType()) - tgt.setType(convertLinkType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Patient.PatientLinkComponent convertPatientLinkComponent(org.hl7.fhir.r5.model.Patient.PatientLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r4.model.Patient.PatientLinkComponent(); - copyElement(src, tgt); - if (src.hasOther()) - tgt.setOther(convertReference(src.getOther())); - if (src.hasType()) - tgt.setType(convertLinkType(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Patient.LinkType convertLinkType(org.hl7.fhir.r4.model.Patient.LinkType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REPLACEDBY: return org.hl7.fhir.r5.model.Patient.LinkType.REPLACEDBY; - case REPLACES: return org.hl7.fhir.r5.model.Patient.LinkType.REPLACES; - case REFER: return org.hl7.fhir.r5.model.Patient.LinkType.REFER; - case SEEALSO: return org.hl7.fhir.r5.model.Patient.LinkType.SEEALSO; - default: return org.hl7.fhir.r5.model.Patient.LinkType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Patient.LinkType convertLinkType(org.hl7.fhir.r5.model.Patient.LinkType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REPLACEDBY: return org.hl7.fhir.r4.model.Patient.LinkType.REPLACEDBY; - case REPLACES: return org.hl7.fhir.r4.model.Patient.LinkType.REPLACES; - case REFER: return org.hl7.fhir.r4.model.Patient.LinkType.REFER; - case SEEALSO: return org.hl7.fhir.r4.model.Patient.LinkType.SEEALSO; - default: return org.hl7.fhir.r4.model.Patient.LinkType.NULL; - } -} + public static org.hl7.fhir.r5.model.Patient.PatientLinkComponent convertPatientLinkComponent(org.hl7.fhir.r4.model.Patient.PatientLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientLinkComponent(); + copyElement(src, tgt); + if (src.hasOther()) + tgt.setOther(convertReference(src.getOther())); + if (src.hasType()) + tgt.setType(convertLinkType(src.getType())); + return tgt; + } + public static org.hl7.fhir.r4.model.Patient.PatientLinkComponent convertPatientLinkComponent(org.hl7.fhir.r5.model.Patient.PatientLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r4.model.Patient.PatientLinkComponent(); + copyElement(src, tgt); + if (src.hasOther()) + tgt.setOther(convertReference(src.getOther())); + if (src.hasType()) + tgt.setType(convertLinkType(src.getType())); + return tgt; + } + public static org.hl7.fhir.r5.model.Patient.LinkType convertLinkType(org.hl7.fhir.r4.model.Patient.LinkType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REPLACEDBY: + return org.hl7.fhir.r5.model.Patient.LinkType.REPLACEDBY; + case REPLACES: + return org.hl7.fhir.r5.model.Patient.LinkType.REPLACES; + case REFER: + return org.hl7.fhir.r5.model.Patient.LinkType.REFER; + case SEEALSO: + return org.hl7.fhir.r5.model.Patient.LinkType.SEEALSO; + default: + return org.hl7.fhir.r5.model.Patient.LinkType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Patient.LinkType convertLinkType(org.hl7.fhir.r5.model.Patient.LinkType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REPLACEDBY: + return org.hl7.fhir.r4.model.Patient.LinkType.REPLACEDBY; + case REPLACES: + return org.hl7.fhir.r4.model.Patient.LinkType.REPLACES; + case REFER: + return org.hl7.fhir.r4.model.Patient.LinkType.REFER; + case SEEALSO: + return org.hl7.fhir.r4.model.Patient.LinkType.SEEALSO; + default: + return org.hl7.fhir.r4.model.Patient.LinkType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentNotice.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentNotice.java index b8e2d42e7..7130ea299 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentNotice.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentNotice.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,99 +50,106 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class PaymentNotice extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.r4.model.PaymentNotice src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PaymentNotice tgt = new org.hl7.fhir.r5.model.PaymentNotice(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasResponse()) - tgt.setResponse(convertReference(src.getResponse())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasPayment()) - tgt.setPayment(convertReference(src.getPayment())); - if (src.hasPaymentDate()) - tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); - if (src.hasPayee()) - tgt.setPayee(convertReference(src.getPayee())); - if (src.hasRecipient()) - tgt.setRecipient(convertReference(src.getRecipient())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasPaymentStatus()) - tgt.setPaymentStatus(convertCodeableConcept(src.getPaymentStatus())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.r5.model.PaymentNotice src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PaymentNotice tgt = new org.hl7.fhir.r4.model.PaymentNotice(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasResponse()) - tgt.setResponse(convertReference(src.getResponse())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasProvider()) - tgt.setProvider(convertReference(src.getProvider())); - if (src.hasPayment()) - tgt.setPayment(convertReference(src.getPayment())); - if (src.hasPaymentDate()) - tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); - if (src.hasPayee()) - tgt.setPayee(convertReference(src.getPayee())); - if (src.hasRecipient()) - tgt.setRecipient(convertReference(src.getRecipient())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - if (src.hasPaymentStatus()) - tgt.setPaymentStatus(convertCodeableConcept(src.getPaymentStatus())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertPaymentNoticeStatus(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus convertPaymentNoticeStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.r4.model.PaymentNotice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PaymentNotice tgt = new org.hl7.fhir.r5.model.PaymentNotice(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertReference(src.getResponse())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasPayment()) + tgt.setPayment(convertReference(src.getPayment())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); + if (src.hasPayee()) + tgt.setPayee(convertReference(src.getPayee())); + if (src.hasRecipient()) + tgt.setRecipient(convertReference(src.getRecipient())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasPaymentStatus()) + tgt.setPaymentStatus(convertCodeableConcept(src.getPaymentStatus())); + return tgt; + } + public static org.hl7.fhir.r4.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.r5.model.PaymentNotice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PaymentNotice tgt = new org.hl7.fhir.r4.model.PaymentNotice(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertPaymentNoticeStatus(src.getStatus())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertReference(src.getResponse())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasProvider()) + tgt.setProvider(convertReference(src.getProvider())); + if (src.hasPayment()) + tgt.setPayment(convertReference(src.getPayment())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); + if (src.hasPayee()) + tgt.setPayee(convertReference(src.getPayee())); + if (src.hasRecipient()) + tgt.setRecipient(convertReference(src.getRecipient())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + if (src.hasPaymentStatus()) + tgt.setPaymentStatus(convertCodeableConcept(src.getPaymentStatus())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertPaymentNoticeStatus(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus convertPaymentNoticeStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentReconciliation.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentReconciliation.java index 5d453c3c3..f5fa5067e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentReconciliation.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PaymentReconciliation.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,215 +50,236 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class PaymentReconciliation extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.PaymentReconciliation convertPaymentReconciliation(org.hl7.fhir.r4.model.PaymentReconciliation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PaymentReconciliation tgt = new org.hl7.fhir.r5.model.PaymentReconciliation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertPaymentReconciliationStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasPaymentIssuer()) - tgt.setPaymentIssuer(convertReference(src.getPaymentIssuer())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasRequestor()) - tgt.setRequestor(convertReference(src.getRequestor())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasPaymentDate()) - tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); - if (src.hasPaymentAmount()) - tgt.setPaymentAmount(convertMoney(src.getPaymentAmount())); - if (src.hasPaymentIdentifier()) - tgt.setPaymentIdentifier(convertIdentifier(src.getPaymentIdentifier())); - for (org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent t : src.getDetail()) - tgt.addDetail(convertDetailsComponent(t)); - if (src.hasFormCode()) - tgt.setFormCode(convertCodeableConcept(src.getFormCode())); - for (org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent t : src.getProcessNote()) - tgt.addProcessNote(convertNotesComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.PaymentReconciliation convertPaymentReconciliation(org.hl7.fhir.r5.model.PaymentReconciliation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PaymentReconciliation tgt = new org.hl7.fhir.r4.model.PaymentReconciliation(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertPaymentReconciliationStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasPaymentIssuer()) - tgt.setPaymentIssuer(convertReference(src.getPaymentIssuer())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasRequestor()) - tgt.setRequestor(convertReference(src.getRequestor())); - if (src.hasOutcome()) - tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); - if (src.hasDisposition()) - tgt.setDispositionElement(convertString(src.getDispositionElement())); - if (src.hasPaymentDate()) - tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); - if (src.hasPaymentAmount()) - tgt.setPaymentAmount(convertMoney(src.getPaymentAmount())); - if (src.hasPaymentIdentifier()) - tgt.setPaymentIdentifier(convertIdentifier(src.getPaymentIdentifier())); - for (org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent t : src.getDetail()) - tgt.addDetail(convertDetailsComponent(t)); - if (src.hasFormCode()) - tgt.setFormCode(convertCodeableConcept(src.getFormCode())); - for (org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent t : src.getProcessNote()) - tgt.addProcessNote(convertNotesComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertPaymentReconciliationStatus(org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus convertPaymentReconciliationStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; - case COMPLETE: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; - case ERROR: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; - case PARTIAL: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; - default: return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case QUEUED: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED; - case COMPLETE: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE; - case ERROR: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR; - case PARTIAL: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL; - default: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL; - } -} - - public static org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent convertDetailsComponent(org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent tgt = new org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasPredecessor()) - tgt.setPredecessor(convertIdentifier(src.getPredecessor())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasSubmitter()) - tgt.setSubmitter(convertReference(src.getSubmitter())); - if (src.hasResponse()) - tgt.setResponse(convertReference(src.getResponse())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasResponsible()) - tgt.setResponsible(convertReference(src.getResponsible())); - if (src.hasPayee()) - tgt.setPayee(convertReference(src.getPayee())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent convertDetailsComponent(org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent tgt = new org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasPredecessor()) - tgt.setPredecessor(convertIdentifier(src.getPredecessor())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasRequest()) - tgt.setRequest(convertReference(src.getRequest())); - if (src.hasSubmitter()) - tgt.setSubmitter(convertReference(src.getSubmitter())); - if (src.hasResponse()) - tgt.setResponse(convertReference(src.getResponse())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasResponsible()) - tgt.setResponsible(convertReference(src.getResponsible())); - if (src.hasPayee()) - tgt.setPayee(convertReference(src.getPayee())); - if (src.hasAmount()) - tgt.setAmount(convertMoney(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent convertNotesComponent(org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent tgt = new org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(Enumerations.convertNoteType(src.getType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent convertNotesComponent(org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent tgt = new org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(Enumerations.convertNoteType(src.getType())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.PaymentReconciliation convertPaymentReconciliation(org.hl7.fhir.r4.model.PaymentReconciliation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PaymentReconciliation tgt = new org.hl7.fhir.r5.model.PaymentReconciliation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertPaymentReconciliationStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasPaymentIssuer()) + tgt.setPaymentIssuer(convertReference(src.getPaymentIssuer())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasRequestor()) + tgt.setRequestor(convertReference(src.getRequestor())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); + if (src.hasPaymentAmount()) + tgt.setPaymentAmount(convertMoney(src.getPaymentAmount())); + if (src.hasPaymentIdentifier()) + tgt.setPaymentIdentifier(convertIdentifier(src.getPaymentIdentifier())); + if (src.hasDetail()) { + for (org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent t : src.getDetail()) tgt.addDetail(convertDetailsComponent(t)); + } + if (src.hasFormCode()) + tgt.setFormCode(convertCodeableConcept(src.getFormCode())); + if (src.hasProcessNote()) { + for (org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent t : src.getProcessNote()) tgt.addProcessNote(convertNotesComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.PaymentReconciliation convertPaymentReconciliation(org.hl7.fhir.r5.model.PaymentReconciliation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PaymentReconciliation tgt = new org.hl7.fhir.r4.model.PaymentReconciliation(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertPaymentReconciliationStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasPaymentIssuer()) + tgt.setPaymentIssuer(convertReference(src.getPaymentIssuer())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasRequestor()) + tgt.setRequestor(convertReference(src.getRequestor())); + if (src.hasOutcome()) + tgt.setOutcome(convertRemittanceOutcome(src.getOutcome())); + if (src.hasDisposition()) + tgt.setDispositionElement(convertString(src.getDispositionElement())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(convertDate(src.getPaymentDateElement())); + if (src.hasPaymentAmount()) + tgt.setPaymentAmount(convertMoney(src.getPaymentAmount())); + if (src.hasPaymentIdentifier()) + tgt.setPaymentIdentifier(convertIdentifier(src.getPaymentIdentifier())); + if (src.hasDetail()) { + for (org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent t : src.getDetail()) tgt.addDetail(convertDetailsComponent(t)); + } + if (src.hasFormCode()) + tgt.setFormCode(convertCodeableConcept(src.getFormCode())); + if (src.hasProcessNote()) { + for (org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent t : src.getProcessNote()) tgt.addProcessNote(convertNotesComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertPaymentReconciliationStatus(org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus convertPaymentReconciliationStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.PaymentReconciliation.PaymentReconciliationStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED; + case COMPLETE: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE; + case ERROR: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR; + case PARTIAL: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL; + default: + return org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case QUEUED: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED; + case COMPLETE: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE; + case ERROR: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR; + case PARTIAL: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL; + default: + return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL; + } + } + + public static org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent convertDetailsComponent(org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent tgt = new org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasPredecessor()) + tgt.setPredecessor(convertIdentifier(src.getPredecessor())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasSubmitter()) + tgt.setSubmitter(convertReference(src.getSubmitter())); + if (src.hasResponse()) + tgt.setResponse(convertReference(src.getResponse())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasResponsible()) + tgt.setResponsible(convertReference(src.getResponsible())); + if (src.hasPayee()) + tgt.setPayee(convertReference(src.getPayee())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent convertDetailsComponent(org.hl7.fhir.r5.model.PaymentReconciliation.DetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent tgt = new org.hl7.fhir.r4.model.PaymentReconciliation.DetailsComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasPredecessor()) + tgt.setPredecessor(convertIdentifier(src.getPredecessor())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRequest()) + tgt.setRequest(convertReference(src.getRequest())); + if (src.hasSubmitter()) + tgt.setSubmitter(convertReference(src.getSubmitter())); + if (src.hasResponse()) + tgt.setResponse(convertReference(src.getResponse())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasResponsible()) + tgt.setResponsible(convertReference(src.getResponsible())); + if (src.hasPayee()) + tgt.setPayee(convertReference(src.getPayee())); + if (src.hasAmount()) + tgt.setAmount(convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent convertNotesComponent(org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent tgt = new org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(Enumerations.convertNoteType(src.getType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent convertNotesComponent(org.hl7.fhir.r5.model.PaymentReconciliation.NotesComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent tgt = new org.hl7.fhir.r4.model.PaymentReconciliation.NotesComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(Enumerations.convertNoteType(src.getType())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Person.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Person.java index bb17a04a9..49c5695e0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Person.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Person.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,115 +50,130 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Person extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Person convertPerson(org.hl7.fhir.r4.model.Person src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Person tgt = new org.hl7.fhir.r5.model.Person(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasPhoto()) - tgt.setPhoto(convertAttachment(src.getPhoto())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r4.model.Person.PersonLinkComponent t : src.getLink()) - tgt.addLink(convertPersonLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Person convertPerson(org.hl7.fhir.r4.model.Person src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Person tgt = new org.hl7.fhir.r5.model.Person(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasPhoto()) + tgt.setPhoto(convertAttachment(src.getPhoto())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Person convertPerson(org.hl7.fhir.r5.model.Person src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Person tgt = new org.hl7.fhir.r4.model.Person(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasPhoto()) - tgt.setPhoto(convertAttachment(src.getPhoto())); - if (src.hasManagingOrganization()) - tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r5.model.Person.PersonLinkComponent t : src.getLink()) - tgt.addLink(convertPersonLinkComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Person convertPerson(org.hl7.fhir.r5.model.Person src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Person tgt = new org.hl7.fhir.r4.model.Person(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasPhoto()) + tgt.setPhoto(convertAttachment(src.getPhoto())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(convertReference(src.getManagingOrganization())); + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.r4.model.Person.PersonLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r5.model.Person.PersonLinkComponent(); - copyElement(src, tgt); - if (src.hasTarget()) - tgt.setTarget(convertReference(src.getTarget())); - if (src.hasAssurance()) - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.r5.model.Person.PersonLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r4.model.Person.PersonLinkComponent(); - copyElement(src, tgt); - if (src.hasTarget()) - tgt.setTarget(convertReference(src.getTarget())); - if (src.hasAssurance()) - tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel convertIdentityAssuranceLevel(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case LEVEL1: return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL1; - case LEVEL2: return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL2; - case LEVEL3: return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL3; - case LEVEL4: return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL4; - default: return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.NULL; - } -} - - public static org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel convertIdentityAssuranceLevel(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case LEVEL1: return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL1; - case LEVEL2: return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL2; - case LEVEL3: return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL3; - case LEVEL4: return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL4; - default: return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.NULL; - } -} + public static org.hl7.fhir.r5.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.r4.model.Person.PersonLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r5.model.Person.PersonLinkComponent(); + copyElement(src, tgt); + if (src.hasTarget()) + tgt.setTarget(convertReference(src.getTarget())); + if (src.hasAssurance()) + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + return tgt; + } + public static org.hl7.fhir.r4.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.r5.model.Person.PersonLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r4.model.Person.PersonLinkComponent(); + copyElement(src, tgt); + if (src.hasTarget()) + tgt.setTarget(convertReference(src.getTarget())); + if (src.hasAssurance()) + tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance())); + return tgt; + } + public static org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel convertIdentityAssuranceLevel(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case LEVEL1: + return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL1; + case LEVEL2: + return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL2; + case LEVEL3: + return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL3; + case LEVEL4: + return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL4; + default: + return org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.NULL; + } + } + + public static org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel convertIdentityAssuranceLevel(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case LEVEL1: + return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL1; + case LEVEL2: + return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL2; + case LEVEL3: + return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL3; + case LEVEL4: + return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL4; + default: + return org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PlanDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PlanDefinition.java index bac6c20e4..aeb2ce217 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PlanDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PlanDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,663 +50,804 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class PlanDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r4.model.PlanDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition tgt = new org.hl7.fhir.r5.model.PlanDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) - tgt.getLibrary().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) - tgt.addGoal(convertPlanDefinitionGoalComponent(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) - tgt.addAction(convertPlanDefinitionActionComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r4.model.PlanDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition tgt = new org.hl7.fhir.r5.model.PlanDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r5.model.PlanDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition tgt = new org.hl7.fhir.r4.model.PlanDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasSubtitle()) - tgt.setSubtitleElement(convertString(src.getSubtitleElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasUsage()) - tgt.setUsageElement(convertString(src.getUsageElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) - tgt.addTopic(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) - tgt.addAuthor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) - tgt.addEditor(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) - tgt.addReviewer(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) - tgt.addEndorser(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) - tgt.getLibrary().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) - tgt.addGoal(convertPlanDefinitionGoalComponent(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) - tgt.addAction(convertPlanDefinitionActionComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r5.model.PlanDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition tgt = new org.hl7.fhir.r4.model.PlanDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(convertString(src.getSubtitleElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasTopic()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t)); + } + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t)); + } + if (src.hasEditor()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t)); + } + if (src.hasReviewer()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t)); + } + if (src.hasEndorser()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasLibrary()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t)); + } + if (src.hasGoal()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasDescription()) - tgt.setDescription(convertCodeableConcept(src.getDescription())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasStart()) - tgt.setStart(convertCodeableConcept(src.getStart())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAddresses()) - tgt.addAddresses(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) - tgt.addDocumentation(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) - tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasDescription()) + tgt.setDescription(convertCodeableConcept(src.getDescription())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasStart()) + tgt.setStart(convertCodeableConcept(src.getStart())); + if (src.hasAddresses()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent(); - copyElement(src, tgt); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasDescription()) - tgt.setDescription(convertCodeableConcept(src.getDescription())); - if (src.hasPriority()) - tgt.setPriority(convertCodeableConcept(src.getPriority())); - if (src.hasStart()) - tgt.setStart(convertCodeableConcept(src.getStart())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAddresses()) - tgt.addAddresses(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) - tgt.addDocumentation(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) - tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent(); + copyElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasDescription()) + tgt.setDescription(convertCodeableConcept(src.getDescription())); + if (src.hasPriority()) + tgt.setPriority(convertCodeableConcept(src.getPriority())); + if (src.hasStart()) + tgt.setStart(convertCodeableConcept(src.getStart())); + if (src.hasAddresses()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent(); - copyElement(src, tgt); - if (src.hasMeasure()) - tgt.setMeasure(convertCodeableConcept(src.getMeasure())); - if (src.hasDetail()) - tgt.setDetail(convertType(src.getDetail())); - if (src.hasDue()) - tgt.setDue(convertDuration(src.getDue())); - return tgt; - } + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent(); + copyElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(convertDuration(src.getDue())); + return tgt; + } - public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent(); - copyElement(src, tgt); - if (src.hasMeasure()) - tgt.setMeasure(convertCodeableConcept(src.getMeasure())); - if (src.hasDetail()) - tgt.setDetail(convertType(src.getDetail())); - if (src.hasDue()) - tgt.setDue(convertDuration(src.getDue())); - return tgt; - } + public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent(); + copyElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(convertDuration(src.getDue())); + return tgt; + } - public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent(); - copyElement(src, tgt); - if (src.hasPrefix()) - tgt.setPrefixElement(convertString(src.getPrefixElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTextEquivalent()) - tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) - tgt.addDocumentation(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.IdType t : src.getGoalId()) - tgt.getGoalId().add(convertId(t)); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger()) - tgt.addTrigger(convertTriggerDefinition(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) - tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); - for (org.hl7.fhir.r4.model.DataRequirement t : src.getInput()) - tgt.addInput(convertDataRequirement(t)); - for (org.hl7.fhir.r4.model.DataRequirement t : src.getOutput()) - tgt.addOutput(convertDataRequirement(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) - tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasGroupingBehavior()) - tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); - if (src.hasSelectionBehavior()) - tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); - if (src.hasRequiredBehavior()) - tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); - if (src.hasPrecheckBehavior()) - tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); - if (src.hasCardinalityBehavior()) - tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); -// if (src.hasDefinition()) -// tgt.setDefinitionElement(convertType(src.getDefinitionElement())); - if (src.hasTransform()) - tgt.setTransformElement(convertCanonical(src.getTransformElement())); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) - tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); - for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) - tgt.addAction(convertPlanDefinitionActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent(); - copyElement(src, tgt); - if (src.hasPrefix()) - tgt.setPrefixElement(convertString(src.getPrefixElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTextEquivalent()) - tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) - tgt.addDocumentation(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.IdType t : src.getGoalId()) - tgt.getGoalId().add(convertId(t)); - if (src.hasSubject()) - tgt.setSubject(convertType(src.getSubject())); - for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) - tgt.addTrigger(convertTriggerDefinition(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) - tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); - for (org.hl7.fhir.r5.model.DataRequirement t : src.getInput()) - tgt.addInput(convertDataRequirement(t)); - for (org.hl7.fhir.r5.model.DataRequirement t : src.getOutput()) - tgt.addOutput(convertDataRequirement(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) - tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasGroupingBehavior()) - tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); - if (src.hasSelectionBehavior()) - tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); - if (src.hasRequiredBehavior()) - tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); - if (src.hasPrecheckBehavior()) - tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); - if (src.hasCardinalityBehavior()) - tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); -// if (src.hasDefinition()) -// tgt.setDefinitionElement(convertType(src.getDefinitionElement())); - if (src.hasTransform()) - tgt.setTransformElement(convertCanonical(src.getTransformElement())); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) - tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); - for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) - tgt.addAction(convertPlanDefinitionActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.STAT; - default: return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case VISUALGROUP: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP; - case LOGICALGROUP: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP; - case SENTENCEGROUP: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP; - default: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case VISUALGROUP: return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP; - case LOGICALGROUP: return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP; - case SENTENCEGROUP: return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ANY: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY; - case ALL: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL; - case ALLORNONE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE; - case EXACTLYONE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE; - case ATMOSTONE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE; - case ONEORMORE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE; - default: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ANY: return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ANY; - case ALL: return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALL; - case ALLORNONE: return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE; - case EXACTLYONE: return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE; - case ATMOSTONE: return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE; - case ONEORMORE: return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MUST: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST; - case COULD: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD; - case MUSTUNLESSDOCUMENTED: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; - default: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MUST: return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUST; - case COULD: return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.COULD; - case MUSTUNLESSDOCUMENTED: return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case YES: return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES; - case NO: return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO; - default: return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case YES: return org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.YES; - case NO: return org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NO; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SINGLE: return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE; - case MULTIPLE: return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE; - default: return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SINGLE: return org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.SINGLE; - case MULTIPLE: return org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent(); - copyElement(src, tgt); - if (src.hasKind()) - tgt.setKind(convertActionConditionKind(src.getKind())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent(); - copyElement(src, tgt); - if (src.hasKind()) - tgt.setKind(convertActionConditionKind(src.getKind())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPLICABILITY: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY; - case START: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START; - case STOP: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP; - default: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPLICABILITY: return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.APPLICABILITY; - case START: return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.START; - case STOP: return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.STOP; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent(); - copyElement(src, tgt); - if (src.hasActionId()) - tgt.setActionIdElement(convertId(src.getActionIdElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); - if (src.hasOffset()) - tgt.setOffset(convertType(src.getOffset())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent(); - copyElement(src, tgt); - if (src.hasActionId()) - tgt.setActionIdElement(convertId(src.getActionIdElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); - if (src.hasOffset()) - tgt.setOffset(convertType(src.getOffset())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BEFORESTART: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART; - case BEFORE: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE; - case BEFOREEND: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND; - case CONCURRENTWITHSTART: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART; - case CONCURRENT: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT; - case CONCURRENTWITHEND: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND; - case AFTERSTART: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART; - case AFTER: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER; - case AFTEREND: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND; - default: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BEFORESTART: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORESTART; - case BEFORE: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORE; - case BEFOREEND: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFOREEND; - case CONCURRENTWITHSTART: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART; - case CONCURRENT: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENT; - case CONCURRENTWITHEND: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND; - case AFTERSTART: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTERSTART; - case AFTER: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTER; - case AFTEREND: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTEREND; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.NULL; - } -} - - public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertActionParticipantType(src.getType())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertActionParticipantType(src.getType())); - if (src.hasRole()) - tgt.setRole(convertCodeableConcept(src.getRole())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ActionParticipantType convertActionParticipantType(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT; - case PRACTITIONER: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER; - case RELATEDPERSON: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON; - case DEVICE: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE; - default: return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL; - } -} - - public static org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType convertActionParticipantType(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PATIENT: return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PATIENT; - case PRACTITIONER: return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PRACTITIONER; - case RELATEDPERSON: return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.RELATEDPERSON; - case DEVICE: return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.DEVICE; - default: return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.NULL; - } -} - - public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent(); - copyElement(src, tgt); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent(); - copyElement(src, tgt); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent(); + copyElement(src, tgt); + if (src.hasPrefix()) + tgt.setPrefixElement(convertString(src.getPrefixElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTextEquivalent()) + tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t)); + } + if (src.hasGoalId()) { + for (org.hl7.fhir.r4.model.IdType t : src.getGoalId()) tgt.getGoalId().add(convertId(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasTrigger()) { + for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger()) tgt.addTrigger(convertTriggerDefinition(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + } + if (src.hasInput()) { + for (org.hl7.fhir.r4.model.DataRequirement t : src.getInput()) tgt.addInput(convertDataRequirement(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.r4.model.DataRequirement t : src.getOutput()) tgt.addOutput(convertDataRequirement(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + } + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasGroupingBehavior()) + tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); + if (src.hasSelectionBehavior()) + tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); + if (src.hasRequiredBehavior()) + tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); + if (src.hasPrecheckBehavior()) + tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); + if (src.hasCardinalityBehavior()) + tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); + // if (src.hasDefinition()) + // tgt.setDefinitionElement(convertType(src.getDefinitionElement())); + if (src.hasTransform()) + tgt.setTransformElement(convertCanonical(src.getTransformElement())); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent(); + copyElement(src, tgt); + if (src.hasPrefix()) + tgt.setPrefixElement(convertString(src.getPrefixElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTextEquivalent()) + tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t)); + } + if (src.hasGoalId()) { + for (org.hl7.fhir.r5.model.IdType t : src.getGoalId()) tgt.getGoalId().add(convertId(t)); + } + if (src.hasSubject()) + tgt.setSubject(convertType(src.getSubject())); + if (src.hasTrigger()) { + for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) tgt.addTrigger(convertTriggerDefinition(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + } + if (src.hasInput()) { + for (org.hl7.fhir.r5.model.DataRequirement t : src.getInput()) tgt.addInput(convertDataRequirement(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.r5.model.DataRequirement t : src.getOutput()) tgt.addOutput(convertDataRequirement(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + } + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasGroupingBehavior()) + tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); + if (src.hasSelectionBehavior()) + tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); + if (src.hasRequiredBehavior()) + tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); + if (src.hasPrecheckBehavior()) + tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); + if (src.hasCardinalityBehavior()) + tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); + // if (src.hasDefinition()) + // tgt.setDefinitionElement(convertType(src.getDefinitionElement())); + if (src.hasTransform()) + tgt.setTransformElement(convertCanonical(src.getTransformElement())); + if (src.hasDynamicValue()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.STAT; + default: + return org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case VISUALGROUP: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP; + case LOGICALGROUP: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP; + case SENTENCEGROUP: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case VISUALGROUP: + return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP; + case LOGICALGROUP: + return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP; + case SENTENCEGROUP: + return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ANY: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY; + case ALL: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL; + case ALLORNONE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE; + case EXACTLYONE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE; + case ATMOSTONE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE; + case ONEORMORE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ANY: + return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ANY; + case ALL: + return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALL; + case ALLORNONE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE; + case EXACTLYONE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE; + case ATMOSTONE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE; + case ONEORMORE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MUST: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST; + case COULD: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD; + case MUSTUNLESSDOCUMENTED: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MUST: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUST; + case COULD: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.COULD; + case MUSTUNLESSDOCUMENTED: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case YES: + return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES; + case NO: + return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case YES: + return org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.YES; + case NO: + return org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NO; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SINGLE: + return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE; + case MULTIPLE: + return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SINGLE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.SINGLE; + case MULTIPLE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent(); + copyElement(src, tgt); + if (src.hasKind()) + tgt.setKind(convertActionConditionKind(src.getKind())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent(); + copyElement(src, tgt); + if (src.hasKind()) + tgt.setKind(convertActionConditionKind(src.getKind())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPLICABILITY: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY; + case START: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START; + case STOP: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPLICABILITY: + return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.APPLICABILITY; + case START: + return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.START; + case STOP: + return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.STOP; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent(); + copyElement(src, tgt); + if (src.hasActionId()) + tgt.setActionIdElement(convertId(src.getActionIdElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); + if (src.hasOffset()) + tgt.setOffset(convertType(src.getOffset())); + return tgt; + } + + public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent(); + copyElement(src, tgt); + if (src.hasActionId()) + tgt.setActionIdElement(convertId(src.getActionIdElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); + if (src.hasOffset()) + tgt.setOffset(convertType(src.getOffset())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BEFORESTART: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART; + case BEFORE: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE; + case BEFOREEND: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND; + case CONCURRENTWITHSTART: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART; + case CONCURRENT: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT; + case CONCURRENTWITHEND: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND; + case AFTERSTART: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART; + case AFTER: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER; + case AFTEREND: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BEFORESTART: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORESTART; + case BEFORE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORE; + case BEFOREEND: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFOREEND; + case CONCURRENTWITHSTART: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART; + case CONCURRENT: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENT; + case CONCURRENTWITHEND: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND; + case AFTERSTART: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTERSTART; + case AFTER: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTER; + case AFTEREND: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTEREND; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.NULL; + } + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertActionParticipantType(src.getType())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertActionParticipantType(src.getType())); + if (src.hasRole()) + tgt.setRole(convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionParticipantType convertActionParticipantType(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT; + case PRACTITIONER: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER; + case RELATEDPERSON: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON; + case DEVICE: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL; + } + } + + public static org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType convertActionParticipantType(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PATIENT: + return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PATIENT; + case PRACTITIONER: + return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PRACTITIONER; + case RELATEDPERSON: + return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.RELATEDPERSON; + case DEVICE: + return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.DEVICE; + default: + return org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.NULL; + } + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent(); + copyElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent(); + copyElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Practitioner.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Practitioner.java index d4cb7a6e5..66c4c2389 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Practitioner.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Practitioner.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,99 +50,110 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Practitioner extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Practitioner convertPractitioner(org.hl7.fhir.r4.model.Practitioner src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Practitioner tgt = new org.hl7.fhir.r5.model.Practitioner(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) - tgt.addPhoto(convertAttachment(t)); - for (org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) - tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) - tgt.addCommunication(convertCodeableConcept(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Practitioner convertPractitioner(org.hl7.fhir.r4.model.Practitioner src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Practitioner tgt = new org.hl7.fhir.r5.model.Practitioner(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasPhoto()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(convertCodeableConcept(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Practitioner convertPractitioner(org.hl7.fhir.r5.model.Practitioner src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Practitioner tgt = new org.hl7.fhir.r4.model.Practitioner(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) - tgt.addPhoto(convertAttachment(t)); - for (org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) - tgt.addQualification(convertPractitionerQualificationComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) - tgt.addCommunication(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent convertPractitionerQualificationComponent(org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasIssuer()) - tgt.setIssuer(convertReference(src.getIssuer())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent convertPractitionerQualificationComponent(org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasIssuer()) - tgt.setIssuer(convertReference(src.getIssuer())); - return tgt; - } + public static org.hl7.fhir.r4.model.Practitioner convertPractitioner(org.hl7.fhir.r5.model.Practitioner src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Practitioner tgt = new org.hl7.fhir.r4.model.Practitioner(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasPhoto()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(convertAttachment(t)); + } + if (src.hasQualification()) { + for (org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) tgt.addQualification(convertPractitionerQualificationComponent(t)); + } + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) tgt.addCommunication(convertCodeableConcept(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent convertPractitionerQualificationComponent(org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasIssuer()) + tgt.setIssuer(convertReference(src.getIssuer())); + return tgt; + } + public static org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent convertPractitionerQualificationComponent(org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r4.model.Practitioner.PractitionerQualificationComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasIssuer()) + tgt.setIssuer(convertReference(src.getIssuer())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java index dd36b5dca..c745815cd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,169 +50,200 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class PractitionerRole extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.PractitionerRole convertPractitionerRole(org.hl7.fhir.r4.model.PractitionerRole src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PractitionerRole tgt = new org.hl7.fhir.r5.model.PractitionerRole(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasPractitioner()) - tgt.setPractitioner(convertReference(src.getPractitioner())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) - tgt.addLocation(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getHealthcareService()) - tgt.addHealthcareService(convertReference(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) - tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); - for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) - tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); - if (src.hasAvailabilityExceptions()) - tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.PractitionerRole convertPractitionerRole(org.hl7.fhir.r4.model.PractitionerRole src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PractitionerRole tgt = new org.hl7.fhir.r5.model.PractitionerRole(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasPractitioner()) + tgt.setPractitioner(convertReference(src.getPractitioner())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.Reference t : src.getLocation()) tgt.addLocation(convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.r4.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.PractitionerRole convertPractitionerRole(org.hl7.fhir.r5.model.PractitionerRole src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PractitionerRole tgt = new org.hl7.fhir.r4.model.PractitionerRole(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasPractitioner()) - tgt.setPractitioner(convertReference(src.getPractitioner())); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) - tgt.addLocation(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) - tgt.addHealthcareService(convertReference(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) - tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); - for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) - tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); - if (src.hasAvailabilityExceptions()) - tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) - tgt.addEndpoint(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.PractitionerRole convertPractitionerRole(org.hl7.fhir.r5.model.PractitionerRole src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PractitionerRole tgt = new org.hl7.fhir.r4.model.PractitionerRole(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasPractitioner()) + tgt.setPractitioner(convertReference(src.getPractitioner())); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(convertReference(t)); + } + if (src.hasHealthcareService()) { + for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) tgt.addHealthcareService(convertReference(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasAvailableTime()) { + for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + } + if (src.hasNotAvailable()) { + for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + } + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement())); + if (src.hasEndpoint()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent convertPractitionerRoleAvailableTimeComponent(org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - if (src.hasAllDay()) - tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); - if (src.hasAvailableStartTime()) - tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); - if (src.hasAvailableEndTime()) - tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent convertPractitionerRoleAvailableTimeComponent(org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); - if (src.hasAllDay()) - tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); - if (src.hasAvailableStartTime()) - tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); - if (src.hasAvailableEndTime()) - tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MON: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON; - case TUE: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE; - case WED: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED; - case THU: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU; - case FRI: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI; - case SAT: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT; - case SUN: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN; - default: return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL; - } -} - - public static org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MON: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.MON; - case TUE: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.TUE; - case WED: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.WED; - case THU: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.THU; - case FRI: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.FRI; - case SAT: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.SAT; - case SUN: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.SUN; - default: return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.NULL; - } -} - - public static org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent convertPractitionerRoleNotAvailableComponent(org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasDuring()) - tgt.setDuring(convertPeriod(src.getDuring())); - return tgt; - } - - public static org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent convertPractitionerRoleNotAvailableComponent(org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent tgt = new org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasDuring()) - tgt.setDuring(convertPeriod(src.getDuring())); - return tgt; - } + public static org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent convertPractitionerRoleAvailableTimeComponent(org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); + copyElement(src, tgt); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) + tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent convertPractitionerRoleAvailableTimeComponent(org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); + copyElement(src, tgt); + if (src.hasDaysOfWeek()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); + } + if (src.hasAllDay()) + tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MON: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON; + case TUE: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE; + case WED: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED; + case THU: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU; + case FRI: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI; + case SAT: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT; + case SUN: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN; + default: + return org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL; + } + } + + public static org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MON: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.MON; + case TUE: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.TUE; + case WED: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.WED; + case THU: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.THU; + case FRI: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.FRI; + case SAT: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.SAT; + case SUN: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.SUN; + default: + return org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.NULL; + } + } + + public static org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent convertPractitionerRoleNotAvailableComponent(org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(convertPeriod(src.getDuring())); + return tgt; + } + + public static org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent convertPractitionerRoleNotAvailableComponent(org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent tgt = new org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleNotAvailableComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(convertPeriod(src.getDuring())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Procedure.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Procedure.java index 2806a715b..fa89957b9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Procedure.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Procedure.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,227 +51,266 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Procedure extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Procedure convertProcedure(org.hl7.fhir.r4.model.Procedure src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Procedure tgt = new org.hl7.fhir.r5.model.Procedure(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertProcedureStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasCategory()) - tgt.addCategory(convertCodeableConcept(src.getCategory())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasPerformed()) - tgt.setOccurrence(convertType(src.getPerformed())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - if (src.hasAsserter()) - tgt.setReported(convertReference(src.getAsserter())); - for (org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertProcedurePerformerComponent(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - if (src.hasOutcome()) - tgt.setOutcome(convertCodeableConcept(src.getOutcome())); - for (org.hl7.fhir.r4.model.Reference t : src.getReport()) - tgt.addReport(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getComplication()) - tgt.addComplication(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getComplicationDetail()) - tgt.addComplicationDetail(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFollowUp()) - tgt.addFollowUp(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) - tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getUsedReference()) - tgt.addUsed(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getUsedCode()) - tgt.addUsed(convertCodeableConceptToCodeableReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Procedure convertProcedure(org.hl7.fhir.r5.model.Procedure src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Procedure tgt = new org.hl7.fhir.r4.model.Procedure(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertProcedureStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setPerformed(convertType(src.getOccurrence())); - if (src.hasRecorder()) - tgt.setRecorder(convertReference(src.getRecorder())); - if (src.hasReportedReference()) - tgt.setAsserter(convertReference(src.getReportedReference())); - for (org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) - tgt.addPerformer(convertProcedurePerformerComponent(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - if (src.hasOutcome()) - tgt.setOutcome(convertCodeableConcept(src.getOutcome())); - for (org.hl7.fhir.r5.model.Reference t : src.getReport()) - tgt.addReport(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getComplication()) - tgt.addComplication(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getComplicationDetail()) - tgt.addComplicationDetail(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFollowUp()) - tgt.addFollowUp(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) - tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); - for (CodeableReference t : src.getUsed()) - if (t.hasReference()) - tgt.addUsedReference(convertReference(t.getReference())); - for (CodeableReference t : src.getUsed()) - if (t.hasConcept()) - tgt.addUsedCode(convertCodeableConcept(t.getConcept())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.EventStatus convertProcedureStatus(org.hl7.fhir.r4.model.Procedure.ProcedureStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PREPARATION: return org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION; - case INPROGRESS: return org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS; - case NOTDONE: return org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD; - case STOPPED: return org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Procedure.ProcedureStatus convertProcedureStatus(org.hl7.fhir.r5.model.Enumerations.EventStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PREPARATION: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.PREPARATION; - case INPROGRESS: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.INPROGRESS; - case NOTDONE: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NOTDONE; - case ONHOLD: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ONHOLD; - case STOPPED: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.STOPPED; - case COMPLETED: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent(); - copyElement(src, tgt); - if (src.hasFunction()) - tgt.setFunction(convertCodeableConcept(src.getFunction())); - if (src.hasActor()) - tgt.setActor(convertReference(src.getActor())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent(); - copyElement(src, tgt); - if (src.hasAction()) - tgt.setAction(convertCodeableConcept(src.getAction())); - if (src.hasManipulated()) - tgt.setManipulated(convertReference(src.getManipulated())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent(); - copyElement(src, tgt); - if (src.hasAction()) - tgt.setAction(convertCodeableConcept(src.getAction())); - if (src.hasManipulated()) - tgt.setManipulated(convertReference(src.getManipulated())); - return tgt; - } + public static org.hl7.fhir.r5.model.Procedure convertProcedure(org.hl7.fhir.r4.model.Procedure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Procedure tgt = new org.hl7.fhir.r5.model.Procedure(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertProcedureStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) + tgt.addCategory(convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasPerformed()) + tgt.setOccurrence(convertType(src.getPerformed())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + if (src.hasAsserter()) + tgt.setReported(convertReference(src.getAsserter())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertProcedurePerformerComponent(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasOutcome()) + tgt.setOutcome(convertCodeableConcept(src.getOutcome())); + if (src.hasReport()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReport()) tgt.addReport(convertReference(t)); + } + if (src.hasComplication()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getComplication()) tgt.addComplication(convertCodeableConcept(t)); + } + if (src.hasComplicationDetail()) { + for (org.hl7.fhir.r4.model.Reference t : src.getComplicationDetail()) tgt.addComplicationDetail(convertReference(t)); + } + if (src.hasFollowUp()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFollowUp()) tgt.addFollowUp(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasFocalDevice()) { + for (org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + } + if (src.hasUsedReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getUsedReference()) tgt.addUsed(convertReferenceToCodeableReference(t)); + } + if (src.hasUsedCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getUsedCode()) tgt.addUsed(convertCodeableConceptToCodeableReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Procedure convertProcedure(org.hl7.fhir.r5.model.Procedure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Procedure tgt = new org.hl7.fhir.r4.model.Procedure(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertProcedureStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategoryFirstRep())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setPerformed(convertType(src.getOccurrence())); + if (src.hasRecorder()) + tgt.setRecorder(convertReference(src.getRecorder())); + if (src.hasReportedReference()) + tgt.setAsserter(convertReference(src.getReportedReference())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) tgt.addPerformer(convertProcedurePerformerComponent(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasBodySite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasOutcome()) + tgt.setOutcome(convertCodeableConcept(src.getOutcome())); + if (src.hasReport()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReport()) tgt.addReport(convertReference(t)); + } + if (src.hasComplication()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getComplication()) tgt.addComplication(convertCodeableConcept(t)); + } + if (src.hasComplicationDetail()) { + for (org.hl7.fhir.r5.model.Reference t : src.getComplicationDetail()) tgt.addComplicationDetail(convertReference(t)); + } + if (src.hasFollowUp()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFollowUp()) tgt.addFollowUp(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasFocalDevice()) { + for (org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + } + for (CodeableReference t : src.getUsed()) if (t.hasReference()) + tgt.addUsedReference(convertReference(t.getReference())); + for (CodeableReference t : src.getUsed()) if (t.hasConcept()) + tgt.addUsedCode(convertCodeableConcept(t.getConcept())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.EventStatus convertProcedureStatus(org.hl7.fhir.r4.model.Procedure.ProcedureStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PREPARATION: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION; + case INPROGRESS: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS; + case NOTDONE: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD; + case STOPPED: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Procedure.ProcedureStatus convertProcedureStatus(org.hl7.fhir.r5.model.Enumerations.EventStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PREPARATION: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.PREPARATION; + case INPROGRESS: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.INPROGRESS; + case NOTDONE: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NOTDONE; + case ONHOLD: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ONHOLD; + case STOPPED: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.STOPPED; + case COMPLETED: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent(); + copyElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(convertReference(src.getActor())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent(); + copyElement(src, tgt); + if (src.hasAction()) + tgt.setAction(convertCodeableConcept(src.getAction())); + if (src.hasManipulated()) + tgt.setManipulated(convertReference(src.getManipulated())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.r4.model.Procedure.ProcedureFocalDeviceComponent(); + copyElement(src, tgt); + if (src.hasAction()) + tgt.setAction(convertCodeableConcept(src.getAction())); + if (src.hasManipulated()) + tgt.setManipulated(convertReference(src.getManipulated())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Provenance.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Provenance.java index 989e5fa8c..4658698be 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Provenance.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Provenance.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,153 +50,176 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Provenance extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Provenance convertProvenance(org.hl7.fhir.r4.model.Provenance src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Provenance tgt = new org.hl7.fhir.r5.model.Provenance(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Reference t : src.getTarget()) - tgt.addTarget(convertReference(t)); - if (src.hasOccurred()) - tgt.setOccurred(convertType(src.getOccurred())); - if (src.hasRecorded()) - tgt.setRecordedElement(convertInstant(src.getRecordedElement())); - for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) - tgt.getPolicy().add(convertUri(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - if (src.hasActivity()) - tgt.setActivity(convertCodeableConcept(src.getActivity())); - for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) - tgt.addAgent(convertProvenanceAgentComponent(t)); - for (org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) - tgt.addEntity(convertProvenanceEntityComponent(t)); - for (org.hl7.fhir.r4.model.Signature t : src.getSignature()) - tgt.addSignature(convertSignature(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Provenance convertProvenance(org.hl7.fhir.r4.model.Provenance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Provenance tgt = new org.hl7.fhir.r5.model.Provenance(); + copyDomainResource(src, tgt); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.Reference t : src.getTarget()) tgt.addTarget(convertReference(t)); + } + if (src.hasOccurred()) + tgt.setOccurred(convertType(src.getOccurred())); + if (src.hasRecorded()) + tgt.setRecordedElement(convertInstant(src.getRecordedElement())); + if (src.hasPolicy()) { + for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.getPolicy().add(convertUri(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasReason()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasActivity()) + tgt.setActivity(convertCodeableConcept(src.getActivity())); + if (src.hasAgent()) { + for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + if (src.hasEntity()) { + for (org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); + } + if (src.hasSignature()) { + for (org.hl7.fhir.r4.model.Signature t : src.getSignature()) tgt.addSignature(convertSignature(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Provenance convertProvenance(org.hl7.fhir.r5.model.Provenance src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Provenance tgt = new org.hl7.fhir.r4.model.Provenance(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Reference t : src.getTarget()) - tgt.addTarget(convertReference(t)); - if (src.hasOccurred()) - tgt.setOccurred(convertType(src.getOccurred())); - if (src.hasRecorded()) - tgt.setRecordedElement(convertInstant(src.getRecordedElement())); - for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) - tgt.getPolicy().add(convertUri(t)); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) - tgt.addReason(convertCodeableConcept(t)); - if (src.hasActivity()) - tgt.setActivity(convertCodeableConcept(src.getActivity())); - for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) - tgt.addAgent(convertProvenanceAgentComponent(t)); - for (org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) - tgt.addEntity(convertProvenanceEntityComponent(t)); - for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) - tgt.addSignature(convertSignature(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Provenance convertProvenance(org.hl7.fhir.r5.model.Provenance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Provenance tgt = new org.hl7.fhir.r4.model.Provenance(); + copyDomainResource(src, tgt); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.Reference t : src.getTarget()) tgt.addTarget(convertReference(t)); + } + if (src.hasOccurred()) + tgt.setOccurred(convertType(src.getOccurred())); + if (src.hasRecorded()) + tgt.setRecordedElement(convertInstant(src.getRecordedElement())); + if (src.hasPolicy()) { + for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(convertUri(t)); + } + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasReason()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); + } + if (src.hasActivity()) + tgt.setActivity(convertCodeableConcept(src.getActivity())); + if (src.hasAgent()) { + for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + if (src.hasEntity()) { + for (org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t)); + } + if (src.hasSignature()) { + for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) tgt.addSignature(convertSignature(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) - tgt.addRole(convertCodeableConcept(t)); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - return tgt; - } + public static org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRole()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole()) tgt.addRole(convertCodeableConcept(t)); + } + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + return tgt; + } - public static org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) - tgt.addRole(convertCodeableConcept(t)); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - return tgt; - } + public static org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRole()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) tgt.addRole(convertCodeableConcept(t)); + } + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + return tgt; + } - public static org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent(); - copyElement(src, tgt); - if (src.hasRole()) - tgt.setRole(convertProvenanceEntityRole(src.getRole())); - if (src.hasWhat()) - tgt.setWhat(convertReference(src.getWhat())); - for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) - tgt.addAgent(convertProvenanceAgentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent(); - copyElement(src, tgt); - if (src.hasRole()) - tgt.setRole(convertProvenanceEntityRole(src.getRole())); - if (src.hasWhat()) - tgt.setWhat(convertReference(src.getWhat())); - for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) - tgt.addAgent(convertProvenanceAgentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole convertProvenanceEntityRole(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DERIVATION: return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.DERIVATION; - case REVISION: return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REVISION; - case QUOTATION: return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.QUOTATION; - case SOURCE: return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.SOURCE; - case REMOVAL: return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REMOVAL; - default: return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.NULL; - } -} - - public static org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole convertProvenanceEntityRole(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DERIVATION: return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.DERIVATION; - case REVISION: return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REVISION; - case QUOTATION: return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.QUOTATION; - case SOURCE: return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.SOURCE; - case REMOVAL: return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REMOVAL; - default: return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.NULL; - } -} + public static org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent(); + copyElement(src, tgt); + if (src.hasRole()) + tgt.setRole(convertProvenanceEntityRole(src.getRole())); + if (src.hasWhat()) + tgt.setWhat(convertReference(src.getWhat())); + if (src.hasAgent()) { + for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent(); + copyElement(src, tgt); + if (src.hasRole()) + tgt.setRole(convertProvenanceEntityRole(src.getRole())); + if (src.hasWhat()) + tgt.setWhat(convertReference(src.getWhat())); + if (src.hasAgent()) { + for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole convertProvenanceEntityRole(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DERIVATION: + return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.DERIVATION; + case REVISION: + return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REVISION; + case QUOTATION: + return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.QUOTATION; + case SOURCE: + return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.SOURCE; + case REMOVAL: + return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REMOVAL; + default: + return org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.NULL; + } + } + + public static org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole convertProvenanceEntityRole(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DERIVATION: + return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.DERIVATION; + case REVISION: + return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REVISION; + case QUOTATION: + return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.QUOTATION; + case SOURCE: + return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.SOURCE; + case REMOVAL: + return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REMOVAL; + default: + return org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Questionnaire.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Questionnaire.java index d16cdb3db..0df3cbace 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Questionnaire.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Questionnaire.java @@ -19,15 +19,12 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Enumerations.ResourceTypeEnum; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -56,367 +53,445 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Questionnaire extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Questionnaire convertQuestionnaire(org.hl7.fhir.r4.model.Questionnaire src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Questionnaire tgt = new org.hl7.fhir.r5.model.Questionnaire(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getDerivedFrom()) - tgt.getDerivedFrom().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) - tgt.getSubjectType().add(convertResourceEnum(t)); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) - tgt.addCode(convertCoding(t)); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireItemComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.Questionnaire convertQuestionnaire(org.hl7.fhir.r4.model.Questionnaire src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire tgt = new org.hl7.fhir.r5.model.Questionnaire(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getDerivedFrom()) tgt.getDerivedFrom().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubjectType()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.getSubjectType().add(convertResourceEnum(t)); + } + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(convertCoding(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.Questionnaire convertQuestionnaire(org.hl7.fhir.r5.model.Questionnaire src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Questionnaire tgt = new org.hl7.fhir.r4.model.Questionnaire(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getDerivedFrom()) - tgt.getDerivedFrom().add(convertCanonical(t)); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - for (CodeType t : src.getSubjectType()) - tgt.getSubjectType().add(convertResourceEnum(t)); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasApprovalDate()) - tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); - if (src.hasLastReviewDate()) - tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); - if (src.hasEffectivePeriod()) - tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) - tgt.addCode(convertCoding(t)); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireItemComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.Questionnaire convertQuestionnaire(org.hl7.fhir.r5.model.Questionnaire src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Questionnaire tgt = new org.hl7.fhir.r4.model.Questionnaire(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDerivedFrom()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getDerivedFrom()) tgt.getDerivedFrom().add(convertCanonical(t)); + } + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasSubjectType()) { + for (CodeType t : src.getSubjectType()) tgt.getSubjectType().add(convertResourceEnum(t)); + } + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod())); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(convertCoding(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent(); - copyElement(src, tgt); - if (src.hasLinkId()) - tgt.setLinkIdElement(convertString(src.getLinkIdElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); - for (org.hl7.fhir.r4.model.Coding t : src.getCode()) - tgt.addCode(convertCoding(t)); - if (src.hasPrefix()) - tgt.setPrefixElement(convertString(src.getPrefixElement())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasType()) - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) - tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); - if (src.hasEnableBehavior()) - tgt.setEnableBehavior(convertEnableWhenBehavior(src.getEnableBehavior())); - if (src.hasRequired()) - tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); - if (src.hasRepeats()) - tgt.setRepeatsElement(convertBoolean(src.getRepeatsElement())); - if (src.hasReadOnly()) - tgt.setReadOnlyElement(convertBoolean(src.getReadOnlyElement())); - if (src.hasMaxLength()) - tgt.setMaxLengthElement(convertInteger(src.getMaxLengthElement())); - if (src.hasAnswerValueSet()) - tgt.setAnswerValueSetElement(convertCanonical(src.getAnswerValueSetElement())); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) - tgt.addAnswerOption(convertQuestionnaireItemAnswerOptionComponent(t)); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent t : src.getInitial()) - tgt.addInitial(convertQuestionnaireItemInitialComponent(t)); - for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent(); - copyElement(src, tgt); - if (src.hasLinkId()) - tgt.setLinkIdElement(convertString(src.getLinkIdElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); - for (org.hl7.fhir.r5.model.Coding t : src.getCode()) - tgt.addCode(convertCoding(t)); - if (src.hasPrefix()) - tgt.setPrefixElement(convertString(src.getPrefixElement())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - if (src.hasType()) - tgt.setType(convertQuestionnaireItemType(src.getType())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) - tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); - if (src.hasEnableBehavior()) - tgt.setEnableBehavior(convertEnableWhenBehavior(src.getEnableBehavior())); - if (src.hasRequired()) - tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); - if (src.hasRepeats()) - tgt.setRepeatsElement(convertBoolean(src.getRepeatsElement())); - if (src.hasReadOnly()) - tgt.setReadOnlyElement(convertBoolean(src.getReadOnlyElement())); - if (src.hasMaxLength()) - tgt.setMaxLengthElement(convertInteger(src.getMaxLengthElement())); - if (src.hasAnswerValueSet()) - tgt.setAnswerValueSetElement(convertCanonical(src.getAnswerValueSetElement())); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) - tgt.addAnswerOption(convertQuestionnaireItemAnswerOptionComponent(t)); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent t : src.getInitial()) - tgt.addInitial(convertQuestionnaireItemInitialComponent(t)); - for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType convertQuestionnaireItemType(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case GROUP: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP; - case DISPLAY: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DISPLAY; - case QUESTION: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP; - case BOOLEAN: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.BOOLEAN; - case DECIMAL: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DECIMAL; - case INTEGER: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.INTEGER; - case DATE: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATE; - case DATETIME: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME; - case TIME: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TIME; - case STRING: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.STRING; - case TEXT: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TEXT; - case URL: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.URL; - case CHOICE: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CHOICE; - case OPENCHOICE: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.OPENCHOICE; - case ATTACHMENT: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.ATTACHMENT; - case REFERENCE: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.REFERENCE; - case QUANTITY: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.QUANTITY; - default: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.NULL; - } -} - - public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType convertQuestionnaireItemType(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case GROUP: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP; - case DISPLAY: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DISPLAY; -// case QUESTION: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUESTION; - case BOOLEAN: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.BOOLEAN; - case DECIMAL: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DECIMAL; - case INTEGER: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.INTEGER; - case DATE: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATE; - case DATETIME: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME; - case TIME: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TIME; - case STRING: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.STRING; - case TEXT: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TEXT; - case URL: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.URL; - case CHOICE: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.CHOICE; - case OPENCHOICE: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.OPENCHOICE; - case ATTACHMENT: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.ATTACHMENT; - case REFERENCE: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.REFERENCE; - case QUANTITY: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUANTITY; - default: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.NULL; - } -} - - public static org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior convertEnableWhenBehavior(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ALL: return org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ALL; - case ANY: return org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ANY; - default: return org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior convertEnableWhenBehavior(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ALL: return org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ALL; - case ANY: return org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ANY; - default: return org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); - copyElement(src, tgt); - if (src.hasQuestion()) - tgt.setQuestionElement(convertString(src.getQuestionElement())); - if (src.hasOperator()) - tgt.setOperator(convertQuestionnaireItemOperator(src.getOperator())); - if (src.hasAnswer()) - tgt.setAnswer(convertType(src.getAnswer())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); - copyElement(src, tgt); - if (src.hasQuestion()) - tgt.setQuestionElement(convertString(src.getQuestionElement())); - if (src.hasOperator()) - tgt.setOperator(convertQuestionnaireItemOperator(src.getOperator())); - if (src.hasAnswer()) - tgt.setAnswer(convertType(src.getAnswer())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator convertQuestionnaireItemOperator(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EXISTS: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EXISTS; - case EQUAL: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EQUAL; - case NOT_EQUAL: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL; - case GREATER_THAN: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN; - case LESS_THAN: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN; - case GREATER_OR_EQUAL: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL; - case LESS_OR_EQUAL: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL; - default: return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NULL; - } -} - - public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator convertQuestionnaireItemOperator(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EXISTS: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EXISTS; - case EQUAL: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EQUAL; - case NOT_EQUAL: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL; - case GREATER_THAN: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN; - case LESS_THAN: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN; - case GREATER_OR_EQUAL: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL; - case LESS_OR_EQUAL: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL; - default: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NULL; - } -} - - public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasInitialSelected()) - tgt.setInitialSelectedElement(convertBoolean(src.getInitialSelectedElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - if (src.hasInitialSelected()) - tgt.setInitialSelectedElement(convertBoolean(src.getInitialSelectedElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent convertQuestionnaireItemInitialComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent convertQuestionnaireItemInitialComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent(); + copyElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(convertCoding(t)); + } + if (src.hasPrefix()) + tgt.setPrefixElement(convertString(src.getPrefixElement())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasType()) + tgt.setType(convertQuestionnaireItemType(src.getType())); + if (src.hasEnableWhen()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } + if (src.hasEnableBehavior()) + tgt.setEnableBehavior(convertEnableWhenBehavior(src.getEnableBehavior())); + if (src.hasRequired()) + tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); + if (src.hasRepeats()) + tgt.setRepeatsElement(convertBoolean(src.getRepeatsElement())); + if (src.hasReadOnly()) + tgt.setReadOnlyElement(convertBoolean(src.getReadOnlyElement())); + if (src.hasMaxLength()) + tgt.setMaxLengthElement(convertInteger(src.getMaxLengthElement())); + if (src.hasAnswerValueSet()) + tgt.setAnswerValueSetElement(convertCanonical(src.getAnswerValueSetElement())); + if (src.hasAnswerOption()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addAnswerOption(convertQuestionnaireItemAnswerOptionComponent(t)); + } + if (src.hasInitial()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent t : src.getInitial()) tgt.addInitial(convertQuestionnaireItemInitialComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent(); + copyElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(convertCoding(t)); + } + if (src.hasPrefix()) + tgt.setPrefixElement(convertString(src.getPrefixElement())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasType()) + tgt.setType(convertQuestionnaireItemType(src.getType())); + if (src.hasEnableWhen()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + } + if (src.hasEnableBehavior()) + tgt.setEnableBehavior(convertEnableWhenBehavior(src.getEnableBehavior())); + if (src.hasRequired()) + tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); + if (src.hasRepeats()) + tgt.setRepeatsElement(convertBoolean(src.getRepeatsElement())); + if (src.hasReadOnly()) + tgt.setReadOnlyElement(convertBoolean(src.getReadOnlyElement())); + if (src.hasMaxLength()) + tgt.setMaxLengthElement(convertInteger(src.getMaxLengthElement())); + if (src.hasAnswerValueSet()) + tgt.setAnswerValueSetElement(convertCanonical(src.getAnswerValueSetElement())); + if (src.hasAnswerOption()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) tgt.addAnswerOption(convertQuestionnaireItemAnswerOptionComponent(t)); + } + if (src.hasInitial()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent t : src.getInitial()) tgt.addInitial(convertQuestionnaireItemInitialComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireItemComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType convertQuestionnaireItemType(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case GROUP: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP; + case DISPLAY: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DISPLAY; + case QUESTION: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP; + case BOOLEAN: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.BOOLEAN; + case DECIMAL: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DECIMAL; + case INTEGER: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.INTEGER; + case DATE: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATE; + case DATETIME: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME; + case TIME: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TIME; + case STRING: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.STRING; + case TEXT: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TEXT; + case URL: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.URL; + case CHOICE: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CHOICE; + case OPENCHOICE: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.OPENCHOICE; + case ATTACHMENT: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.ATTACHMENT; + case REFERENCE: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.REFERENCE; + case QUANTITY: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.QUANTITY; + default: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.NULL; + } + } + + public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType convertQuestionnaireItemType(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case GROUP: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP; + case DISPLAY: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DISPLAY; + // case QUESTION: return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUESTION; + case BOOLEAN: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.BOOLEAN; + case DECIMAL: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DECIMAL; + case INTEGER: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.INTEGER; + case DATE: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATE; + case DATETIME: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME; + case TIME: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TIME; + case STRING: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.STRING; + case TEXT: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TEXT; + case URL: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.URL; + case CHOICE: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.CHOICE; + case OPENCHOICE: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.OPENCHOICE; + case ATTACHMENT: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.ATTACHMENT; + case REFERENCE: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.REFERENCE; + case QUANTITY: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUANTITY; + default: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.NULL; + } + } + + public static org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior convertEnableWhenBehavior(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ALL: + return org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ALL; + case ANY: + return org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ANY; + default: + return org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior convertEnableWhenBehavior(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ALL: + return org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ALL; + case ANY: + return org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ANY; + default: + return org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); + copyElement(src, tgt); + if (src.hasQuestion()) + tgt.setQuestionElement(convertString(src.getQuestionElement())); + if (src.hasOperator()) + tgt.setOperator(convertQuestionnaireItemOperator(src.getOperator())); + if (src.hasAnswer()) + tgt.setAnswer(convertType(src.getAnswer())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); + copyElement(src, tgt); + if (src.hasQuestion()) + tgt.setQuestionElement(convertString(src.getQuestionElement())); + if (src.hasOperator()) + tgt.setOperator(convertQuestionnaireItemOperator(src.getOperator())); + if (src.hasAnswer()) + tgt.setAnswer(convertType(src.getAnswer())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator convertQuestionnaireItemOperator(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EXISTS: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EXISTS; + case EQUAL: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EQUAL; + case NOT_EQUAL: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL; + case GREATER_THAN: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN; + case LESS_THAN: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN; + case GREATER_OR_EQUAL: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL; + case LESS_OR_EQUAL: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL; + default: + return org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NULL; + } + } + + public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator convertQuestionnaireItemOperator(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EXISTS: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EXISTS; + case EQUAL: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EQUAL; + case NOT_EQUAL: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL; + case GREATER_THAN: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN; + case LESS_THAN: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN; + case GREATER_OR_EQUAL: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL; + case LESS_OR_EQUAL: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL; + default: + return org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NULL; + } + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasInitialSelected()) + tgt.setInitialSelectedElement(convertBoolean(src.getInitialSelectedElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasInitialSelected()) + tgt.setInitialSelectedElement(convertBoolean(src.getInitialSelectedElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent convertQuestionnaireItemInitialComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent convertQuestionnaireItemInitialComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemInitialComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/QuestionnaireResponse.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/QuestionnaireResponse.java index 4ae1de0ed..f55477211 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/QuestionnaireResponse.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/QuestionnaireResponse.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,157 +50,176 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class QuestionnaireResponse extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.r4.model.QuestionnaireResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasQuestionnaire()) - tgt.setQuestionnaireElement(convertCanonical(src.getQuestionnaireElement())); - if (src.hasStatus()) - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasAuthored()) - tgt.setAuthoredElement(convertDateTime(src.getAuthoredElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireResponseItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.r5.model.QuestionnaireResponse src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasQuestionnaire()) - tgt.setQuestionnaireElement(convertCanonical(src.getQuestionnaireElement())); - if (src.hasStatus()) - tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasAuthored()) - tgt.setAuthoredElement(convertDateTime(src.getAuthoredElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - if (src.hasSource()) - tgt.setSource(convertReference(src.getSource())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireResponseItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus convertQuestionnaireResponseStatus(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INPROGRESS: return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS; - case COMPLETED: return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED; - case AMENDED: return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR; - case STOPPED: return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED; - default: return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus convertQuestionnaireResponseStatus(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INPROGRESS: return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS; - case COMPLETED: return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED; - case AMENDED: return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR; - case STOPPED: return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED; - default: return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); - copyElement(src, tgt); - if (src.hasLinkId()) - tgt.setLinkIdElement(convertString(src.getLinkIdElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) - tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireResponseItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); - copyElement(src, tgt); - if (src.hasLinkId()) - tgt.setLinkIdElement(convertString(src.getLinkIdElement())); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); - if (src.hasText()) - tgt.setTextElement(convertString(src.getTextElement())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) - tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireResponseItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent convertQuestionnaireResponseItemAnswerComponent(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireResponseItemComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent convertQuestionnaireResponseItemAnswerComponent(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) - tgt.addItem(convertQuestionnaireResponseItemComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.r4.model.QuestionnaireResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasQuestionnaire()) + tgt.setQuestionnaireElement(convertCanonical(src.getQuestionnaireElement())); + if (src.hasStatus()) + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasAuthored()) + tgt.setAuthoredElement(convertDateTime(src.getAuthoredElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.r5.model.QuestionnaireResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasQuestionnaire()) + tgt.setQuestionnaireElement(convertCanonical(src.getQuestionnaireElement())); + if (src.hasStatus()) + tgt.setStatus(convertQuestionnaireResponseStatus(src.getStatus())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasAuthored()) + tgt.setAuthoredElement(convertDateTime(src.getAuthoredElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(convertReference(src.getSource())); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus convertQuestionnaireResponseStatus(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INPROGRESS: + return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS; + case COMPLETED: + return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED; + case AMENDED: + return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR; + case STOPPED: + return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED; + default: + return org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus convertQuestionnaireResponseStatus(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INPROGRESS: + return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS; + case COMPLETED: + return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED; + case AMENDED: + return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR; + case STOPPED: + return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED; + default: + return org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); + copyElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasAnswer()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); + copyElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertUri(src.getDefinitionElement())); + if (src.hasText()) + tgt.setTextElement(convertString(src.getTextElement())); + if (src.hasAnswer()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + } + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent convertQuestionnaireResponseItemAnswerComponent(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasItem()) { + for (org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent convertQuestionnaireResponseItemAnswerComponent(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + if (src.hasItem()) { + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RelatedPerson.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RelatedPerson.java index d805354aa..85631fd1c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RelatedPerson.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RelatedPerson.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,99 +50,108 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class RelatedPerson extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.r4.model.RelatedPerson src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RelatedPerson tgt = new org.hl7.fhir.r5.model.RelatedPerson(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) - tgt.addRelationship(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r4.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) - tgt.addPhoto(convertAttachment(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent t : src.getCommunication()) - tgt.addCommunication(convertRelatedPersonCommunicationComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.r4.model.RelatedPerson src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RelatedPerson tgt = new org.hl7.fhir.r5.model.RelatedPerson(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasRelationship()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(convertCodeableConcept(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r4.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasAddress()) { + for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.r4.model.Attachment t : src.getPhoto()) tgt.addPhoto(convertAttachment(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasCommunication()) { + for (org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertRelatedPersonCommunicationComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.r5.model.RelatedPerson src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RelatedPerson tgt = new org.hl7.fhir.r4.model.RelatedPerson(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) - tgt.addRelationship(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.HumanName t : src.getName()) - tgt.addName(convertHumanName(t)); - for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) - tgt.addTelecom(convertContactPoint(t)); - if (src.hasGender()) - tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); - if (src.hasBirthDate()) - tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); - for (org.hl7.fhir.r5.model.Address t : src.getAddress()) - tgt.addAddress(convertAddress(t)); - for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) - tgt.addPhoto(convertAttachment(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent t : src.getCommunication()) - tgt.addCommunication(convertRelatedPersonCommunicationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent convertRelatedPersonCommunicationComponent(org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent tgt = new org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - if (src.hasPreferred()) - tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent convertRelatedPersonCommunicationComponent(org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent tgt = new org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguage(convertCodeableConcept(src.getLanguage())); - if (src.hasPreferred()) - tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.r5.model.RelatedPerson src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RelatedPerson tgt = new org.hl7.fhir.r4.model.RelatedPerson(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasRelationship()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) tgt.addRelationship(convertCodeableConcept(t)); + } + if (src.hasName()) { + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); + } + if (src.hasTelecom()) { + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(convertContactPoint(t)); + } + if (src.hasGender()) + tgt.setGender(Enumerations.convertAdministrativeGender(src.getGender())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(convertDate(src.getBirthDateElement())); + if (src.hasAddress()) { + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); + } + if (src.hasPhoto()) { + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(convertAttachment(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasCommunication()) { + for (org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent t : src.getCommunication()) tgt.addCommunication(convertRelatedPersonCommunicationComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent convertRelatedPersonCommunicationComponent(org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent tgt = new org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent convertRelatedPersonCommunicationComponent(org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent tgt = new org.hl7.fhir.r4.model.RelatedPerson.RelatedPersonCommunicationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(convertBoolean(src.getPreferredElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RequestGroup.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RequestGroup.java index ca711698e..76c693abc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RequestGroup.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RequestGroup.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,501 +51,638 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class RequestGroup extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.RequestGroup convertRequestGroup(org.hl7.fhir.r4.model.RequestGroup src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RequestGroup tgt = new org.hl7.fhir.r5.model.RequestGroup(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertRequestStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertRequestIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) - tgt.addAction(convertRequestGroupActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.RequestGroup convertRequestGroup(org.hl7.fhir.r5.model.RequestGroup src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RequestGroup tgt = new org.hl7.fhir.r4.model.RequestGroup(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertRequestStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertRequestIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasAuthor()) - tgt.setAuthor(convertReference(src.getAuthor())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) - tgt.addAction(convertRequestGroupActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertRequestStatus(org.hl7.fhir.r4.model.RequestGroup.RequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.RequestStatus convertRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.RequestGroup.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; - default: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.OPTION; - default: return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.RequestGroup.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.STAT; - default: return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent convertRequestGroupActionComponent(org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent tgt = new org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent(); - copyElement(src, tgt); - if (src.hasPrefix()) - tgt.setPrefixElement(convertString(src.getPrefixElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTextEquivalent()) - tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) - tgt.addDocumentation(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent t : src.getCondition()) - tgt.addCondition(convertRequestGroupActionConditionComponent(t)); - for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent t : src.getRelatedAction()) - tgt.addRelatedAction(convertRequestGroupActionRelatedActionComponent(t)); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - for (org.hl7.fhir.r4.model.Reference t : src.getParticipant()) - tgt.addParticipant(convertReference(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasGroupingBehavior()) - tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); - if (src.hasSelectionBehavior()) - tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); - if (src.hasRequiredBehavior()) - tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); - if (src.hasPrecheckBehavior()) - tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); - if (src.hasCardinalityBehavior()) - tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); - if (src.hasResource()) - tgt.setResource(convertReference(src.getResource())); - for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) - tgt.addAction(convertRequestGroupActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent convertRequestGroupActionComponent(org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent tgt = new org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent(); - copyElement(src, tgt); - if (src.hasPrefix()) - tgt.setPrefixElement(convertString(src.getPrefixElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasTextEquivalent()) - tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) - tgt.addCode(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) - tgt.addDocumentation(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent t : src.getCondition()) - tgt.addCondition(convertRequestGroupActionConditionComponent(t)); - for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent t : src.getRelatedAction()) - tgt.addRelatedAction(convertRequestGroupActionRelatedActionComponent(t)); - if (src.hasTiming()) - tgt.setTiming(convertType(src.getTiming())); - for (org.hl7.fhir.r5.model.Reference t : src.getParticipant()) - tgt.addParticipant(convertReference(t)); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasGroupingBehavior()) - tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); - if (src.hasSelectionBehavior()) - tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); - if (src.hasRequiredBehavior()) - tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); - if (src.hasPrecheckBehavior()) - tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); - if (src.hasCardinalityBehavior()) - tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); - if (src.hasResource()) - tgt.setResource(convertReference(src.getResource())); - for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) - tgt.addAction(convertRequestGroupActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case VISUALGROUP: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP; - case LOGICALGROUP: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP; - case SENTENCEGROUP: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP; - default: return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case VISUALGROUP: return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.VISUALGROUP; - case LOGICALGROUP: return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.LOGICALGROUP; - case SENTENCEGROUP: return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.SENTENCEGROUP; - default: return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ANY: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY; - case ALL: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL; - case ALLORNONE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE; - case EXACTLYONE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE; - case ATMOSTONE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE; - case ONEORMORE: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE; - default: return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ANY: return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ANY; - case ALL: return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ALL; - case ALLORNONE: return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ALLORNONE; - case EXACTLYONE: return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.EXACTLYONE; - case ATMOSTONE: return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ATMOSTONE; - case ONEORMORE: return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ONEORMORE; - default: return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MUST: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST; - case COULD: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD; - case MUSTUNLESSDOCUMENTED: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; - default: return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MUST: return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.MUST; - case COULD: return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.COULD; - case MUSTUNLESSDOCUMENTED: return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; - default: return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case YES: return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES; - case NO: return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO; - default: return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case YES: return org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior.YES; - case NO: return org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior.NO; - default: return org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SINGLE: return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE; - case MULTIPLE: return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE; - default: return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SINGLE: return org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior.SINGLE; - case MULTIPLE: return org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior.MULTIPLE; - default: return org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior.NULL; - } -} - - public static org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent convertRequestGroupActionConditionComponent(org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent tgt = new org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent(); - copyElement(src, tgt); - if (src.hasKind()) - tgt.setKind(convertActionConditionKind(src.getKind())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } - - public static org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent convertRequestGroupActionConditionComponent(org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent tgt = new org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent(); - copyElement(src, tgt); - if (src.hasKind()) - tgt.setKind(convertActionConditionKind(src.getKind())); - if (src.hasExpression()) - tgt.setExpression(convertExpression(src.getExpression())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPLICABILITY: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY; - case START: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START; - case STOP: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP; - default: return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case APPLICABILITY: return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.APPLICABILITY; - case START: return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.START; - case STOP: return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.STOP; - default: return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent convertRequestGroupActionRelatedActionComponent(org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent tgt = new org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent(); - copyElement(src, tgt); - if (src.hasActionId()) - tgt.setActionIdElement(convertId(src.getActionIdElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); - if (src.hasOffset()) - tgt.setOffset(convertType(src.getOffset())); - return tgt; - } - - public static org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent convertRequestGroupActionRelatedActionComponent(org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent tgt = new org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent(); - copyElement(src, tgt); - if (src.hasActionId()) - tgt.setActionIdElement(convertId(src.getActionIdElement())); - if (src.hasRelationship()) - tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); - if (src.hasOffset()) - tgt.setOffset(convertType(src.getOffset())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BEFORESTART: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART; - case BEFORE: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE; - case BEFOREEND: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND; - case CONCURRENTWITHSTART: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART; - case CONCURRENT: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT; - case CONCURRENTWITHEND: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND; - case AFTERSTART: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART; - case AFTER: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER; - case AFTEREND: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND; - default: return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL; - } -} - - public static org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BEFORESTART: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.BEFORESTART; - case BEFORE: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.BEFORE; - case BEFOREEND: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.BEFOREEND; - case CONCURRENTWITHSTART: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.CONCURRENTWITHSTART; - case CONCURRENT: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.CONCURRENT; - case CONCURRENTWITHEND: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.CONCURRENTWITHEND; - case AFTERSTART: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.AFTERSTART; - case AFTER: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.AFTER; - case AFTEREND: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.AFTEREND; - default: return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.NULL; - } -} + public static org.hl7.fhir.r5.model.RequestGroup convertRequestGroup(org.hl7.fhir.r4.model.RequestGroup src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RequestGroup tgt = new org.hl7.fhir.r5.model.RequestGroup(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertRequestStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertRequestIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) tgt.addAction(convertRequestGroupActionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.RequestGroup convertRequestGroup(org.hl7.fhir.r5.model.RequestGroup src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RequestGroup tgt = new org.hl7.fhir.r4.model.RequestGroup(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertRequestStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertRequestIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasAuthor()) + tgt.setAuthor(convertReference(src.getAuthor())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) tgt.addAction(convertRequestGroupActionComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertRequestStatus(org.hl7.fhir.r4.model.RequestGroup.RequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.RequestStatus convertRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.RequestGroup.RequestStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.RequestGroup.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.OPTION; + default: + return org.hl7.fhir.r4.model.RequestGroup.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.RequestGroup.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.STAT; + default: + return org.hl7.fhir.r4.model.RequestGroup.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent convertRequestGroupActionComponent(org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent tgt = new org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent(); + copyElement(src, tgt); + if (src.hasPrefix()) + tgt.setPrefixElement(convertString(src.getPrefixElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTextEquivalent()) + tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent t : src.getCondition()) tgt.addCondition(convertRequestGroupActionConditionComponent(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertRequestGroupActionRelatedActionComponent(t)); + } + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.Reference t : src.getParticipant()) tgt.addParticipant(convertReference(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasGroupingBehavior()) + tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); + if (src.hasSelectionBehavior()) + tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); + if (src.hasRequiredBehavior()) + tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); + if (src.hasPrecheckBehavior()) + tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); + if (src.hasCardinalityBehavior()) + tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); + if (src.hasResource()) + tgt.setResource(convertReference(src.getResource())); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) tgt.addAction(convertRequestGroupActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent convertRequestGroupActionComponent(org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent tgt = new org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent(); + copyElement(src, tgt); + if (src.hasPrefix()) + tgt.setPrefixElement(convertString(src.getPrefixElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasTextEquivalent()) + tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasCode()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t)); + } + if (src.hasDocumentation()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent t : src.getCondition()) tgt.addCondition(convertRequestGroupActionConditionComponent(t)); + } + if (src.hasRelatedAction()) { + for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertRequestGroupActionRelatedActionComponent(t)); + } + if (src.hasTiming()) + tgt.setTiming(convertType(src.getTiming())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.Reference t : src.getParticipant()) tgt.addParticipant(convertReference(t)); + } + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasGroupingBehavior()) + tgt.setGroupingBehavior(convertActionGroupingBehavior(src.getGroupingBehavior())); + if (src.hasSelectionBehavior()) + tgt.setSelectionBehavior(convertActionSelectionBehavior(src.getSelectionBehavior())); + if (src.hasRequiredBehavior()) + tgt.setRequiredBehavior(convertActionRequiredBehavior(src.getRequiredBehavior())); + if (src.hasPrecheckBehavior()) + tgt.setPrecheckBehavior(convertActionPrecheckBehavior(src.getPrecheckBehavior())); + if (src.hasCardinalityBehavior()) + tgt.setCardinalityBehavior(convertActionCardinalityBehavior(src.getCardinalityBehavior())); + if (src.hasResource()) + tgt.setResource(convertReference(src.getResource())); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionComponent t : src.getAction()) tgt.addAction(convertRequestGroupActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case VISUALGROUP: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP; + case LOGICALGROUP: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP; + case SENTENCEGROUP: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case VISUALGROUP: + return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.VISUALGROUP; + case LOGICALGROUP: + return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.LOGICALGROUP; + case SENTENCEGROUP: + return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.SENTENCEGROUP; + default: + return org.hl7.fhir.r4.model.RequestGroup.ActionGroupingBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ANY: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY; + case ALL: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL; + case ALLORNONE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE; + case EXACTLYONE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE; + case ATMOSTONE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE; + case ONEORMORE: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ANY: + return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ANY; + case ALL: + return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ALL; + case ALLORNONE: + return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ALLORNONE; + case EXACTLYONE: + return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.EXACTLYONE; + case ATMOSTONE: + return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ATMOSTONE; + case ONEORMORE: + return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.ONEORMORE; + default: + return org.hl7.fhir.r4.model.RequestGroup.ActionSelectionBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MUST: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST; + case COULD: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD; + case MUSTUNLESSDOCUMENTED: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MUST: + return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.MUST; + case COULD: + return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.COULD; + case MUSTUNLESSDOCUMENTED: + return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED; + default: + return org.hl7.fhir.r4.model.RequestGroup.ActionRequiredBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case YES: + return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES; + case NO: + return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case YES: + return org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior.YES; + case NO: + return org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior.NO; + default: + return org.hl7.fhir.r4.model.RequestGroup.ActionPrecheckBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SINGLE: + return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE; + case MULTIPLE: + return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SINGLE: + return org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior.SINGLE; + case MULTIPLE: + return org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior.MULTIPLE; + default: + return org.hl7.fhir.r4.model.RequestGroup.ActionCardinalityBehavior.NULL; + } + } + + public static org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent convertRequestGroupActionConditionComponent(org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent tgt = new org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent(); + copyElement(src, tgt); + if (src.hasKind()) + tgt.setKind(convertActionConditionKind(src.getKind())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent convertRequestGroupActionConditionComponent(org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent tgt = new org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionConditionComponent(); + copyElement(src, tgt); + if (src.hasKind()) + tgt.setKind(convertActionConditionKind(src.getKind())); + if (src.hasExpression()) + tgt.setExpression(convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPLICABILITY: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY; + case START: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START; + case STOP: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind convertActionConditionKind(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case APPLICABILITY: + return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.APPLICABILITY; + case START: + return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.START; + case STOP: + return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.STOP; + default: + return org.hl7.fhir.r4.model.RequestGroup.ActionConditionKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent convertRequestGroupActionRelatedActionComponent(org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent tgt = new org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent(); + copyElement(src, tgt); + if (src.hasActionId()) + tgt.setActionIdElement(convertId(src.getActionIdElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); + if (src.hasOffset()) + tgt.setOffset(convertType(src.getOffset())); + return tgt; + } + + public static org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent convertRequestGroupActionRelatedActionComponent(org.hl7.fhir.r5.model.RequestGroup.RequestGroupActionRelatedActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent tgt = new org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionRelatedActionComponent(); + copyElement(src, tgt); + if (src.hasActionId()) + tgt.setActionIdElement(convertId(src.getActionIdElement())); + if (src.hasRelationship()) + tgt.setRelationship(convertActionRelationshipType(src.getRelationship())); + if (src.hasOffset()) + tgt.setOffset(convertType(src.getOffset())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BEFORESTART: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART; + case BEFORE: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE; + case BEFOREEND: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND; + case CONCURRENTWITHSTART: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART; + case CONCURRENT: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT; + case CONCURRENTWITHEND: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND; + case AFTERSTART: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART; + case AFTER: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER; + case AFTEREND: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND; + default: + return org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL; + } + } + + public static org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType convertActionRelationshipType(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BEFORESTART: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.BEFORESTART; + case BEFORE: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.BEFORE; + case BEFOREEND: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.BEFOREEND; + case CONCURRENTWITHSTART: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.CONCURRENTWITHSTART; + case CONCURRENT: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.CONCURRENT; + case CONCURRENTWITHEND: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.CONCURRENTWITHEND; + case AFTERSTART: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.AFTERSTART; + case AFTER: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.AFTER; + case AFTEREND: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.AFTEREND; + default: + return org.hl7.fhir.r4.model.RequestGroup.ActionRelationshipType.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchStudy.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchStudy.java index 181873937..5378ba25e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchStudy.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchStudy.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,213 +50,262 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ResearchStudy extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ResearchStudy convertResearchStudy(org.hl7.fhir.r4.model.ResearchStudy src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ResearchStudy tgt = new org.hl7.fhir.r5.model.ResearchStudy(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getProtocol()) - tgt.addProtocol(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertResearchStudyStatus(src.getStatus())); - if (src.hasPrimaryPurposeType()) - tgt.setPrimaryPurposeType(convertCodeableConcept(src.getPrimaryPurposeType())); - if (src.hasPhase()) - tgt.setPhase(convertCodeableConcept(src.getPhase())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFocus()) - tgt.addFocus(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCondition()) - tgt.addCondition(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getKeyword()) - tgt.addKeyword(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocation()) - tgt.addLocation(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getEnrollment()) - tgt.addEnrollment(convertReference(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasSponsor()) - tgt.setSponsor(convertReference(src.getSponsor())); - if (src.hasPrincipalInvestigator()) - tgt.setPrincipalInvestigator(convertReference(src.getPrincipalInvestigator())); - for (org.hl7.fhir.r4.model.Reference t : src.getSite()) - tgt.addSite(convertReference(t)); - if (src.hasReasonStopped()) - tgt.setReasonStopped(convertCodeableConcept(src.getReasonStopped())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent t : src.getArm()) - tgt.addArm(convertResearchStudyArmComponent(t)); - for (org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent t : src.getObjective()) - tgt.addObjective(convertResearchStudyObjectiveComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ResearchStudy convertResearchStudy(org.hl7.fhir.r5.model.ResearchStudy src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ResearchStudy tgt = new org.hl7.fhir.r4.model.ResearchStudy(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getProtocol()) - tgt.addProtocol(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertResearchStudyStatus(src.getStatus())); - if (src.hasPrimaryPurposeType()) - tgt.setPrimaryPurposeType(convertCodeableConcept(src.getPrimaryPurposeType())); - if (src.hasPhase()) - tgt.setPhase(convertCodeableConcept(src.getPhase())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFocus()) - tgt.addFocus(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCondition()) - tgt.addCondition(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) - tgt.addRelatedArtifact(convertRelatedArtifact(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getKeyword()) - tgt.addKeyword(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocation()) - tgt.addLocation(convertCodeableConcept(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getEnrollment()) - tgt.addEnrollment(convertReference(t)); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasSponsor()) - tgt.setSponsor(convertReference(src.getSponsor())); - if (src.hasPrincipalInvestigator()) - tgt.setPrincipalInvestigator(convertReference(src.getPrincipalInvestigator())); - for (org.hl7.fhir.r5.model.Reference t : src.getSite()) - tgt.addSite(convertReference(t)); - if (src.hasReasonStopped()) - tgt.setReasonStopped(convertCodeableConcept(src.getReasonStopped())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent t : src.getArm()) - tgt.addArm(convertResearchStudyArmComponent(t)); - for (org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent t : src.getObjective()) - tgt.addObjective(convertResearchStudyObjectiveComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus convertResearchStudyStatus(org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.ACTIVE; - case ADMINISTRATIVELYCOMPLETED: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.ADMINISTRATIVELYCOMPLETED; - case APPROVED: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.APPROVED; - case CLOSEDTOACCRUAL: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUAL; - case CLOSEDTOACCRUALANDINTERVENTION: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUALANDINTERVENTION; - case COMPLETED: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.COMPLETED; - case DISAPPROVED: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.DISAPPROVED; - case INREVIEW: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.INREVIEW; - case TEMPORARILYCLOSEDTOACCRUAL: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUAL; - case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION; - case WITHDRAWN: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.WITHDRAWN; - default: return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus convertResearchStudyStatus(org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.ACTIVE; - case ADMINISTRATIVELYCOMPLETED: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.ADMINISTRATIVELYCOMPLETED; - case APPROVED: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.APPROVED; - case CLOSEDTOACCRUAL: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUAL; - case CLOSEDTOACCRUALANDINTERVENTION: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUALANDINTERVENTION; - case COMPLETED: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.COMPLETED; - case DISAPPROVED: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.DISAPPROVED; - case INREVIEW: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.INREVIEW; - case TEMPORARILYCLOSEDTOACCRUAL: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUAL; - case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION; - case WITHDRAWN: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.WITHDRAWN; - default: return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent convertResearchStudyArmComponent(org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent tgt = new org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent convertResearchStudyArmComponent(org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent tgt = new org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent convertResearchStudyObjectiveComponent(org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent tgt = new org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent convertResearchStudyObjectiveComponent(org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent tgt = new org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - return tgt; - } + public static org.hl7.fhir.r5.model.ResearchStudy convertResearchStudy(org.hl7.fhir.r4.model.ResearchStudy src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ResearchStudy tgt = new org.hl7.fhir.r5.model.ResearchStudy(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasProtocol()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProtocol()) tgt.addProtocol(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertResearchStudyStatus(src.getStatus())); + if (src.hasPrimaryPurposeType()) + tgt.setPrimaryPurposeType(convertCodeableConcept(src.getPrimaryPurposeType())); + if (src.hasPhase()) + tgt.setPhase(convertCodeableConcept(src.getPhase())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasFocus()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getFocus()) tgt.addFocus(convertCodeableConcept(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCondition()) tgt.addCondition(convertCodeableConcept(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasKeyword()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getKeyword()) tgt.addKeyword(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocation()) tgt.addLocation(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasEnrollment()) { + for (org.hl7.fhir.r4.model.Reference t : src.getEnrollment()) tgt.addEnrollment(convertReference(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasSponsor()) + tgt.setSponsor(convertReference(src.getSponsor())); + if (src.hasPrincipalInvestigator()) + tgt.setPrincipalInvestigator(convertReference(src.getPrincipalInvestigator())); + if (src.hasSite()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSite()) tgt.addSite(convertReference(t)); + } + if (src.hasReasonStopped()) + tgt.setReasonStopped(convertCodeableConcept(src.getReasonStopped())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasArm()) { + for (org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent t : src.getArm()) tgt.addArm(convertResearchStudyArmComponent(t)); + } + if (src.hasObjective()) { + for (org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent t : src.getObjective()) tgt.addObjective(convertResearchStudyObjectiveComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ResearchStudy convertResearchStudy(org.hl7.fhir.r5.model.ResearchStudy src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ResearchStudy tgt = new org.hl7.fhir.r4.model.ResearchStudy(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasProtocol()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProtocol()) tgt.addProtocol(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertResearchStudyStatus(src.getStatus())); + if (src.hasPrimaryPurposeType()) + tgt.setPrimaryPurposeType(convertCodeableConcept(src.getPrimaryPurposeType())); + if (src.hasPhase()) + tgt.setPhase(convertCodeableConcept(src.getPhase())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasFocus()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFocus()) tgt.addFocus(convertCodeableConcept(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCondition()) tgt.addCondition(convertCodeableConcept(t)); + } + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasRelatedArtifact()) { + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t)); + } + if (src.hasKeyword()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getKeyword()) tgt.addKeyword(convertCodeableConcept(t)); + } + if (src.hasLocation()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocation()) tgt.addLocation(convertCodeableConcept(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasEnrollment()) { + for (org.hl7.fhir.r5.model.Reference t : src.getEnrollment()) tgt.addEnrollment(convertReference(t)); + } + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasSponsor()) + tgt.setSponsor(convertReference(src.getSponsor())); + if (src.hasPrincipalInvestigator()) + tgt.setPrincipalInvestigator(convertReference(src.getPrincipalInvestigator())); + if (src.hasSite()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSite()) tgt.addSite(convertReference(t)); + } + if (src.hasReasonStopped()) + tgt.setReasonStopped(convertCodeableConcept(src.getReasonStopped())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasArm()) { + for (org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent t : src.getArm()) tgt.addArm(convertResearchStudyArmComponent(t)); + } + if (src.hasObjective()) { + for (org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent t : src.getObjective()) tgt.addObjective(convertResearchStudyObjectiveComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus convertResearchStudyStatus(org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.ACTIVE; + case ADMINISTRATIVELYCOMPLETED: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.ADMINISTRATIVELYCOMPLETED; + case APPROVED: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.APPROVED; + case CLOSEDTOACCRUAL: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUAL; + case CLOSEDTOACCRUALANDINTERVENTION: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUALANDINTERVENTION; + case COMPLETED: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.COMPLETED; + case DISAPPROVED: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.DISAPPROVED; + case INREVIEW: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.INREVIEW; + case TEMPORARILYCLOSEDTOACCRUAL: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUAL; + case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION; + case WITHDRAWN: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.WITHDRAWN; + default: + return org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus convertResearchStudyStatus(org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.ACTIVE; + case ADMINISTRATIVELYCOMPLETED: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.ADMINISTRATIVELYCOMPLETED; + case APPROVED: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.APPROVED; + case CLOSEDTOACCRUAL: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUAL; + case CLOSEDTOACCRUALANDINTERVENTION: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.CLOSEDTOACCRUALANDINTERVENTION; + case COMPLETED: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.COMPLETED; + case DISAPPROVED: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.DISAPPROVED; + case INREVIEW: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.INREVIEW; + case TEMPORARILYCLOSEDTOACCRUAL: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUAL; + case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION; + case WITHDRAWN: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.WITHDRAWN; + default: + return org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent convertResearchStudyArmComponent(org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent tgt = new org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent convertResearchStudyArmComponent(org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyArmComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent tgt = new org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyArmComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent convertResearchStudyObjectiveComponent(org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent tgt = new org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent convertResearchStudyObjectiveComponent(org.hl7.fhir.r5.model.ResearchStudy.ResearchStudyObjectiveComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent tgt = new org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyObjectiveComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchSubject.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchSubject.java index e50aa224d..8d0c932ce 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchSubject.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ResearchSubject.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,101 +50,126 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ResearchSubject extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ResearchSubject convertResearchSubject(org.hl7.fhir.r4.model.ResearchSubject src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ResearchSubject tgt = new org.hl7.fhir.r5.model.ResearchSubject(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertResearchSubjectStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasStudy()) - tgt.setStudy(convertReference(src.getStudy())); - if (src.hasIndividual()) - tgt.setIndividual(convertReference(src.getIndividual())); - if (src.hasAssignedArm()) - tgt.setAssignedArmElement(convertString(src.getAssignedArmElement())); - if (src.hasActualArm()) - tgt.setActualArmElement(convertString(src.getActualArmElement())); - if (src.hasConsent()) - tgt.setConsent(convertReference(src.getConsent())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ResearchSubject convertResearchSubject(org.hl7.fhir.r5.model.ResearchSubject src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ResearchSubject tgt = new org.hl7.fhir.r4.model.ResearchSubject(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertResearchSubjectStatus(src.getStatus())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - if (src.hasStudy()) - tgt.setStudy(convertReference(src.getStudy())); - if (src.hasIndividual()) - tgt.setIndividual(convertReference(src.getIndividual())); - if (src.hasAssignedArm()) - tgt.setAssignedArmElement(convertString(src.getAssignedArmElement())); - if (src.hasActualArm()) - tgt.setActualArmElement(convertString(src.getActualArmElement())); - if (src.hasConsent()) - tgt.setConsent(convertReference(src.getConsent())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus convertResearchSubjectStatus(org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CANDIDATE: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.CANDIDATE; - case ELIGIBLE: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ELIGIBLE; - case FOLLOWUP: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.FOLLOWUP; - case INELIGIBLE: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.INELIGIBLE; - case NOTREGISTERED: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.NOTREGISTERED; - case OFFSTUDY: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.OFFSTUDY; - case ONSTUDY: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ONSTUDY; - case ONSTUDYINTERVENTION: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYINTERVENTION; - case ONSTUDYOBSERVATION: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYOBSERVATION; - case PENDINGONSTUDY: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.PENDINGONSTUDY; - case POTENTIALCANDIDATE: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.POTENTIALCANDIDATE; - case SCREENING: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.SCREENING; - case WITHDRAWN: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.WITHDRAWN; - default: return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus convertResearchSubjectStatus(org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CANDIDATE: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.CANDIDATE; - case ELIGIBLE: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ELIGIBLE; - case FOLLOWUP: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.FOLLOWUP; - case INELIGIBLE: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.INELIGIBLE; - case NOTREGISTERED: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.NOTREGISTERED; - case OFFSTUDY: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.OFFSTUDY; - case ONSTUDY: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ONSTUDY; - case ONSTUDYINTERVENTION: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYINTERVENTION; - case ONSTUDYOBSERVATION: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYOBSERVATION; - case PENDINGONSTUDY: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.PENDINGONSTUDY; - case POTENTIALCANDIDATE: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.POTENTIALCANDIDATE; - case SCREENING: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.SCREENING; - case WITHDRAWN: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.WITHDRAWN; - default: return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.ResearchSubject convertResearchSubject(org.hl7.fhir.r4.model.ResearchSubject src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ResearchSubject tgt = new org.hl7.fhir.r5.model.ResearchSubject(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertResearchSubjectStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasStudy()) + tgt.setStudy(convertReference(src.getStudy())); + if (src.hasIndividual()) + tgt.setIndividual(convertReference(src.getIndividual())); + if (src.hasAssignedArm()) + tgt.setAssignedArmElement(convertString(src.getAssignedArmElement())); + if (src.hasActualArm()) + tgt.setActualArmElement(convertString(src.getActualArmElement())); + if (src.hasConsent()) + tgt.setConsent(convertReference(src.getConsent())); + return tgt; + } + public static org.hl7.fhir.r4.model.ResearchSubject convertResearchSubject(org.hl7.fhir.r5.model.ResearchSubject src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ResearchSubject tgt = new org.hl7.fhir.r4.model.ResearchSubject(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertResearchSubjectStatus(src.getStatus())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasStudy()) + tgt.setStudy(convertReference(src.getStudy())); + if (src.hasIndividual()) + tgt.setIndividual(convertReference(src.getIndividual())); + if (src.hasAssignedArm()) + tgt.setAssignedArmElement(convertString(src.getAssignedArmElement())); + if (src.hasActualArm()) + tgt.setActualArmElement(convertString(src.getActualArmElement())); + if (src.hasConsent()) + tgt.setConsent(convertReference(src.getConsent())); + return tgt; + } + public static org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus convertResearchSubjectStatus(org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CANDIDATE: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.CANDIDATE; + case ELIGIBLE: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ELIGIBLE; + case FOLLOWUP: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.FOLLOWUP; + case INELIGIBLE: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.INELIGIBLE; + case NOTREGISTERED: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.NOTREGISTERED; + case OFFSTUDY: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.OFFSTUDY; + case ONSTUDY: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ONSTUDY; + case ONSTUDYINTERVENTION: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYINTERVENTION; + case ONSTUDYOBSERVATION: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYOBSERVATION; + case PENDINGONSTUDY: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.PENDINGONSTUDY; + case POTENTIALCANDIDATE: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.POTENTIALCANDIDATE; + case SCREENING: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.SCREENING; + case WITHDRAWN: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.WITHDRAWN; + default: + return org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus convertResearchSubjectStatus(org.hl7.fhir.r5.model.ResearchSubject.ResearchSubjectStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CANDIDATE: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.CANDIDATE; + case ELIGIBLE: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ELIGIBLE; + case FOLLOWUP: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.FOLLOWUP; + case INELIGIBLE: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.INELIGIBLE; + case NOTREGISTERED: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.NOTREGISTERED; + case OFFSTUDY: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.OFFSTUDY; + case ONSTUDY: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ONSTUDY; + case ONSTUDYINTERVENTION: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYINTERVENTION; + case ONSTUDYOBSERVATION: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.ONSTUDYOBSERVATION; + case PENDINGONSTUDY: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.PENDINGONSTUDY; + case POTENTIALCANDIDATE: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.POTENTIALCANDIDATE; + case SCREENING: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.SCREENING; + case WITHDRAWN: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.WITHDRAWN; + default: + return org.hl7.fhir.r4.model.ResearchSubject.ResearchSubjectStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RiskAssessment.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RiskAssessment.java index 42af75379..82f6ae748 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RiskAssessment.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/RiskAssessment.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,169 +51,190 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class RiskAssessment extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.RiskAssessment convertRiskAssessment(org.hl7.fhir.r4.model.RiskAssessment src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RiskAssessment tgt = new org.hl7.fhir.r5.model.RiskAssessment(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasBasedOn()) - tgt.setBasedOn(convertReference(src.getBasedOn())); - if (src.hasParent()) - tgt.setParent(convertReference(src.getParent())); - if (src.hasStatus()) - tgt.setStatus(convertRiskAssessmentStatus(src.getStatus())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasCondition()) - tgt.setCondition(convertReference(src.getCondition())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasis()) - tgt.addBasis(convertReference(t)); - for (org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) - tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - if (src.hasMitigation()) - tgt.setMitigationElement(convertString(src.getMitigationElement())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.RiskAssessment convertRiskAssessment(org.hl7.fhir.r5.model.RiskAssessment src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RiskAssessment tgt = new org.hl7.fhir.r4.model.RiskAssessment(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasBasedOn()) - tgt.setBasedOn(convertReference(src.getBasedOn())); - if (src.hasParent()) - tgt.setParent(convertReference(src.getParent())); - if (src.hasStatus()) - tgt.setStatus(convertRiskAssessmentStatus(src.getStatus())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasCondition()) - tgt.setCondition(convertReference(src.getCondition())); - if (src.hasPerformer()) - tgt.setPerformer(convertReference(src.getPerformer())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasis()) - tgt.addBasis(convertReference(t)); - for (org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) - tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); - if (src.hasMitigation()) - tgt.setMitigationElement(convertString(src.getMitigationElement())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.ObservationStatus convertRiskAssessmentStatus(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED; - case PRELIMINARY: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL; - case AMENDED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus convertRiskAssessmentStatus(org.hl7.fhir.r5.model.Enumerations.ObservationStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case REGISTERED: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.REGISTERED; - case PRELIMINARY: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.PRELIMINARY; - case FINAL: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.FINAL; - case AMENDED: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.AMENDED; - case CORRECTED: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CORRECTED; - case CANCELLED: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CANCELLED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent(); - copyElement(src, tgt); - if (src.hasOutcome()) - tgt.setOutcome(convertCodeableConcept(src.getOutcome())); - if (src.hasProbability()) - tgt.setProbability(convertType(src.getProbability())); - if (src.hasQualitativeRisk()) - tgt.setQualitativeRisk(convertCodeableConcept(src.getQualitativeRisk())); - if (src.hasRelativeRisk()) - tgt.setRelativeRiskElement(convertDecimal(src.getRelativeRiskElement())); - if (src.hasWhen()) - tgt.setWhen(convertType(src.getWhen())); - if (src.hasRationale()) - tgt.setRationaleElement(convertString(src.getRationaleElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent(); - copyElement(src, tgt); - if (src.hasOutcome()) - tgt.setOutcome(convertCodeableConcept(src.getOutcome())); - if (src.hasProbability()) - tgt.setProbability(convertType(src.getProbability())); - if (src.hasQualitativeRisk()) - tgt.setQualitativeRisk(convertCodeableConcept(src.getQualitativeRisk())); - if (src.hasRelativeRisk()) - tgt.setRelativeRiskElement(convertDecimal(src.getRelativeRiskElement())); - if (src.hasWhen()) - tgt.setWhen(convertType(src.getWhen())); - if (src.hasRationale()) - tgt.setRationaleElement(convertString(src.getRationaleElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.RiskAssessment convertRiskAssessment(org.hl7.fhir.r4.model.RiskAssessment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RiskAssessment tgt = new org.hl7.fhir.r5.model.RiskAssessment(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) + tgt.setBasedOn(convertReference(src.getBasedOn())); + if (src.hasParent()) + tgt.setParent(convertReference(src.getParent())); + if (src.hasStatus()) + tgt.setStatus(convertRiskAssessmentStatus(src.getStatus())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasCondition()) + tgt.setCondition(convertReference(src.getCondition())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasBasis()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasis()) tgt.addBasis(convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) + tgt.setMitigationElement(convertString(src.getMitigationElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.RiskAssessment convertRiskAssessment(org.hl7.fhir.r5.model.RiskAssessment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RiskAssessment tgt = new org.hl7.fhir.r4.model.RiskAssessment(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) + tgt.setBasedOn(convertReference(src.getBasedOn())); + if (src.hasParent()) + tgt.setParent(convertReference(src.getParent())); + if (src.hasStatus()) + tgt.setStatus(convertRiskAssessmentStatus(src.getStatus())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasCondition()) + tgt.setCondition(convertReference(src.getCondition())); + if (src.hasPerformer()) + tgt.setPerformer(convertReference(src.getPerformer())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasBasis()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasis()) tgt.addBasis(convertReference(t)); + } + if (src.hasPrediction()) { + for (org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + } + if (src.hasMitigation()) + tgt.setMitigationElement(convertString(src.getMitigationElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.ObservationStatus convertRiskAssessmentStatus(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED; + case PRELIMINARY: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus convertRiskAssessmentStatus(org.hl7.fhir.r5.model.Enumerations.ObservationStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case REGISTERED: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.REGISTERED; + case PRELIMINARY: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.PRELIMINARY; + case FINAL: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.FINAL; + case AMENDED: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.AMENDED; + case CORRECTED: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CORRECTED; + case CANCELLED: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CANCELLED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent(); + copyElement(src, tgt); + if (src.hasOutcome()) + tgt.setOutcome(convertCodeableConcept(src.getOutcome())); + if (src.hasProbability()) + tgt.setProbability(convertType(src.getProbability())); + if (src.hasQualitativeRisk()) + tgt.setQualitativeRisk(convertCodeableConcept(src.getQualitativeRisk())); + if (src.hasRelativeRisk()) + tgt.setRelativeRiskElement(convertDecimal(src.getRelativeRiskElement())); + if (src.hasWhen()) + tgt.setWhen(convertType(src.getWhen())); + if (src.hasRationale()) + tgt.setRationaleElement(convertString(src.getRationaleElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent(); + copyElement(src, tgt); + if (src.hasOutcome()) + tgt.setOutcome(convertCodeableConcept(src.getOutcome())); + if (src.hasProbability()) + tgt.setProbability(convertType(src.getProbability())); + if (src.hasQualitativeRisk()) + tgt.setQualitativeRisk(convertCodeableConcept(src.getQualitativeRisk())); + if (src.hasRelativeRisk()) + tgt.setRelativeRiskElement(convertDecimal(src.getRelativeRiskElement())); + if (src.hasWhen()) + tgt.setWhen(convertType(src.getWhen())); + if (src.hasRationale()) + tgt.setRationaleElement(convertString(src.getRationaleElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Schedule.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Schedule.java index 51fd29cfd..bd9da8077 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Schedule.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Schedule.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,59 +50,64 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Schedule extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Schedule convertSchedule(org.hl7.fhir.r4.model.Schedule src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Schedule tgt = new org.hl7.fhir.r5.model.Schedule(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory()) - tgt.addServiceCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) - tgt.addServiceType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getActor()) - tgt.addActor(convertReference(t)); - if (src.hasPlanningHorizon()) - tgt.setPlanningHorizon(convertPeriod(src.getPlanningHorizon())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Schedule convertSchedule(org.hl7.fhir.r5.model.Schedule src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Schedule tgt = new org.hl7.fhir.r4.model.Schedule(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasActive()) - tgt.setActiveElement(convertBoolean(src.getActiveElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) - tgt.addServiceCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) - tgt.addServiceType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getActor()) - tgt.addActor(convertReference(t)); - if (src.hasPlanningHorizon()) - tgt.setPlanningHorizon(convertPeriod(src.getPlanningHorizon())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - + public static org.hl7.fhir.r5.model.Schedule convertSchedule(org.hl7.fhir.r4.model.Schedule src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Schedule tgt = new org.hl7.fhir.r5.model.Schedule(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasServiceCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory()) tgt.addServiceCategory(convertCodeableConcept(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.r4.model.Reference t : src.getActor()) tgt.addActor(convertReference(t)); + } + if (src.hasPlanningHorizon()) + tgt.setPlanningHorizon(convertPeriod(src.getPlanningHorizon())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.Schedule convertSchedule(org.hl7.fhir.r5.model.Schedule src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Schedule tgt = new org.hl7.fhir.r4.model.Schedule(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasActive()) + tgt.setActiveElement(convertBoolean(src.getActiveElement())); + if (src.hasServiceCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) tgt.addServiceCategory(convertCodeableConcept(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasActor()) { + for (org.hl7.fhir.r5.model.Reference t : src.getActor()) tgt.addActor(convertReference(t)); + } + if (src.hasPlanningHorizon()) + tgt.setPlanningHorizon(convertPeriod(src.getPlanningHorizon())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java index 89409402d..048abee91 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java @@ -19,8 +19,6 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; @@ -28,7 +26,6 @@ import org.hl7.fhir.r5.model.Enumerations.ResourceTypeEnum; import org.hl7.fhir.r5.model.SearchParameter.SearchModifierCodeEnumFactory; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -57,255 +54,326 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SearchParameter extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SearchParameter convertSearchParameter(org.hl7.fhir.r4.model.SearchParameter src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SearchParameter tgt = new org.hl7.fhir.r5.model.SearchParameter(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDerivedFrom()) - tgt.setDerivedFromElement(convertCanonical(src.getDerivedFromElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) - tgt.getBase().add(convertResourceEnum(t)); - if (src.hasType()) - tgt.setType(Enumerations.convertSearchParamType(src.getType())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasXpath()) - tgt.setXpathElement(convertString(src.getXpathElement())); - if (src.hasXpathUsage()) - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) - tgt.getTarget().add(convertResourceEnum(t)); - if (src.hasMultipleOr()) - tgt.setMultipleOrElement(convertBoolean(src.getMultipleOrElement())); - if (src.hasMultipleAnd()) - tgt.setMultipleAndElement(convertBoolean(src.getMultipleAndElement())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getComparator()) - copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); - for (org.hl7.fhir.r4.model.Enumeration t : src.getModifier()) - copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); - for (org.hl7.fhir.r4.model.StringType t : src.getChain()) - tgt.getChain().add(convertString(t)); - for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) - tgt.addComponent(convertSearchParameterComponentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.SearchParameter convertSearchParameter(org.hl7.fhir.r5.model.SearchParameter src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SearchParameter tgt = new org.hl7.fhir.r4.model.SearchParameter(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDerivedFrom()) - tgt.setDerivedFromElement(convertCanonical(src.getDerivedFromElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - for (CodeType t : src.getBase()) - tgt.getBase().add(convertResourceEnum(t)); - if (src.hasType()) - tgt.setType(Enumerations.convertSearchParamType(src.getType())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasXpath()) - tgt.setXpathElement(convertString(src.getXpathElement())); - if (src.hasXpathUsage()) - tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); - for (CodeType t : src.getTarget()) - tgt.getTarget().add(convertResourceEnum(t)); - if (src.hasMultipleOr()) - tgt.setMultipleOrElement(convertBoolean(src.getMultipleOrElement())); - if (src.hasMultipleAnd()) - tgt.setMultipleAndElement(convertBoolean(src.getMultipleAndElement())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getComparator()) - copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); - for (org.hl7.fhir.r5.model.Enumeration t : src.getModifier()) - copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); - for (org.hl7.fhir.r5.model.StringType t : src.getChain()) - tgt.getChain().add(convertString(t)); - for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) - tgt.addComponent(convertSearchParameterComponentComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.SearchParameter.XPathUsageType convertXPathUsageType(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NORMAL: return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NORMAL; - case PHONETIC: return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.PHONETIC; - case NEARBY: return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NEARBY; - case DISTANCE: return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.DISTANCE; - case OTHER: return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.OTHER; - default: return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NULL; - } -} - - public static org.hl7.fhir.r4.model.SearchParameter.XPathUsageType convertXPathUsageType(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NORMAL: return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL; - case PHONETIC: return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC; - case NEARBY: return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NEARBY; - case DISTANCE: return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.DISTANCE; - case OTHER: return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER; - default: return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL; - } -} - - public static org.hl7.fhir.r5.model.SearchParameter.SearchComparator convertSearchComparator(org.hl7.fhir.r4.model.SearchParameter.SearchComparator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQ: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EQ; - case NE: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.NE; - case GT: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GT; - case LT: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LT; - case GE: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GE; - case LE: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LE; - case SA: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.SA; - case EB: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EB; - case AP: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.AP; - default: return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.NULL; - } -} - - public static org.hl7.fhir.r4.model.SearchParameter.SearchComparator convertSearchComparator(org.hl7.fhir.r5.model.SearchParameter.SearchComparator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQ: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EQ; - case NE: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NE; - case GT: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GT; - case LT: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LT; - case GE: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GE; - case LE: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LE; - case SA: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.SA; - case EB: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB; - case AP: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP; - default: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL; + public static org.hl7.fhir.r5.model.SearchParameter convertSearchParameter(org.hl7.fhir.r4.model.SearchParameter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SearchParameter tgt = new org.hl7.fhir.r5.model.SearchParameter(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDerivedFrom()) + tgt.setDerivedFromElement(convertCanonical(src.getDerivedFromElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasBase()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.getBase().add(convertResourceEnum(t)); + } + if (src.hasType()) + tgt.setType(Enumerations.convertSearchParamType(src.getType())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasXpath()) + tgt.setXpathElement(convertString(src.getXpathElement())); + if (src.hasXpathUsage()) + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.getTarget().add(convertResourceEnum(t)); + } + if (src.hasMultipleOr()) + tgt.setMultipleOrElement(convertBoolean(src.getMultipleOrElement())); + if (src.hasMultipleAnd()) + tgt.setMultipleAndElement(convertBoolean(src.getMultipleAndElement())); + if (src.hasComparator()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getComparator()) copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); + } + if (src.hasModifier()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getModifier()) copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); + } + if (src.hasChain()) { + for (org.hl7.fhir.r4.model.StringType t : src.getChain()) tgt.getChain().add(convertString(t)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + } + return tgt; } - } - public static org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode convertSearchModifierCode(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MISSING: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.MISSING; - case EXACT: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.EXACT; - case CONTAINS: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.CONTAINS; - case NOT: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOT; - case TEXT: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TEXT; - case IN: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IN; - case NOTIN: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOTIN; - case BELOW: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.BELOW; - case ABOVE: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.ABOVE; - case TYPE: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TYPE; - case IDENTIFIER: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IDENTIFIER; - case OFTYPE: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.OFTYPE; - default: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NULL; + public static org.hl7.fhir.r4.model.SearchParameter convertSearchParameter(org.hl7.fhir.r5.model.SearchParameter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SearchParameter tgt = new org.hl7.fhir.r4.model.SearchParameter(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDerivedFrom()) + tgt.setDerivedFromElement(convertCanonical(src.getDerivedFromElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasBase()) { + for (CodeType t : src.getBase()) tgt.getBase().add(convertResourceEnum(t)); + } + if (src.hasType()) + tgt.setType(Enumerations.convertSearchParamType(src.getType())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasXpath()) + tgt.setXpathElement(convertString(src.getXpathElement())); + if (src.hasXpathUsage()) + tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); + if (src.hasTarget()) { + for (CodeType t : src.getTarget()) tgt.getTarget().add(convertResourceEnum(t)); + } + if (src.hasMultipleOr()) + tgt.setMultipleOrElement(convertBoolean(src.getMultipleOrElement())); + if (src.hasMultipleAnd()) + tgt.setMultipleAndElement(convertBoolean(src.getMultipleAndElement())); + if (src.hasComparator()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getComparator()) copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); + } + if (src.hasModifier()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getModifier()) copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); + } + if (src.hasChain()) { + for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.getChain().add(convertString(t)); + } + if (src.hasComponent()) { + for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) tgt.addComponent(convertSearchParameterComponentComponent(t)); + } + return tgt; } - } - public static org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode convertSearchModifierCode(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case MISSING: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING; - case EXACT: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT; - case CONTAINS: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS; - case NOT: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT; - case TEXT: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT; - case IN: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN; - case NOTIN: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN; - case BELOW: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW; - case ABOVE: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE; - case TYPE: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE; - case IDENTIFIER: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IDENTIFIER; - case OFTYPE: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.OFTYPE; - default: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL; + public static org.hl7.fhir.r5.model.SearchParameter.XPathUsageType convertXPathUsageType(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NORMAL: + return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NORMAL; + case PHONETIC: + return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.PHONETIC; + case NEARBY: + return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NEARBY; + case DISTANCE: + return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.DISTANCE; + case OTHER: + return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.OTHER; + default: + return org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NULL; + } } - } - public static org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent(); - copyElement(src, tgt); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.SearchParameter.XPathUsageType convertXPathUsageType(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NORMAL: + return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL; + case PHONETIC: + return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC; + case NEARBY: + return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NEARBY; + case DISTANCE: + return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.DISTANCE; + case OTHER: + return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER; + default: + return org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL; + } + } - public static org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent(); - copyElement(src, tgt); - if (src.hasDefinition()) - tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.SearchParameter.SearchComparator convertSearchComparator(org.hl7.fhir.r4.model.SearchParameter.SearchComparator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQ: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EQ; + case NE: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.NE; + case GT: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GT; + case LT: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LT; + case GE: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GE; + case LE: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LE; + case SA: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.SA; + case EB: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EB; + case AP: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.AP; + default: + return org.hl7.fhir.r5.model.SearchParameter.SearchComparator.NULL; + } + } + public static org.hl7.fhir.r4.model.SearchParameter.SearchComparator convertSearchComparator(org.hl7.fhir.r5.model.SearchParameter.SearchComparator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQ: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EQ; + case NE: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NE; + case GT: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GT; + case LT: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LT; + case GE: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GE; + case LE: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LE; + case SA: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.SA; + case EB: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB; + case AP: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP; + default: + return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL; + } + } + public static org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode convertSearchModifierCode(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MISSING: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.MISSING; + case EXACT: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.EXACT; + case CONTAINS: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.CONTAINS; + case NOT: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOT; + case TEXT: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TEXT; + case IN: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IN; + case NOTIN: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOTIN; + case BELOW: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.BELOW; + case ABOVE: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.ABOVE; + case TYPE: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TYPE; + case IDENTIFIER: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IDENTIFIER; + case OFTYPE: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.OFTYPE; + default: + return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NULL; + } + } + + public static org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode convertSearchModifierCode(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case MISSING: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING; + case EXACT: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT; + case CONTAINS: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS; + case NOT: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT; + case TEXT: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT; + case IN: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN; + case NOTIN: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN; + case BELOW: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW; + case ABOVE: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE; + case TYPE: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE; + case IDENTIFIER: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IDENTIFIER; + case OFTYPE: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.OFTYPE; + default: + return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL; + } + } + + public static org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent(); + copyElement(src, tgt); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent(); + copyElement(src, tgt); + if (src.hasDefinition()) + tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ServiceRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ServiceRequest.java index 30c71e90c..8544dbf18 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ServiceRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ServiceRequest.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,251 +51,320 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ServiceRequest extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r4.model.ServiceRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ServiceRequest tgt = new org.hl7.fhir.r5.model.ServiceRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - if (src.hasRequisition()) - tgt.setRequisition(convertIdentifier(src.getRequisition())); - if (src.hasStatus()) - tgt.setStatus(convertServiceRequestStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertServiceRequestIntent(src.getIntent())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertServiceRequestPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOrderDetail()) - tgt.addOrderDetail(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertType(src.getQuantity())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAsNeeded()) - tgt.setAsNeeded(convertType(src.getAsNeeded())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - if (src.hasPerformerType()) - tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); - for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationCode()) - tgt.addLocation(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getLocationReference()) - tgt.addLocation(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) - tgt.addSpecimen(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasPatientInstruction()) - tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r5.model.ServiceRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ServiceRequest tgt = new org.hl7.fhir.r4.model.ServiceRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) - tgt.getInstantiatesCanonical().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) - tgt.getInstantiatesUri().add(convertUri(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) - tgt.addReplaces(convertReference(t)); - if (src.hasRequisition()) - tgt.setRequisition(convertIdentifier(src.getRequisition())); - if (src.hasStatus()) - tgt.setStatus(convertServiceRequestStatus(src.getStatus())); - if (src.hasIntent()) - tgt.setIntent(convertServiceRequestIntent(src.getIntent())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasPriority()) - tgt.setPriority(convertServiceRequestPriority(src.getPriority())); - if (src.hasDoNotPerform()) - tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getOrderDetail()) - tgt.addOrderDetail(convertCodeableConcept(t)); - if (src.hasQuantity()) - tgt.setQuantity(convertType(src.getQuantity())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAsNeeded()) - tgt.setAsNeeded(convertType(src.getAsNeeded())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - if (src.hasPerformerType()) - tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); - for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) - tgt.addPerformer(convertReference(t)); - for (CodeableReference t : src.getLocation()) - if (t.hasConcept()) - tgt.addLocationCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getLocation()) - if (t.hasReference()) - tgt.addLocationReference(convertReference(t.getReference())); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) - tgt.addSupportingInfo(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) - tgt.addSpecimen(convertReference(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) - tgt.addBodySite(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - if (src.hasPatientInstruction()) - tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertServiceRequestStatus(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus convertServiceRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ACTIVE; - case ONHOLD: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ONHOLD; - case REVOKED: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.REVOKED; - case COMPLETED: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertServiceRequestIntent(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; - default: return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent convertServiceRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PROPOSAL: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PLAN; - case DIRECTIVE: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.DIRECTIVE; - case ORDER: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.OPTION; - default: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertServiceRequestPriority(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority convertServiceRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.STAT; - default: return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.NULL; - } -} + public static org.hl7.fhir.r5.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r4.model.ServiceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ServiceRequest tgt = new org.hl7.fhir.r5.model.ServiceRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasRequisition()) + tgt.setRequisition(convertIdentifier(src.getRequisition())); + if (src.hasStatus()) + tgt.setStatus(convertServiceRequestStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertServiceRequestIntent(src.getIntent())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertServiceRequestPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasOrderDetail()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOrderDetail()) tgt.addOrderDetail(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertType(src.getQuantity())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAsNeeded()) + tgt.setAsNeeded(convertType(src.getAsNeeded())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + if (src.hasLocationCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationCode()) tgt.addLocation(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasLocationReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getLocationReference()) tgt.addLocation(convertReferenceToCodeableReference(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(convertReference(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r5.model.ServiceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ServiceRequest tgt = new org.hl7.fhir.r4.model.ServiceRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(convertCanonical(t)); + } + if (src.hasInstantiatesUri()) { + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(convertUri(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasReplaces()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(convertReference(t)); + } + if (src.hasRequisition()) + tgt.setRequisition(convertIdentifier(src.getRequisition())); + if (src.hasStatus()) + tgt.setStatus(convertServiceRequestStatus(src.getStatus())); + if (src.hasIntent()) + tgt.setIntent(convertServiceRequestIntent(src.getIntent())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasPriority()) + tgt.setPriority(convertServiceRequestPriority(src.getPriority())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasOrderDetail()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getOrderDetail()) tgt.addOrderDetail(convertCodeableConcept(t)); + } + if (src.hasQuantity()) + tgt.setQuantity(convertType(src.getQuantity())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAsNeeded()) + tgt.setAsNeeded(convertType(src.getAsNeeded())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(convertCodeableConcept(src.getPerformerType())); + if (src.hasPerformer()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(convertReference(t)); + } + for (CodeableReference t : src.getLocation()) if (t.hasConcept()) + tgt.addLocationCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getLocation()) if (t.hasReference()) + tgt.addLocationReference(convertReference(t.getReference())); + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasSupportingInfo()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(convertReference(t)); + } + if (src.hasSpecimen()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(convertReference(t)); + } + if (src.hasBodySite()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement())); + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.RequestStatus convertServiceRequestStatus(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus convertServiceRequestStatus(org.hl7.fhir.r5.model.Enumerations.RequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ACTIVE; + case ONHOLD: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ONHOLD; + case REVOKED: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.REVOKED; + case COMPLETED: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestIntent convertServiceRequestIntent(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent convertServiceRequestIntent(org.hl7.fhir.r5.model.Enumerations.RequestIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PROPOSAL: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PLAN; + case DIRECTIVE: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.DIRECTIVE; + case ORDER: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.OPTION; + default: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertServiceRequestPriority(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority convertServiceRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.STAT; + default: + return org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Slot.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Slot.java index b6445b220..a242fd83c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Slot.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Slot.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,97 +50,112 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Slot extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Slot convertSlot(org.hl7.fhir.r4.model.Slot src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Slot tgt = new org.hl7.fhir.r5.model.Slot(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory()) - tgt.addServiceCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) - tgt.addServiceType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - if (src.hasAppointmentType()) - tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); - if (src.hasSchedule()) - tgt.setSchedule(convertReference(src.getSchedule())); - if (src.hasStatus()) - tgt.setStatus(convertSlotStatus(src.getStatus())); - if (src.hasStart()) - tgt.setStartElement(convertInstant(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInstant(src.getEndElement())); - if (src.hasOverbooked()) - tgt.setOverbookedElement(convertBoolean(src.getOverbookedElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Slot convertSlot(org.hl7.fhir.r5.model.Slot src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Slot tgt = new org.hl7.fhir.r4.model.Slot(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) - tgt.addServiceCategory(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) - tgt.addServiceType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) - tgt.addSpecialty(convertCodeableConcept(t)); - if (src.hasAppointmentType()) - tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); - if (src.hasSchedule()) - tgt.setSchedule(convertReference(src.getSchedule())); - if (src.hasStatus()) - tgt.setStatus(convertSlotStatus(src.getStatus())); - if (src.hasStart()) - tgt.setStartElement(convertInstant(src.getStartElement())); - if (src.hasEnd()) - tgt.setEndElement(convertInstant(src.getEndElement())); - if (src.hasOverbooked()) - tgt.setOverbookedElement(convertBoolean(src.getOverbookedElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Slot.SlotStatus convertSlotStatus(org.hl7.fhir.r4.model.Slot.SlotStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BUSY: return org.hl7.fhir.r5.model.Slot.SlotStatus.BUSY; - case FREE: return org.hl7.fhir.r5.model.Slot.SlotStatus.FREE; - case BUSYUNAVAILABLE: return org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYUNAVAILABLE; - case BUSYTENTATIVE: return org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYTENTATIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Slot.SlotStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Slot.SlotStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Slot.SlotStatus convertSlotStatus(org.hl7.fhir.r5.model.Slot.SlotStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case BUSY: return org.hl7.fhir.r4.model.Slot.SlotStatus.BUSY; - case FREE: return org.hl7.fhir.r4.model.Slot.SlotStatus.FREE; - case BUSYUNAVAILABLE: return org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYUNAVAILABLE; - case BUSYTENTATIVE: return org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYTENTATIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Slot.SlotStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Slot.SlotStatus.NULL; - } -} + public static org.hl7.fhir.r5.model.Slot convertSlot(org.hl7.fhir.r4.model.Slot src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Slot tgt = new org.hl7.fhir.r5.model.Slot(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasServiceCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory()) tgt.addServiceCategory(convertCodeableConcept(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasAppointmentType()) + tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); + if (src.hasSchedule()) + tgt.setSchedule(convertReference(src.getSchedule())); + if (src.hasStatus()) + tgt.setStatus(convertSlotStatus(src.getStatus())); + if (src.hasStart()) + tgt.setStartElement(convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInstant(src.getEndElement())); + if (src.hasOverbooked()) + tgt.setOverbookedElement(convertBoolean(src.getOverbookedElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.Slot convertSlot(org.hl7.fhir.r5.model.Slot src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Slot tgt = new org.hl7.fhir.r4.model.Slot(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasServiceCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) tgt.addServiceCategory(convertCodeableConcept(t)); + } + if (src.hasServiceType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType()) tgt.addServiceType(convertCodeableConcept(t)); + } + if (src.hasSpecialty()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) tgt.addSpecialty(convertCodeableConcept(t)); + } + if (src.hasAppointmentType()) + tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType())); + if (src.hasSchedule()) + tgt.setSchedule(convertReference(src.getSchedule())); + if (src.hasStatus()) + tgt.setStatus(convertSlotStatus(src.getStatus())); + if (src.hasStart()) + tgt.setStartElement(convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(convertInstant(src.getEndElement())); + if (src.hasOverbooked()) + tgt.setOverbookedElement(convertBoolean(src.getOverbookedElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.Slot.SlotStatus convertSlotStatus(org.hl7.fhir.r4.model.Slot.SlotStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BUSY: + return org.hl7.fhir.r5.model.Slot.SlotStatus.BUSY; + case FREE: + return org.hl7.fhir.r5.model.Slot.SlotStatus.FREE; + case BUSYUNAVAILABLE: + return org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYUNAVAILABLE; + case BUSYTENTATIVE: + return org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYTENTATIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Slot.SlotStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Slot.SlotStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Slot.SlotStatus convertSlotStatus(org.hl7.fhir.r5.model.Slot.SlotStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case BUSY: + return org.hl7.fhir.r4.model.Slot.SlotStatus.BUSY; + case FREE: + return org.hl7.fhir.r4.model.Slot.SlotStatus.FREE; + case BUSYUNAVAILABLE: + return org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYUNAVAILABLE; + case BUSYTENTATIVE: + return org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYTENTATIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Slot.SlotStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Slot.SlotStatus.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Specimen.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Specimen.java index 373aef67b..295196afb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Specimen.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Specimen.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,219 +50,242 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Specimen extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Specimen convertSpecimen(org.hl7.fhir.r4.model.Specimen src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Specimen tgt = new org.hl7.fhir.r5.model.Specimen(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasAccessionIdentifier()) - tgt.setAccessionIdentifier(convertIdentifier(src.getAccessionIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertSpecimenStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasReceivedTime()) - tgt.setReceivedTimeElement(convertDateTime(src.getReceivedTimeElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getParent()) - tgt.addParent(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getRequest()) - tgt.addRequest(convertReference(t)); - if (src.hasCollection()) - tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); - for (org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) - tgt.addProcessing(convertSpecimenProcessingComponent(t)); - for (org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent t : src.getContainer()) - tgt.addContainer(convertSpecimenContainerComponent(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCondition()) - tgt.addCondition(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Specimen convertSpecimen(org.hl7.fhir.r5.model.Specimen src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Specimen tgt = new org.hl7.fhir.r4.model.Specimen(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasAccessionIdentifier()) - tgt.setAccessionIdentifier(convertIdentifier(src.getAccessionIdentifier())); - if (src.hasStatus()) - tgt.setStatus(convertSpecimenStatus(src.getStatus())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSubject()) - tgt.setSubject(convertReference(src.getSubject())); - if (src.hasReceivedTime()) - tgt.setReceivedTimeElement(convertDateTime(src.getReceivedTimeElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getParent()) - tgt.addParent(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) - tgt.addRequest(convertReference(t)); - if (src.hasCollection()) - tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); - for (org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) - tgt.addProcessing(convertSpecimenProcessingComponent(t)); - for (org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent t : src.getContainer()) - tgt.addContainer(convertSpecimenContainerComponent(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCondition()) - tgt.addCondition(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Specimen.SpecimenStatus convertSpecimenStatus(org.hl7.fhir.r4.model.Specimen.SpecimenStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AVAILABLE: return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.AVAILABLE; - case UNAVAILABLE: return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNAVAILABLE; - case UNSATISFACTORY: return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNSATISFACTORY; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Specimen.SpecimenStatus convertSpecimenStatus(org.hl7.fhir.r5.model.Specimen.SpecimenStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case AVAILABLE: return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.AVAILABLE; - case UNAVAILABLE: return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNAVAILABLE; - case UNSATISFACTORY: return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNSATISFACTORY; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent(); - copyElement(src, tgt); - if (src.hasCollector()) - tgt.setCollector(convertReference(src.getCollector())); - if (src.hasCollected()) - tgt.setCollected(convertType(src.getCollected())); - if (src.hasDuration()) - tgt.setDuration(convertDuration(src.getDuration())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - if (src.hasFastingStatus()) - tgt.setFastingStatus(convertType(src.getFastingStatus())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent tgt = new org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent(); - copyElement(src, tgt); - if (src.hasCollector()) - tgt.setCollector(convertReference(src.getCollector())); - if (src.hasCollected()) - tgt.setCollected(convertType(src.getCollected())); - if (src.hasDuration()) - tgt.setDuration(convertDuration(src.getDuration())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasMethod()) - tgt.setMethod(convertCodeableConcept(src.getMethod())); - if (src.hasBodySite()) - tgt.setBodySite(convertCodeableConcept(src.getBodySite())); - if (src.hasFastingStatus()) - tgt.setFastingStatus(convertType(src.getFastingStatus())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent convertSpecimenProcessingComponent(org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertCodeableConcept(src.getProcedure())); - for (org.hl7.fhir.r4.model.Reference t : src.getAdditive()) - tgt.addAdditive(convertReference(t)); - if (src.hasTime()) - tgt.setTime(convertType(src.getTime())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent convertSpecimenProcessingComponent(org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent tgt = new org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasProcedure()) - tgt.setProcedure(convertCodeableConcept(src.getProcedure())); - for (org.hl7.fhir.r5.model.Reference t : src.getAdditive()) - tgt.addAdditive(convertReference(t)); - if (src.hasTime()) - tgt.setTime(convertType(src.getTime())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent convertSpecimenContainerComponent(org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasCapacity()) - tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); - if (src.hasSpecimenQuantity()) - tgt.setSpecimenQuantity(convertSimpleQuantity(src.getSpecimenQuantity())); - if (src.hasAdditive()) - tgt.setAdditive(convertType(src.getAdditive())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent convertSpecimenContainerComponent(org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasCapacity()) - tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); - if (src.hasSpecimenQuantity()) - tgt.setSpecimenQuantity(convertSimpleQuantity(src.getSpecimenQuantity())); - if (src.hasAdditive()) - tgt.setAdditive(convertType(src.getAdditive())); - return tgt; - } + public static org.hl7.fhir.r5.model.Specimen convertSpecimen(org.hl7.fhir.r4.model.Specimen src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen tgt = new org.hl7.fhir.r5.model.Specimen(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasAccessionIdentifier()) + tgt.setAccessionIdentifier(convertIdentifier(src.getAccessionIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertSpecimenStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasReceivedTime()) + tgt.setReceivedTimeElement(convertDateTime(src.getReceivedTimeElement())); + if (src.hasParent()) { + for (org.hl7.fhir.r4.model.Reference t : src.getParent()) tgt.addParent(convertReference(t)); + } + if (src.hasRequest()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRequest()) tgt.addRequest(convertReference(t)); + } + if (src.hasCollection()) + tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); + if (src.hasProcessing()) { + for (org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); + } + if (src.hasContainer()) { + for (org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCondition()) tgt.addCondition(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Specimen convertSpecimen(org.hl7.fhir.r5.model.Specimen src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Specimen tgt = new org.hl7.fhir.r4.model.Specimen(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasAccessionIdentifier()) + tgt.setAccessionIdentifier(convertIdentifier(src.getAccessionIdentifier())); + if (src.hasStatus()) + tgt.setStatus(convertSpecimenStatus(src.getStatus())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(convertReference(src.getSubject())); + if (src.hasReceivedTime()) + tgt.setReceivedTimeElement(convertDateTime(src.getReceivedTimeElement())); + if (src.hasParent()) { + for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(convertReference(t)); + } + if (src.hasRequest()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(convertReference(t)); + } + if (src.hasCollection()) + tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); + if (src.hasProcessing()) { + for (org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) tgt.addProcessing(convertSpecimenProcessingComponent(t)); + } + if (src.hasContainer()) { + for (org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent t : src.getContainer()) tgt.addContainer(convertSpecimenContainerComponent(t)); + } + if (src.hasCondition()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCondition()) tgt.addCondition(convertCodeableConcept(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Specimen.SpecimenStatus convertSpecimenStatus(org.hl7.fhir.r4.model.Specimen.SpecimenStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AVAILABLE: + return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.AVAILABLE; + case UNAVAILABLE: + return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNAVAILABLE; + case UNSATISFACTORY: + return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNSATISFACTORY; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Specimen.SpecimenStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Specimen.SpecimenStatus convertSpecimenStatus(org.hl7.fhir.r5.model.Specimen.SpecimenStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case AVAILABLE: + return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.AVAILABLE; + case UNAVAILABLE: + return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNAVAILABLE; + case UNSATISFACTORY: + return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNSATISFACTORY; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Specimen.SpecimenStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent(); + copyElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(convertReference(src.getCollector())); + if (src.hasCollected()) + tgt.setCollected(convertType(src.getCollected())); + if (src.hasDuration()) + tgt.setDuration(convertDuration(src.getDuration())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasFastingStatus()) + tgt.setFastingStatus(convertType(src.getFastingStatus())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent tgt = new org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent(); + copyElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(convertReference(src.getCollector())); + if (src.hasCollected()) + tgt.setCollected(convertType(src.getCollected())); + if (src.hasDuration()) + tgt.setDuration(convertDuration(src.getDuration())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasMethod()) + tgt.setMethod(convertCodeableConcept(src.getMethod())); + if (src.hasBodySite()) + tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + if (src.hasFastingStatus()) + tgt.setFastingStatus(convertType(src.getFastingStatus())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent convertSpecimenProcessingComponent(org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertCodeableConcept(src.getProcedure())); + if (src.hasAdditive()) { + for (org.hl7.fhir.r4.model.Reference t : src.getAdditive()) tgt.addAdditive(convertReference(t)); + } + if (src.hasTime()) + tgt.setTime(convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent convertSpecimenProcessingComponent(org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent tgt = new org.hl7.fhir.r4.model.Specimen.SpecimenProcessingComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasProcedure()) + tgt.setProcedure(convertCodeableConcept(src.getProcedure())); + if (src.hasAdditive()) { + for (org.hl7.fhir.r5.model.Reference t : src.getAdditive()) tgt.addAdditive(convertReference(t)); + } + if (src.hasTime()) + tgt.setTime(convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent convertSpecimenContainerComponent(org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCapacity()) + tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); + if (src.hasSpecimenQuantity()) + tgt.setSpecimenQuantity(convertSimpleQuantity(src.getSpecimenQuantity())); + if (src.hasAdditive()) + tgt.setAdditive(convertType(src.getAdditive())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent convertSpecimenContainerComponent(org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r4.model.Specimen.SpecimenContainerComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCapacity()) + tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); + if (src.hasSpecimenQuantity()) + tgt.setSpecimenQuantity(convertSimpleQuantity(src.getSpecimenQuantity())); + if (src.hasAdditive()) + tgt.setAdditive(convertType(src.getAdditive())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SpecimenDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SpecimenDefinition.java index dc6ab500f..1cf467d2d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SpecimenDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SpecimenDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,219 +50,232 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SpecimenDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SpecimenDefinition convertSpecimenDefinition(org.hl7.fhir.r4.model.SpecimenDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SpecimenDefinition tgt = new org.hl7.fhir.r5.model.SpecimenDefinition(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasTypeCollected()) - tgt.setTypeCollected(convertCodeableConcept(src.getTypeCollected())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPatientPreparation()) - tgt.addPatientPreparation(convertCodeableConcept(t)); - if (src.hasTimeAspect()) - tgt.setTimeAspectElement(convertString(src.getTimeAspectElement())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCollection()) - tgt.addCollection(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent t : src.getTypeTested()) - tgt.addTypeTested(convertSpecimenDefinitionTypeTestedComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SpecimenDefinition convertSpecimenDefinition(org.hl7.fhir.r4.model.SpecimenDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition tgt = new org.hl7.fhir.r5.model.SpecimenDefinition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasTypeCollected()) + tgt.setTypeCollected(convertCodeableConcept(src.getTypeCollected())); + if (src.hasPatientPreparation()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPatientPreparation()) tgt.addPatientPreparation(convertCodeableConcept(t)); + } + if (src.hasTimeAspect()) + tgt.setTimeAspectElement(convertString(src.getTimeAspectElement())); + if (src.hasCollection()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCollection()) tgt.addCollection(convertCodeableConcept(t)); + } + if (src.hasTypeTested()) { + for (org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent t : src.getTypeTested()) tgt.addTypeTested(convertSpecimenDefinitionTypeTestedComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SpecimenDefinition convertSpecimenDefinition(org.hl7.fhir.r5.model.SpecimenDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SpecimenDefinition tgt = new org.hl7.fhir.r4.model.SpecimenDefinition(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasTypeCollected()) - tgt.setTypeCollected(convertCodeableConcept(src.getTypeCollected())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPatientPreparation()) - tgt.addPatientPreparation(convertCodeableConcept(t)); - if (src.hasTimeAspect()) - tgt.setTimeAspectElement(convertString(src.getTimeAspectElement())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCollection()) - tgt.addCollection(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent t : src.getTypeTested()) - tgt.addTypeTested(convertSpecimenDefinitionTypeTestedComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SpecimenDefinition convertSpecimenDefinition(org.hl7.fhir.r5.model.SpecimenDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SpecimenDefinition tgt = new org.hl7.fhir.r4.model.SpecimenDefinition(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasTypeCollected()) + tgt.setTypeCollected(convertCodeableConcept(src.getTypeCollected())); + if (src.hasPatientPreparation()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPatientPreparation()) tgt.addPatientPreparation(convertCodeableConcept(t)); + } + if (src.hasTimeAspect()) + tgt.setTimeAspectElement(convertString(src.getTimeAspectElement())); + if (src.hasCollection()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCollection()) tgt.addCollection(convertCodeableConcept(t)); + } + if (src.hasTypeTested()) { + for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent t : src.getTypeTested()) tgt.addTypeTested(convertSpecimenDefinitionTypeTestedComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent convertSpecimenDefinitionTypeTestedComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent(); - copyElement(src, tgt); - if (src.hasIsDerived()) - tgt.setIsDerivedElement(convertBoolean(src.getIsDerivedElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasPreference()) - tgt.setPreference(convertSpecimenContainedPreference(src.getPreference())); - if (src.hasContainer()) - tgt.setContainer(convertSpecimenDefinitionTypeTestedContainerComponent(src.getContainer())); - if (src.hasRequirement()) - tgt.setRequirementElement(convertString(src.getRequirementElement())); - if (src.hasRetentionTime()) - tgt.setRetentionTime(convertDuration(src.getRetentionTime())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRejectionCriterion()) - tgt.addRejectionCriterion(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent t : src.getHandling()) - tgt.addHandling(convertSpecimenDefinitionTypeTestedHandlingComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent convertSpecimenDefinitionTypeTestedComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent(); - copyElement(src, tgt); - if (src.hasIsDerived()) - tgt.setIsDerivedElement(convertBoolean(src.getIsDerivedElement())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasPreference()) - tgt.setPreference(convertSpecimenContainedPreference(src.getPreference())); - if (src.hasContainer()) - tgt.setContainer(convertSpecimenDefinitionTypeTestedContainerComponent(src.getContainer())); - if (src.hasRequirement()) - tgt.setRequirementElement(convertString(src.getRequirementElement())); - if (src.hasRetentionTime()) - tgt.setRetentionTime(convertDuration(src.getRetentionTime())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRejectionCriterion()) - tgt.addRejectionCriterion(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent t : src.getHandling()) - tgt.addHandling(convertSpecimenDefinitionTypeTestedHandlingComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference convertSpecimenContainedPreference(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PREFERRED: return org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED; - case ALTERNATE: return org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE; - default: return org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.NULL; - } -} - - public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference convertSpecimenContainedPreference(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PREFERRED: return org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED; - case ALTERNATE: return org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE; - default: return org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.NULL; - } -} - - public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent(); - copyElement(src, tgt); - if (src.hasMaterial()) - tgt.setMaterial(convertCodeableConcept(src.getMaterial())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasCap()) - tgt.setCap(convertCodeableConcept(src.getCap())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCapacity()) - tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); - if (src.hasMinimumVolume()) - tgt.setMinimumVolume(convertType(src.getMinimumVolume())); - for (org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent t : src.getAdditive()) - tgt.addAdditive(convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(t)); - if (src.hasPreparation()) - tgt.setPreparationElement(convertString(src.getPreparationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent(); - copyElement(src, tgt); - if (src.hasMaterial()) - tgt.setMaterial(convertCodeableConcept(src.getMaterial())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasCap()) - tgt.setCap(convertCodeableConcept(src.getCap())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasCapacity()) - tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); - if (src.hasMinimumVolume()) - tgt.setMinimumVolume(convertType(src.getMinimumVolume())); - for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent t : src.getAdditive()) - tgt.addAdditive(convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(t)); - if (src.hasPreparation()) - tgt.setPreparationElement(convertString(src.getPreparationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent(); - copyElement(src, tgt); - if (src.hasAdditive()) - tgt.setAdditive(convertType(src.getAdditive())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent(); - copyElement(src, tgt); - if (src.hasAdditive()) - tgt.setAdditive(convertType(src.getAdditive())); - return tgt; - } - - public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent convertSpecimenDefinitionTypeTestedHandlingComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent(); - copyElement(src, tgt); - if (src.hasTemperatureQualifier()) - tgt.setTemperatureQualifier(convertCodeableConcept(src.getTemperatureQualifier())); - if (src.hasTemperatureRange()) - tgt.setTemperatureRange(convertRange(src.getTemperatureRange())); - if (src.hasMaxDuration()) - tgt.setMaxDuration(convertDuration(src.getMaxDuration())); - if (src.hasInstruction()) - tgt.setInstructionElement(convertString(src.getInstructionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent convertSpecimenDefinitionTypeTestedHandlingComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent(); - copyElement(src, tgt); - if (src.hasTemperatureQualifier()) - tgt.setTemperatureQualifier(convertCodeableConcept(src.getTemperatureQualifier())); - if (src.hasTemperatureRange()) - tgt.setTemperatureRange(convertRange(src.getTemperatureRange())); - if (src.hasMaxDuration()) - tgt.setMaxDuration(convertDuration(src.getMaxDuration())); - if (src.hasInstruction()) - tgt.setInstructionElement(convertString(src.getInstructionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent convertSpecimenDefinitionTypeTestedComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent(); + copyElement(src, tgt); + if (src.hasIsDerived()) + tgt.setIsDerivedElement(convertBoolean(src.getIsDerivedElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasPreference()) + tgt.setPreference(convertSpecimenContainedPreference(src.getPreference())); + if (src.hasContainer()) + tgt.setContainer(convertSpecimenDefinitionTypeTestedContainerComponent(src.getContainer())); + if (src.hasRequirement()) + tgt.setRequirementElement(convertString(src.getRequirementElement())); + if (src.hasRetentionTime()) + tgt.setRetentionTime(convertDuration(src.getRetentionTime())); + if (src.hasRejectionCriterion()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRejectionCriterion()) tgt.addRejectionCriterion(convertCodeableConcept(t)); + } + if (src.hasHandling()) { + for (org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent t : src.getHandling()) tgt.addHandling(convertSpecimenDefinitionTypeTestedHandlingComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent convertSpecimenDefinitionTypeTestedComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent(); + copyElement(src, tgt); + if (src.hasIsDerived()) + tgt.setIsDerivedElement(convertBoolean(src.getIsDerivedElement())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasPreference()) + tgt.setPreference(convertSpecimenContainedPreference(src.getPreference())); + if (src.hasContainer()) + tgt.setContainer(convertSpecimenDefinitionTypeTestedContainerComponent(src.getContainer())); + if (src.hasRequirement()) + tgt.setRequirementElement(convertString(src.getRequirementElement())); + if (src.hasRetentionTime()) + tgt.setRetentionTime(convertDuration(src.getRetentionTime())); + if (src.hasRejectionCriterion()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRejectionCriterion()) tgt.addRejectionCriterion(convertCodeableConcept(t)); + } + if (src.hasHandling()) { + for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent t : src.getHandling()) tgt.addHandling(convertSpecimenDefinitionTypeTestedHandlingComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference convertSpecimenContainedPreference(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PREFERRED: + return org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED; + case ALTERNATE: + return org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE; + default: + return org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.NULL; + } + } + + public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference convertSpecimenContainedPreference(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PREFERRED: + return org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED; + case ALTERNATE: + return org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE; + default: + return org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.NULL; + } + } + + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent(); + copyElement(src, tgt); + if (src.hasMaterial()) + tgt.setMaterial(convertCodeableConcept(src.getMaterial())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCap()) + tgt.setCap(convertCodeableConcept(src.getCap())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCapacity()) + tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); + if (src.hasMinimumVolume()) + tgt.setMinimumVolume(convertType(src.getMinimumVolume())); + if (src.hasAdditive()) { + for (org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent t : src.getAdditive()) tgt.addAdditive(convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(t)); + } + if (src.hasPreparation()) + tgt.setPreparationElement(convertString(src.getPreparationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent(); + copyElement(src, tgt); + if (src.hasMaterial()) + tgt.setMaterial(convertCodeableConcept(src.getMaterial())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasCap()) + tgt.setCap(convertCodeableConcept(src.getCap())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasCapacity()) + tgt.setCapacity(convertSimpleQuantity(src.getCapacity())); + if (src.hasMinimumVolume()) + tgt.setMinimumVolume(convertType(src.getMinimumVolume())); + if (src.hasAdditive()) { + for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent t : src.getAdditive()) tgt.addAdditive(convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(t)); + } + if (src.hasPreparation()) + tgt.setPreparationElement(convertString(src.getPreparationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent(); + copyElement(src, tgt); + if (src.hasAdditive()) + tgt.setAdditive(convertType(src.getAdditive())); + return tgt; + } + + public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent(); + copyElement(src, tgt); + if (src.hasAdditive()) + tgt.setAdditive(convertType(src.getAdditive())); + return tgt; + } + + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent convertSpecimenDefinitionTypeTestedHandlingComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent(); + copyElement(src, tgt); + if (src.hasTemperatureQualifier()) + tgt.setTemperatureQualifier(convertCodeableConcept(src.getTemperatureQualifier())); + if (src.hasTemperatureRange()) + tgt.setTemperatureRange(convertRange(src.getTemperatureRange())); + if (src.hasMaxDuration()) + tgt.setMaxDuration(convertDuration(src.getMaxDuration())); + if (src.hasInstruction()) + tgt.setInstructionElement(convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent convertSpecimenDefinitionTypeTestedHandlingComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent tgt = new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent(); + copyElement(src, tgt); + if (src.hasTemperatureQualifier()) + tgt.setTemperatureQualifier(convertCodeableConcept(src.getTemperatureQualifier())); + if (src.hasTemperatureRange()) + tgt.setTemperatureRange(convertRange(src.getTemperatureRange())); + if (src.hasMaxDuration()) + tgt.setMaxDuration(convertDuration(src.getMaxDuration())); + if (src.hasInstruction()) + tgt.setInstructionElement(convertString(src.getInstructionElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureDefinition.java index effcd9c46..1aaae896d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureDefinition.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,297 +50,336 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class StructureDefinition extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r4.model.StructureDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureDefinition tgt = new org.hl7.fhir.r5.model.StructureDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) - tgt.addKeyword(convertCoding(t)); - if (src.hasFhirVersion()) - tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); - for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) - tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - if (src.hasKind()) - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - if (src.hasAbstract()) - tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); - for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) - tgt.addContext(convertStructureDefinitionContextComponent(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getContextInvariant()) - tgt.getContextInvariant().add(convertString(t)); - if (src.hasType()) - tgt.setTypeElement(convertUri(src.getTypeElement())); - if (src.hasBaseDefinition()) - tgt.setBaseDefinitionElement(convertCanonical(src.getBaseDefinitionElement())); - if (src.hasDerivation()) - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); - if (src.hasSnapshot()) - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - if (src.hasDifferential()) - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r5.model.StructureDefinition src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureDefinition tgt = new org.hl7.fhir.r4.model.StructureDefinition(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) - tgt.addKeyword(convertCoding(t)); - if (src.hasFhirVersion()) - tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); - for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) - tgt.addMapping(convertStructureDefinitionMappingComponent(t)); - if (src.hasKind()) - tgt.setKind(convertStructureDefinitionKind(src.getKind())); - if (src.hasAbstract()) - tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); - for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) - tgt.addContext(convertStructureDefinitionContextComponent(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getContextInvariant()) - tgt.getContextInvariant().add(convertString(t)); - if (src.hasType()) - tgt.setTypeElement(convertUri(src.getTypeElement())); - if (src.hasBaseDefinition()) - tgt.setBaseDefinitionElement(convertCanonical(src.getBaseDefinitionElement())); - if (src.hasDerivation()) - tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); - if (src.hasSnapshot()) - tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); - if (src.hasDifferential()) - tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind convertStructureDefinitionKind(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRIMITIVETYPE: return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE; - case COMPLEXTYPE: return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE; - case RESOURCE: return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE; - case LOGICAL: return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL; - default: return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind convertStructureDefinitionKind(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PRIMITIVETYPE: return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE; - case COMPLEXTYPE: return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE; - case RESOURCE: return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE; - case LOGICAL: return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL; - default: return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule convertTypeDerivationRule(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SPECIALIZATION: return org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION; - case CONSTRAINT: return org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT; - default: return org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule convertTypeDerivationRule(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SPECIALIZATION: return org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION; - case CONSTRAINT: return org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT; - default: return org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); - copyElement(src, tgt); - if (src.hasIdentity()) - tgt.setIdentityElement(convertId(src.getIdentityElement())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent(); - copyElement(src, tgt); - if (src.hasIdentity()) - tgt.setIdentityElement(convertId(src.getIdentityElement())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertExtensionContextType(src.getType())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertExtensionContextType(src.getType())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType convertExtensionContextType(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FHIRPATH: return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.FHIRPATH; - case ELEMENT: return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT; - case EXTENSION: return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION; - default: return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType convertExtensionContextType(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FHIRPATH: return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.FHIRPATH; - case ELEMENT: return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT; - case EXTENSION: return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION; - default: return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) - tgt.addElement(convertElementDefinition(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) - tgt.addElement(convertElementDefinition(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) - tgt.addElement(convertElementDefinition(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) - tgt.addElement(convertElementDefinition(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r4.model.StructureDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition tgt = new org.hl7.fhir.r5.model.StructureDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasKeyword()) { + for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addKeyword(convertCoding(t)); + } + if (src.hasFhirVersion()) + tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); + if (src.hasMapping()) { + for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + if (src.hasAbstract()) + tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); + if (src.hasContext()) { + for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) tgt.addContext(convertStructureDefinitionContextComponent(t)); + } + if (src.hasContextInvariant()) { + for (org.hl7.fhir.r4.model.StringType t : src.getContextInvariant()) tgt.getContextInvariant().add(convertString(t)); + } + if (src.hasType()) + tgt.setTypeElement(convertUri(src.getTypeElement())); + if (src.hasBaseDefinition()) + tgt.setBaseDefinitionElement(convertCanonical(src.getBaseDefinitionElement())); + if (src.hasDerivation()) + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasSnapshot()) + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + if (src.hasDifferential()) + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + return tgt; + } + public static org.hl7.fhir.r4.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r5.model.StructureDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureDefinition tgt = new org.hl7.fhir.r4.model.StructureDefinition(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasKeyword()) { + for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addKeyword(convertCoding(t)); + } + if (src.hasFhirVersion()) + tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion())); + if (src.hasMapping()) { + for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + } + if (src.hasKind()) + tgt.setKind(convertStructureDefinitionKind(src.getKind())); + if (src.hasAbstract()) + tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); + if (src.hasContext()) { + for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) tgt.addContext(convertStructureDefinitionContextComponent(t)); + } + if (src.hasContextInvariant()) { + for (org.hl7.fhir.r5.model.StringType t : src.getContextInvariant()) tgt.getContextInvariant().add(convertString(t)); + } + if (src.hasType()) + tgt.setTypeElement(convertUri(src.getTypeElement())); + if (src.hasBaseDefinition()) + tgt.setBaseDefinitionElement(convertCanonical(src.getBaseDefinitionElement())); + if (src.hasDerivation()) + tgt.setDerivation(convertTypeDerivationRule(src.getDerivation())); + if (src.hasSnapshot()) + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + if (src.hasDifferential()) + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + return tgt; + } + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind convertStructureDefinitionKind(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRIMITIVETYPE: + return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE; + case COMPLEXTYPE: + return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE; + case RESOURCE: + return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE; + case LOGICAL: + return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL; + default: + return org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind convertStructureDefinitionKind(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PRIMITIVETYPE: + return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE; + case COMPLEXTYPE: + return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE; + case RESOURCE: + return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE; + case LOGICAL: + return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL; + default: + return org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule convertTypeDerivationRule(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SPECIALIZATION: + return org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION; + case CONSTRAINT: + return org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT; + default: + return org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule convertTypeDerivationRule(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SPECIALIZATION: + return org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION; + case CONSTRAINT: + return org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT; + default: + return org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); + copyElement(src, tgt); + if (src.hasIdentity()) + tgt.setIdentityElement(convertId(src.getIdentityElement())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent(); + copyElement(src, tgt); + if (src.hasIdentity()) + tgt.setIdentityElement(convertId(src.getIdentityElement())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertExtensionContextType(src.getType())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertExtensionContextType(src.getType())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType convertExtensionContextType(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FHIRPATH: + return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.FHIRPATH; + case ELEMENT: + return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT; + case EXTENSION: + return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION; + default: + return org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType convertExtensionContextType(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FHIRPATH: + return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.FHIRPATH; + case ELEMENT: + return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT; + case EXTENSION: + return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION; + default: + return org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent(); + copyElement(src, tgt); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(convertElementDefinition(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent(); + copyElement(src, tgt); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(convertElementDefinition(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent(); + copyElement(src, tgt); + if (src.hasElement()) { + for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) tgt.addElement(convertElementDefinition(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent(); + copyElement(src, tgt); + if (src.hasElement()) { + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) tgt.addElement(convertElementDefinition(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureMap.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureMap.java index aebbac2c9..c2873edd2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureMap.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureMap.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,581 +50,696 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class StructureMap extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.StructureMap convertStructureMap(org.hl7.fhir.r4.model.StructureMap src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap tgt = new org.hl7.fhir.r5.model.StructureMap(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) - tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getImport()) - tgt.getImport().add(convertCanonical(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) - tgt.addGroup(convertStructureMapGroupComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.StructureMap convertStructureMap(org.hl7.fhir.r4.model.StructureMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap tgt = new org.hl7.fhir.r5.model.StructureMap(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasStructure()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getImport()) tgt.getImport().add(convertCanonical(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.StructureMap convertStructureMap(org.hl7.fhir.r5.model.StructureMap src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap tgt = new org.hl7.fhir.r4.model.StructureMap(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) - tgt.addStructure(convertStructureMapStructureComponent(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getImport()) - tgt.getImport().add(convertCanonical(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) - tgt.addGroup(convertStructureMapGroupComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.StructureMap convertStructureMap(org.hl7.fhir.r5.model.StructureMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap tgt = new org.hl7.fhir.r4.model.StructureMap(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasStructure()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); + } + if (src.hasImport()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getImport()) tgt.getImport().add(convertCanonical(t)); + } + if (src.hasGroup()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) tgt.addGroup(convertStructureMapGroupComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent(); - copyElement(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertCanonical(src.getUrlElement())); - if (src.hasMode()) - tgt.setMode(convertStructureMapModelMode(src.getMode())); - if (src.hasAlias()) - tgt.setAliasElement(convertString(src.getAliasElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent(); - copyElement(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertCanonical(src.getUrlElement())); - if (src.hasMode()) - tgt.setMode(convertStructureMapModelMode(src.getMode())); - if (src.hasAlias()) - tgt.setAliasElement(convertString(src.getAliasElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode convertStructureMapModelMode(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SOURCE: return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.SOURCE; - case QUERIED: return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.QUERIED; - case TARGET: return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.TARGET; - case PRODUCED: return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.PRODUCED; - default: return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode convertStructureMapModelMode(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SOURCE: return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE; - case QUERIED: return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED; - case TARGET: return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET; - case PRODUCED: return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED; - default: return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - if (src.hasExtends()) - tgt.setExtendsElement(convertId(src.getExtendsElement())); - if (src.hasTypeMode()) - tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) - tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) - tgt.addRule(convertStructureMapGroupRuleComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - if (src.hasExtends()) - tgt.setExtendsElement(convertId(src.getExtendsElement())); - if (src.hasTypeMode()) - tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) - tgt.addInput(convertStructureMapGroupInputComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) - tgt.addRule(convertStructureMapGroupRuleComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode convertStructureMapGroupTypeMode(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NONE: return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NONE; - case TYPES: return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPES; - case TYPEANDTYPES: return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES; - default: return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode convertStructureMapGroupTypeMode(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case NONE: return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NONE; - case TYPES: return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPES; - case TYPEANDTYPES: return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES; - default: return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasMode()) - tgt.setMode(convertStructureMapInputMode(src.getMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasMode()) - tgt.setMode(convertStructureMapInputMode(src.getMode())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode convertStructureMapInputMode(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SOURCE: return org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.SOURCE; - case TARGET: return org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.TARGET; - default: return org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode convertStructureMapInputMode(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case SOURCE: return org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE; - case TARGET: return org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET; - default: return org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) - tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) - tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) - tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) - tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) - tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) - tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) - tgt.addRule(convertStructureMapGroupRuleComponent(t)); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) - tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent(); - copyElement(src, tgt); - if (src.hasContext()) - tgt.setContextElement(convertId(src.getContextElement())); - if (src.hasMin()) - tgt.setMinElement(convertInteger(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasDefaultValue()) - tgt.setDefaultValue(convertType(src.getDefaultValue())); - if (src.hasElement()) - tgt.setElementElement(convertString(src.getElementElement())); - if (src.hasListMode()) - tgt.setListMode(convertStructureMapSourceListMode(src.getListMode())); - if (src.hasVariable()) - tgt.setVariableElement(convertId(src.getVariableElement())); - if (src.hasCondition()) - tgt.setConditionElement(convertString(src.getConditionElement())); - if (src.hasCheck()) - tgt.setCheckElement(convertString(src.getCheckElement())); - if (src.hasLogMessage()) - tgt.setLogMessageElement(convertString(src.getLogMessageElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent(); - copyElement(src, tgt); - if (src.hasContext()) - tgt.setContextElement(convertId(src.getContextElement())); - if (src.hasMin()) - tgt.setMinElement(convertInteger(src.getMinElement())); - if (src.hasMax()) - tgt.setMaxElement(convertString(src.getMaxElement())); - if (src.hasType()) - tgt.setTypeElement(convertString(src.getTypeElement())); - if (src.hasDefaultValue()) - tgt.setDefaultValue(convertType(src.getDefaultValue())); - if (src.hasElement()) - tgt.setElementElement(convertString(src.getElementElement())); - if (src.hasListMode()) - tgt.setListMode(convertStructureMapSourceListMode(src.getListMode())); - if (src.hasVariable()) - tgt.setVariableElement(convertId(src.getVariableElement())); - if (src.hasCondition()) - tgt.setConditionElement(convertString(src.getConditionElement())); - if (src.hasCheck()) - tgt.setCheckElement(convertString(src.getCheckElement())); - if (src.hasLogMessage()) - tgt.setLogMessageElement(convertString(src.getLogMessageElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode convertStructureMapSourceListMode(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FIRST: return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.FIRST; - case NOTFIRST: return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTFIRST; - case LAST: return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.LAST; - case NOTLAST: return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTLAST; - case ONLYONE: return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.ONLYONE; - default: return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode convertStructureMapSourceListMode(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FIRST: return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST; - case NOTFIRST: return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTFIRST; - case LAST: return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST; - case NOTLAST: return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTLAST; - case ONLYONE: return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.ONLYONE; - default: return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent(); - copyElement(src, tgt); - if (src.hasContext()) - tgt.setContextElement(convertId(src.getContextElement())); - if (src.hasContextType()) - tgt.setContextType(convertStructureMapContextType(src.getContextType())); - if (src.hasElement()) - tgt.setElementElement(convertString(src.getElementElement())); - if (src.hasVariable()) - tgt.setVariableElement(convertId(src.getVariableElement())); - for (org.hl7.fhir.r4.model.Enumeration t : src.getListMode()) - copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); - if (src.hasListRuleId()) - tgt.setListRuleIdElement(convertId(src.getListRuleIdElement())); - if (src.hasTransform()) - tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) - tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent(); - copyElement(src, tgt); - if (src.hasContext()) - tgt.setContextElement(convertId(src.getContextElement())); - if (src.hasContextType()) - tgt.setContextType(convertStructureMapContextType(src.getContextType())); - if (src.hasElement()) - tgt.setElementElement(convertString(src.getElementElement())); - if (src.hasVariable()) - tgt.setVariableElement(convertId(src.getVariableElement())); - for (org.hl7.fhir.r5.model.Enumeration t : src.getListMode()) - copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); - if (src.hasListRuleId()) - tgt.setListRuleIdElement(convertId(src.getListRuleIdElement())); - if (src.hasTransform()) - tgt.setTransform(convertStructureMapTransform(src.getTransform())); - for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) - tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapContextType convertStructureMapContextType(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case TYPE: return org.hl7.fhir.r5.model.StructureMap.StructureMapContextType.TYPE; - case VARIABLE: return org.hl7.fhir.r5.model.StructureMap.StructureMapContextType.VARIABLE; - default: return org.hl7.fhir.r5.model.StructureMap.StructureMapContextType.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapContextType convertStructureMapContextType(org.hl7.fhir.r5.model.StructureMap.StructureMapContextType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case TYPE: return org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.TYPE; - case VARIABLE: return org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.VARIABLE; - default: return org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode convertStructureMapTargetListMode(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FIRST: return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.FIRST; - case SHARE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SHARE; - case LAST: return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.LAST; - case COLLATE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.COLLATE; - default: return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode convertStructureMapTargetListMode(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case FIRST: return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.FIRST; - case SHARE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.SHARE; - case LAST: return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.LAST; - case COLLATE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.COLLATE; - default: return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapTransform convertStructureMapTransform(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CREATE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CREATE; - case COPY: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.COPY; - case TRUNCATE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRUNCATE; - case ESCAPE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ESCAPE; - case CAST: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CAST; - case APPEND: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.APPEND; - case TRANSLATE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRANSLATE; - case REFERENCE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.REFERENCE; - case DATEOP: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.DATEOP; - case UUID: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.UUID; - case POINTER: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.POINTER; - case EVALUATE: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.EVALUATE; - case CC: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CC; - case C: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.C; - case QTY: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.QTY; - case ID: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ID; - case CP: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CP; - default: return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.NULL; - } -} - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapTransform convertStructureMapTransform(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case CREATE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE; - case COPY: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY; - case TRUNCATE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE; - case ESCAPE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE; - case CAST: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST; - case APPEND: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND; - case TRANSLATE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE; - case REFERENCE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE; - case DATEOP: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP; - case UUID: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID; - case POINTER: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER; - case EVALUATE: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE; - case CC: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CC; - case C: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.C; - case QTY: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.QTY; - case ID: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ID; - case CP: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CP; - default: return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL; - } -} - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); - copyElement(src, tgt); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) - tgt.getVariable().add(convertString(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertId(src.getNameElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) - tgt.getVariable().add(convertString(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent(); + copyElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertCanonical(src.getUrlElement())); + if (src.hasMode()) + tgt.setMode(convertStructureMapModelMode(src.getMode())); + if (src.hasAlias()) + tgt.setAliasElement(convertString(src.getAliasElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent(); + copyElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertCanonical(src.getUrlElement())); + if (src.hasMode()) + tgt.setMode(convertStructureMapModelMode(src.getMode())); + if (src.hasAlias()) + tgt.setAliasElement(convertString(src.getAliasElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode convertStructureMapModelMode(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SOURCE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.SOURCE; + case QUERIED: + return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.QUERIED; + case TARGET: + return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.TARGET; + case PRODUCED: + return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.PRODUCED; + default: + return org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode convertStructureMapModelMode(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SOURCE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE; + case QUERIED: + return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED; + case TARGET: + return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET; + case PRODUCED: + return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED; + default: + return org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasExtends()) + tgt.setExtendsElement(convertId(src.getExtendsElement())); + if (src.hasTypeMode()) + tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + if (src.hasInput()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasExtends()) + tgt.setExtendsElement(convertId(src.getExtendsElement())); + if (src.hasTypeMode()) + tgt.setTypeMode(convertStructureMapGroupTypeMode(src.getTypeMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + if (src.hasInput()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) tgt.addInput(convertStructureMapGroupInputComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode convertStructureMapGroupTypeMode(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NONE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NONE; + case TYPES: + return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPES; + case TYPEANDTYPES: + return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES; + default: + return org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode convertStructureMapGroupTypeMode(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case NONE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NONE; + case TYPES: + return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPES; + case TYPEANDTYPES: + return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES; + default: + return org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasMode()) + tgt.setMode(convertStructureMapInputMode(src.getMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasMode()) + tgt.setMode(convertStructureMapInputMode(src.getMode())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode convertStructureMapInputMode(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SOURCE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.SOURCE; + case TARGET: + return org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.TARGET; + default: + return org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode convertStructureMapInputMode(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case SOURCE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE; + case TARGET: + return org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET; + default: + return org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasSource()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasSource()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + } + if (src.hasRule()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) tgt.addRule(convertStructureMapGroupRuleComponent(t)); + } + if (src.hasDependent()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + } + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent(); + copyElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(convertId(src.getContextElement())); + if (src.hasMin()) + tgt.setMinElement(convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValue(convertType(src.getDefaultValue())); + if (src.hasElement()) + tgt.setElementElement(convertString(src.getElementElement())); + if (src.hasListMode()) + tgt.setListMode(convertStructureMapSourceListMode(src.getListMode())); + if (src.hasVariable()) + tgt.setVariableElement(convertId(src.getVariableElement())); + if (src.hasCondition()) + tgt.setConditionElement(convertString(src.getConditionElement())); + if (src.hasCheck()) + tgt.setCheckElement(convertString(src.getCheckElement())); + if (src.hasLogMessage()) + tgt.setLogMessageElement(convertString(src.getLogMessageElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent(); + copyElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(convertId(src.getContextElement())); + if (src.hasMin()) + tgt.setMinElement(convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(convertString(src.getMaxElement())); + if (src.hasType()) + tgt.setTypeElement(convertString(src.getTypeElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValue(convertType(src.getDefaultValue())); + if (src.hasElement()) + tgt.setElementElement(convertString(src.getElementElement())); + if (src.hasListMode()) + tgt.setListMode(convertStructureMapSourceListMode(src.getListMode())); + if (src.hasVariable()) + tgt.setVariableElement(convertId(src.getVariableElement())); + if (src.hasCondition()) + tgt.setConditionElement(convertString(src.getConditionElement())); + if (src.hasCheck()) + tgt.setCheckElement(convertString(src.getCheckElement())); + if (src.hasLogMessage()) + tgt.setLogMessageElement(convertString(src.getLogMessageElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode convertStructureMapSourceListMode(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FIRST: + return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.FIRST; + case NOTFIRST: + return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTFIRST; + case LAST: + return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.LAST; + case NOTLAST: + return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTLAST; + case ONLYONE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.ONLYONE; + default: + return org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode convertStructureMapSourceListMode(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FIRST: + return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST; + case NOTFIRST: + return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTFIRST; + case LAST: + return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST; + case NOTLAST: + return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTLAST; + case ONLYONE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.ONLYONE; + default: + return org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent(); + copyElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(convertId(src.getContextElement())); + if (src.hasContextType()) + tgt.setContextType(convertStructureMapContextType(src.getContextType())); + if (src.hasElement()) + tgt.setElementElement(convertString(src.getElementElement())); + if (src.hasVariable()) + tgt.setVariableElement(convertId(src.getVariableElement())); + if (src.hasListMode()) { + for (org.hl7.fhir.r4.model.Enumeration t : src.getListMode()) copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } + if (src.hasListRuleId()) + tgt.setListRuleIdElement(convertId(src.getListRuleIdElement())); + if (src.hasTransform()) + tgt.setTransform(convertStructureMapTransform(src.getTransform())); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent(); + copyElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(convertId(src.getContextElement())); + if (src.hasContextType()) + tgt.setContextType(convertStructureMapContextType(src.getContextType())); + if (src.hasElement()) + tgt.setElementElement(convertString(src.getElementElement())); + if (src.hasVariable()) + tgt.setVariableElement(convertId(src.getVariableElement())); + if (src.hasListMode()) { + for (org.hl7.fhir.r5.model.Enumeration t : src.getListMode()) copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); + } + if (src.hasListRuleId()) + tgt.setListRuleIdElement(convertId(src.getListRuleIdElement())); + if (src.hasTransform()) + tgt.setTransform(convertStructureMapTransform(src.getTransform())); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapContextType convertStructureMapContextType(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case TYPE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapContextType.TYPE; + case VARIABLE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapContextType.VARIABLE; + default: + return org.hl7.fhir.r5.model.StructureMap.StructureMapContextType.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapContextType convertStructureMapContextType(org.hl7.fhir.r5.model.StructureMap.StructureMapContextType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case TYPE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.TYPE; + case VARIABLE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.VARIABLE; + default: + return org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode convertStructureMapTargetListMode(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FIRST: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.FIRST; + case SHARE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SHARE; + case LAST: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.LAST; + case COLLATE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.COLLATE; + default: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode convertStructureMapTargetListMode(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case FIRST: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.FIRST; + case SHARE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.SHARE; + case LAST: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.LAST; + case COLLATE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.COLLATE; + default: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapTransform convertStructureMapTransform(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CREATE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CREATE; + case COPY: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.COPY; + case TRUNCATE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRUNCATE; + case ESCAPE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ESCAPE; + case CAST: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CAST; + case APPEND: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.APPEND; + case TRANSLATE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRANSLATE; + case REFERENCE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.REFERENCE; + case DATEOP: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.DATEOP; + case UUID: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.UUID; + case POINTER: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.POINTER; + case EVALUATE: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.EVALUATE; + case CC: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CC; + case C: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.C; + case QTY: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.QTY; + case ID: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ID; + case CP: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CP; + default: + return org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.NULL; + } + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapTransform convertStructureMapTransform(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case CREATE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE; + case COPY: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY; + case TRUNCATE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE; + case ESCAPE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE; + case CAST: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST; + case APPEND: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND; + case TRANSLATE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE; + case REFERENCE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE; + case DATEOP: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP; + case UUID: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID; + case POINTER: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER; + case EVALUATE: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE; + case CC: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CC; + case C: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.C; + case QTY: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.QTY; + case ID: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ID; + case CP: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CP; + default: + return org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL; + } + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); + copyElement(src, tgt); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasVariable()) { + for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.getVariable().add(convertString(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertId(src.getNameElement())); + if (src.hasVariable()) { + for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.getVariable().add(convertString(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Substance.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Substance.java index 6ef2a99a6..d348418a6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Substance.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Substance.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,129 +50,140 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Substance extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Substance convertSubstance(org.hl7.fhir.r4.model.Substance src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Substance tgt = new org.hl7.fhir.r5.model.Substance(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent t : src.getInstance()) - tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) - tgt.addIngredient(convertSubstanceIngredientComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Substance convertSubstance(org.hl7.fhir.r5.model.Substance src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Substance tgt = new org.hl7.fhir.r4.model.Substance(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) - tgt.addCategory(convertCodeableConcept(t)); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent t : src.getInstance()) - tgt.addInstance(convertSubstanceInstanceComponent(t)); - for (org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) - tgt.addIngredient(convertSubstanceIngredientComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus convertFHIRSubstanceStatus(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus convertFHIRSubstanceStatus(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ACTIVE; - case INACTIVE: return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.INACTIVE; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent convertSubstanceInstanceComponent(org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasExpiry()) - tgt.setExpiryElement(convertDateTime(src.getExpiryElement())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent convertSubstanceInstanceComponent(org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasExpiry()) - tgt.setExpiryElement(convertDateTime(src.getExpiryElement())); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertRatio(src.getQuantity())); - if (src.hasSubstance()) - tgt.setSubstance(convertType(src.getSubstance())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertRatio(src.getQuantity())); - if (src.hasSubstance()) - tgt.setSubstance(convertType(src.getSubstance())); - return tgt; - } + public static org.hl7.fhir.r5.model.Substance convertSubstance(org.hl7.fhir.r4.model.Substance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Substance tgt = new org.hl7.fhir.r5.model.Substance(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasInstance()) { + for (org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Substance convertSubstance(org.hl7.fhir.r5.model.Substance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Substance tgt = new org.hl7.fhir.r4.model.Substance(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertFHIRSubstanceStatus(src.getStatus())); + if (src.hasCategory()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(convertCodeableConcept(t)); + } + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasInstance()) { + for (org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); + } + if (src.hasIngredient()) { + for (org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) tgt.addIngredient(convertSubstanceIngredientComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus convertFHIRSubstanceStatus(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus convertFHIRSubstanceStatus(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ACTIVE; + case INACTIVE: + return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.INACTIVE; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent convertSubstanceInstanceComponent(org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasExpiry()) + tgt.setExpiryElement(convertDateTime(src.getExpiryElement())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent convertSubstanceInstanceComponent(org.hl7.fhir.r5.model.Substance.SubstanceInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasExpiry()) + tgt.setExpiryElement(convertDateTime(src.getExpiryElement())); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertRatio(src.getQuantity())); + if (src.hasSubstance()) + tgt.setSubstance(convertType(src.getSubstance())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r4.model.Substance.SubstanceIngredientComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertRatio(src.getQuantity())); + if (src.hasSubstance()) + tgt.setSubstance(convertType(src.getSubstance())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceNucleicAcid.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceNucleicAcid.java index 4e440b407..badf5329f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceNucleicAcid.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceNucleicAcid.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,155 +50,156 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SubstanceNucleicAcid extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SubstanceNucleicAcid convertSubstanceNucleicAcid(org.hl7.fhir.r4.model.SubstanceNucleicAcid src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceNucleicAcid tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid(); - copyDomainResource(src, tgt); - if (src.hasSequenceType()) - tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); - if (src.hasNumberOfSubunits()) - tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); - if (src.hasAreaOfHybridisation()) - tgt.setAreaOfHybridisationElement(convertString(src.getAreaOfHybridisationElement())); - if (src.hasOligoNucleotideType()) - tgt.setOligoNucleotideType(convertCodeableConcept(src.getOligoNucleotideType())); - for (org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent t : src.getSubunit()) - tgt.addSubunit(convertSubstanceNucleicAcidSubunitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceNucleicAcid convertSubstanceNucleicAcid(org.hl7.fhir.r4.model.SubstanceNucleicAcid src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceNucleicAcid tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid(); + copyDomainResource(src, tgt); + if (src.hasSequenceType()) + tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); + if (src.hasNumberOfSubunits()) + tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); + if (src.hasAreaOfHybridisation()) + tgt.setAreaOfHybridisationElement(convertString(src.getAreaOfHybridisationElement())); + if (src.hasOligoNucleotideType()) + tgt.setOligoNucleotideType(convertCodeableConcept(src.getOligoNucleotideType())); + if (src.hasSubunit()) { + for (org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent t : src.getSubunit()) tgt.addSubunit(convertSubstanceNucleicAcidSubunitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceNucleicAcid convertSubstanceNucleicAcid(org.hl7.fhir.r5.model.SubstanceNucleicAcid src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceNucleicAcid tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid(); - copyDomainResource(src, tgt); - if (src.hasSequenceType()) - tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); - if (src.hasNumberOfSubunits()) - tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); - if (src.hasAreaOfHybridisation()) - tgt.setAreaOfHybridisationElement(convertString(src.getAreaOfHybridisationElement())); - if (src.hasOligoNucleotideType()) - tgt.setOligoNucleotideType(convertCodeableConcept(src.getOligoNucleotideType())); - for (org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent t : src.getSubunit()) - tgt.addSubunit(convertSubstanceNucleicAcidSubunitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceNucleicAcid convertSubstanceNucleicAcid(org.hl7.fhir.r5.model.SubstanceNucleicAcid src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceNucleicAcid tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid(); + copyDomainResource(src, tgt); + if (src.hasSequenceType()) + tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); + if (src.hasNumberOfSubunits()) + tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); + if (src.hasAreaOfHybridisation()) + tgt.setAreaOfHybridisationElement(convertString(src.getAreaOfHybridisationElement())); + if (src.hasOligoNucleotideType()) + tgt.setOligoNucleotideType(convertCodeableConcept(src.getOligoNucleotideType())); + if (src.hasSubunit()) { + for (org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent t : src.getSubunit()) tgt.addSubunit(convertSubstanceNucleicAcidSubunitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent convertSubstanceNucleicAcidSubunitComponent(org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent(); - copyElement(src, tgt); - if (src.hasSubunit()) - tgt.setSubunitElement(convertInteger(src.getSubunitElement())); - if (src.hasSequence()) - tgt.setSequenceElement(convertString(src.getSequenceElement())); - if (src.hasLength()) - tgt.setLengthElement(convertInteger(src.getLengthElement())); - if (src.hasSequenceAttachment()) - tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); - if (src.hasFivePrime()) - tgt.setFivePrime(convertCodeableConcept(src.getFivePrime())); - if (src.hasThreePrime()) - tgt.setThreePrime(convertCodeableConcept(src.getThreePrime())); - for (org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent t : src.getLinkage()) - tgt.addLinkage(convertSubstanceNucleicAcidSubunitLinkageComponent(t)); - for (org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent t : src.getSugar()) - tgt.addSugar(convertSubstanceNucleicAcidSubunitSugarComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent convertSubstanceNucleicAcidSubunitComponent(org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent(); + copyElement(src, tgt); + if (src.hasSubunit()) + tgt.setSubunitElement(convertInteger(src.getSubunitElement())); + if (src.hasSequence()) + tgt.setSequenceElement(convertString(src.getSequenceElement())); + if (src.hasLength()) + tgt.setLengthElement(convertInteger(src.getLengthElement())); + if (src.hasSequenceAttachment()) + tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); + if (src.hasFivePrime()) + tgt.setFivePrime(convertCodeableConcept(src.getFivePrime())); + if (src.hasThreePrime()) + tgt.setThreePrime(convertCodeableConcept(src.getThreePrime())); + if (src.hasLinkage()) { + for (org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent t : src.getLinkage()) tgt.addLinkage(convertSubstanceNucleicAcidSubunitLinkageComponent(t)); + } + if (src.hasSugar()) { + for (org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent t : src.getSugar()) tgt.addSugar(convertSubstanceNucleicAcidSubunitSugarComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent convertSubstanceNucleicAcidSubunitComponent(org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent(); - copyElement(src, tgt); - if (src.hasSubunit()) - tgt.setSubunitElement(convertInteger(src.getSubunitElement())); - if (src.hasSequence()) - tgt.setSequenceElement(convertString(src.getSequenceElement())); - if (src.hasLength()) - tgt.setLengthElement(convertInteger(src.getLengthElement())); - if (src.hasSequenceAttachment()) - tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); - if (src.hasFivePrime()) - tgt.setFivePrime(convertCodeableConcept(src.getFivePrime())); - if (src.hasThreePrime()) - tgt.setThreePrime(convertCodeableConcept(src.getThreePrime())); - for (org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent t : src.getLinkage()) - tgt.addLinkage(convertSubstanceNucleicAcidSubunitLinkageComponent(t)); - for (org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent t : src.getSugar()) - tgt.addSugar(convertSubstanceNucleicAcidSubunitSugarComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent convertSubstanceNucleicAcidSubunitComponent(org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent(); + copyElement(src, tgt); + if (src.hasSubunit()) + tgt.setSubunitElement(convertInteger(src.getSubunitElement())); + if (src.hasSequence()) + tgt.setSequenceElement(convertString(src.getSequenceElement())); + if (src.hasLength()) + tgt.setLengthElement(convertInteger(src.getLengthElement())); + if (src.hasSequenceAttachment()) + tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); + if (src.hasFivePrime()) + tgt.setFivePrime(convertCodeableConcept(src.getFivePrime())); + if (src.hasThreePrime()) + tgt.setThreePrime(convertCodeableConcept(src.getThreePrime())); + if (src.hasLinkage()) { + for (org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent t : src.getLinkage()) tgt.addLinkage(convertSubstanceNucleicAcidSubunitLinkageComponent(t)); + } + if (src.hasSugar()) { + for (org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent t : src.getSugar()) tgt.addSugar(convertSubstanceNucleicAcidSubunitSugarComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent convertSubstanceNucleicAcidSubunitLinkageComponent(org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent(); - copyElement(src, tgt); - if (src.hasConnectivity()) - tgt.setConnectivityElement(convertString(src.getConnectivityElement())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasResidueSite()) - tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent convertSubstanceNucleicAcidSubunitLinkageComponent(org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent(); + copyElement(src, tgt); + if (src.hasConnectivity()) + tgt.setConnectivityElement(convertString(src.getConnectivityElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasResidueSite()) + tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent convertSubstanceNucleicAcidSubunitLinkageComponent(org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent(); - copyElement(src, tgt); - if (src.hasConnectivity()) - tgt.setConnectivityElement(convertString(src.getConnectivityElement())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasResidueSite()) - tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent convertSubstanceNucleicAcidSubunitSugarComponent(org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasResidueSite()) - tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent convertSubstanceNucleicAcidSubunitSugarComponent(org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasResidueSite()) - tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent convertSubstanceNucleicAcidSubunitLinkageComponent(org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent(); + copyElement(src, tgt); + if (src.hasConnectivity()) + tgt.setConnectivityElement(convertString(src.getConnectivityElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasResidueSite()) + tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent convertSubstanceNucleicAcidSubunitSugarComponent(org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent tgt = new org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasResidueSite()) + tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent convertSubstanceNucleicAcidSubunitSugarComponent(org.hl7.fhir.r5.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent tgt = new org.hl7.fhir.r4.model.SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasResidueSite()) + tgt.setResidueSiteElement(convertString(src.getResidueSiteElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstancePolymer.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstancePolymer.java index 0a1c10eb0..9b37586e1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstancePolymer.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstancePolymer.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,227 +50,238 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SubstancePolymer extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SubstancePolymer convertSubstancePolymer(org.hl7.fhir.r4.model.SubstancePolymer src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstancePolymer tgt = new org.hl7.fhir.r5.model.SubstancePolymer(); - copyDomainResource(src, tgt); - if (src.hasClass_()) - tgt.setClass_(convertCodeableConcept(src.getClass_())); - if (src.hasGeometry()) - tgt.setGeometry(convertCodeableConcept(src.getGeometry())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCopolymerConnectivity()) - tgt.addCopolymerConnectivity(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getModification()) - tgt.getModification().add(convertString(t)); - for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent t : src.getMonomerSet()) - tgt.addMonomerSet(convertSubstancePolymerMonomerSetComponent(t)); - for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent t : src.getRepeat()) - tgt.addRepeat(convertSubstancePolymerRepeatComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstancePolymer convertSubstancePolymer(org.hl7.fhir.r4.model.SubstancePolymer src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstancePolymer tgt = new org.hl7.fhir.r5.model.SubstancePolymer(); + copyDomainResource(src, tgt); + if (src.hasClass_()) + tgt.setClass_(convertCodeableConcept(src.getClass_())); + if (src.hasGeometry()) + tgt.setGeometry(convertCodeableConcept(src.getGeometry())); + if (src.hasCopolymerConnectivity()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCopolymerConnectivity()) tgt.addCopolymerConnectivity(convertCodeableConcept(t)); + } + if (src.hasModification()) { + for (org.hl7.fhir.r4.model.StringType t : src.getModification()) tgt.getModification().add(convertString(t)); + } + if (src.hasMonomerSet()) { + for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent t : src.getMonomerSet()) tgt.addMonomerSet(convertSubstancePolymerMonomerSetComponent(t)); + } + if (src.hasRepeat()) { + for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent t : src.getRepeat()) tgt.addRepeat(convertSubstancePolymerRepeatComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstancePolymer convertSubstancePolymer(org.hl7.fhir.r5.model.SubstancePolymer src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstancePolymer tgt = new org.hl7.fhir.r4.model.SubstancePolymer(); - copyDomainResource(src, tgt); - if (src.hasClass_()) - tgt.setClass_(convertCodeableConcept(src.getClass_())); - if (src.hasGeometry()) - tgt.setGeometry(convertCodeableConcept(src.getGeometry())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCopolymerConnectivity()) - tgt.addCopolymerConnectivity(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getModification()) - tgt.getModification().add(convertString(t)); - for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent t : src.getMonomerSet()) - tgt.addMonomerSet(convertSubstancePolymerMonomerSetComponent(t)); - for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent t : src.getRepeat()) - tgt.addRepeat(convertSubstancePolymerRepeatComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstancePolymer convertSubstancePolymer(org.hl7.fhir.r5.model.SubstancePolymer src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstancePolymer tgt = new org.hl7.fhir.r4.model.SubstancePolymer(); + copyDomainResource(src, tgt); + if (src.hasClass_()) + tgt.setClass_(convertCodeableConcept(src.getClass_())); + if (src.hasGeometry()) + tgt.setGeometry(convertCodeableConcept(src.getGeometry())); + if (src.hasCopolymerConnectivity()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCopolymerConnectivity()) tgt.addCopolymerConnectivity(convertCodeableConcept(t)); + } + if (src.hasModification()) { + for (org.hl7.fhir.r5.model.StringType t : src.getModification()) tgt.getModification().add(convertString(t)); + } + if (src.hasMonomerSet()) { + for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent t : src.getMonomerSet()) tgt.addMonomerSet(convertSubstancePolymerMonomerSetComponent(t)); + } + if (src.hasRepeat()) { + for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent t : src.getRepeat()) tgt.addRepeat(convertSubstancePolymerRepeatComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent convertSubstancePolymerMonomerSetComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent(); - copyElement(src, tgt); - if (src.hasRatioType()) - tgt.setRatioType(convertCodeableConcept(src.getRatioType())); - for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent t : src.getStartingMaterial()) - tgt.addStartingMaterial(convertSubstancePolymerMonomerSetStartingMaterialComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent convertSubstancePolymerMonomerSetComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent(); + copyElement(src, tgt); + if (src.hasRatioType()) + tgt.setRatioType(convertCodeableConcept(src.getRatioType())); + if (src.hasStartingMaterial()) { + for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent t : src.getStartingMaterial()) tgt.addStartingMaterial(convertSubstancePolymerMonomerSetStartingMaterialComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent convertSubstancePolymerMonomerSetComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent(); - copyElement(src, tgt); - if (src.hasRatioType()) - tgt.setRatioType(convertCodeableConcept(src.getRatioType())); - for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent t : src.getStartingMaterial()) - tgt.addStartingMaterial(convertSubstancePolymerMonomerSetStartingMaterialComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent convertSubstancePolymerMonomerSetComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetComponent(); + copyElement(src, tgt); + if (src.hasRatioType()) + tgt.setRatioType(convertCodeableConcept(src.getRatioType())); + if (src.hasStartingMaterial()) { + for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent t : src.getStartingMaterial()) tgt.addStartingMaterial(convertSubstancePolymerMonomerSetStartingMaterialComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent convertSubstancePolymerMonomerSetStartingMaterialComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent(); - copyElement(src, tgt); - if (src.hasMaterial()) - tgt.setMaterial(convertCodeableConcept(src.getMaterial())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasIsDefining()) - tgt.setIsDefiningElement(convertBoolean(src.getIsDefiningElement())); - if (src.hasAmount()) - tgt.setAmount(convertSubstanceAmount(src.getAmount())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent convertSubstancePolymerMonomerSetStartingMaterialComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent(); + copyElement(src, tgt); + if (src.hasMaterial()) + tgt.setMaterial(convertCodeableConcept(src.getMaterial())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasIsDefining()) + tgt.setIsDefiningElement(convertBoolean(src.getIsDefiningElement())); + if (src.hasAmount()) + tgt.setAmount(convertSubstanceAmount(src.getAmount())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent convertSubstancePolymerMonomerSetStartingMaterialComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent(); - copyElement(src, tgt); - if (src.hasMaterial()) - tgt.setMaterial(convertCodeableConcept(src.getMaterial())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasIsDefining()) - tgt.setIsDefiningElement(convertBoolean(src.getIsDefiningElement())); - if (src.hasAmount()) - tgt.setAmount(convertSubstanceAmount(src.getAmount())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent convertSubstancePolymerMonomerSetStartingMaterialComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent(); + copyElement(src, tgt); + if (src.hasMaterial()) + tgt.setMaterial(convertCodeableConcept(src.getMaterial())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasIsDefining()) + tgt.setIsDefiningElement(convertBoolean(src.getIsDefiningElement())); + if (src.hasAmount()) + tgt.setAmount(convertSubstanceAmount(src.getAmount())); + return tgt; + } - public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent convertSubstancePolymerRepeatComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent(); - copyElement(src, tgt); - if (src.hasNumberOfUnits()) - tgt.setNumberOfUnitsElement(convertInteger(src.getNumberOfUnitsElement())); - if (src.hasAverageMolecularFormula()) - tgt.setAverageMolecularFormulaElement(convertString(src.getAverageMolecularFormulaElement())); - if (src.hasRepeatUnitAmountType()) - tgt.setRepeatUnitAmountType(convertCodeableConcept(src.getRepeatUnitAmountType())); - for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent t : src.getRepeatUnit()) - tgt.addRepeatUnit(convertSubstancePolymerRepeatRepeatUnitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent convertSubstancePolymerRepeatComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent(); + copyElement(src, tgt); + if (src.hasNumberOfUnits()) + tgt.setNumberOfUnitsElement(convertInteger(src.getNumberOfUnitsElement())); + if (src.hasAverageMolecularFormula()) + tgt.setAverageMolecularFormulaElement(convertString(src.getAverageMolecularFormulaElement())); + if (src.hasRepeatUnitAmountType()) + tgt.setRepeatUnitAmountType(convertCodeableConcept(src.getRepeatUnitAmountType())); + if (src.hasRepeatUnit()) { + for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent t : src.getRepeatUnit()) tgt.addRepeatUnit(convertSubstancePolymerRepeatRepeatUnitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent convertSubstancePolymerRepeatComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent(); - copyElement(src, tgt); - if (src.hasNumberOfUnits()) - tgt.setNumberOfUnitsElement(convertInteger(src.getNumberOfUnitsElement())); - if (src.hasAverageMolecularFormula()) - tgt.setAverageMolecularFormulaElement(convertString(src.getAverageMolecularFormulaElement())); - if (src.hasRepeatUnitAmountType()) - tgt.setRepeatUnitAmountType(convertCodeableConcept(src.getRepeatUnitAmountType())); - for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent t : src.getRepeatUnit()) - tgt.addRepeatUnit(convertSubstancePolymerRepeatRepeatUnitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent convertSubstancePolymerRepeatComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatComponent(); + copyElement(src, tgt); + if (src.hasNumberOfUnits()) + tgt.setNumberOfUnitsElement(convertInteger(src.getNumberOfUnitsElement())); + if (src.hasAverageMolecularFormula()) + tgt.setAverageMolecularFormulaElement(convertString(src.getAverageMolecularFormulaElement())); + if (src.hasRepeatUnitAmountType()) + tgt.setRepeatUnitAmountType(convertCodeableConcept(src.getRepeatUnitAmountType())); + if (src.hasRepeatUnit()) { + for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent t : src.getRepeatUnit()) tgt.addRepeatUnit(convertSubstancePolymerRepeatRepeatUnitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent convertSubstancePolymerRepeatRepeatUnitComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent(); - copyElement(src, tgt); - if (src.hasOrientationOfPolymerisation()) - tgt.setOrientationOfPolymerisation(convertCodeableConcept(src.getOrientationOfPolymerisation())); - if (src.hasRepeatUnit()) - tgt.setRepeatUnitElement(convertString(src.getRepeatUnitElement())); - if (src.hasAmount()) - tgt.setAmount(convertSubstanceAmount(src.getAmount())); - for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent t : src.getDegreeOfPolymerisation()) - tgt.addDegreeOfPolymerisation(convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(t)); - for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent t : src.getStructuralRepresentation()) - tgt.addStructuralRepresentation(convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent convertSubstancePolymerRepeatRepeatUnitComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent(); + copyElement(src, tgt); + if (src.hasOrientationOfPolymerisation()) + tgt.setOrientationOfPolymerisation(convertCodeableConcept(src.getOrientationOfPolymerisation())); + if (src.hasRepeatUnit()) + tgt.setRepeatUnitElement(convertString(src.getRepeatUnitElement())); + if (src.hasAmount()) + tgt.setAmount(convertSubstanceAmount(src.getAmount())); + if (src.hasDegreeOfPolymerisation()) { + for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent t : src.getDegreeOfPolymerisation()) tgt.addDegreeOfPolymerisation(convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(t)); + } + if (src.hasStructuralRepresentation()) { + for (org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent t : src.getStructuralRepresentation()) tgt.addStructuralRepresentation(convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent convertSubstancePolymerRepeatRepeatUnitComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent(); - copyElement(src, tgt); - if (src.hasOrientationOfPolymerisation()) - tgt.setOrientationOfPolymerisation(convertCodeableConcept(src.getOrientationOfPolymerisation())); - if (src.hasRepeatUnit()) - tgt.setRepeatUnitElement(convertString(src.getRepeatUnitElement())); - if (src.hasAmount()) - tgt.setAmount(convertSubstanceAmount(src.getAmount())); - for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent t : src.getDegreeOfPolymerisation()) - tgt.addDegreeOfPolymerisation(convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(t)); - for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent t : src.getStructuralRepresentation()) - tgt.addStructuralRepresentation(convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent convertSubstancePolymerRepeatRepeatUnitComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent(); + copyElement(src, tgt); + if (src.hasOrientationOfPolymerisation()) + tgt.setOrientationOfPolymerisation(convertCodeableConcept(src.getOrientationOfPolymerisation())); + if (src.hasRepeatUnit()) + tgt.setRepeatUnitElement(convertString(src.getRepeatUnitElement())); + if (src.hasAmount()) + tgt.setAmount(convertSubstanceAmount(src.getAmount())); + if (src.hasDegreeOfPolymerisation()) { + for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent t : src.getDegreeOfPolymerisation()) tgt.addDegreeOfPolymerisation(convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(t)); + } + if (src.hasStructuralRepresentation()) { + for (org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent t : src.getStructuralRepresentation()) tgt.addStructuralRepresentation(convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(); - copyElement(src, tgt); - if (src.hasDegree()) - tgt.setDegree(convertCodeableConcept(src.getDegree())); - if (src.hasAmount()) - tgt.setAmount(convertSubstanceAmount(src.getAmount())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(); + copyElement(src, tgt); + if (src.hasDegree()) + tgt.setDegree(convertCodeableConcept(src.getDegree())); + if (src.hasAmount()) + tgt.setAmount(convertSubstanceAmount(src.getAmount())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(); - copyElement(src, tgt); - if (src.hasDegree()) - tgt.setDegree(convertCodeableConcept(src.getDegree())); - if (src.hasAmount()) - tgt.setAmount(convertSubstanceAmount(src.getAmount())); - return tgt; - } - - public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasRepresentation()) - tgt.setRepresentationElement(convertString(src.getRepresentationElement())); - if (src.hasAttachment()) - tgt.setAttachment(convertAttachment(src.getAttachment())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasRepresentation()) - tgt.setRepresentationElement(convertString(src.getRepresentationElement())); - if (src.hasAttachment()) - tgt.setAttachment(convertAttachment(src.getAttachment())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent convertSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(); + copyElement(src, tgt); + if (src.hasDegree()) + tgt.setDegree(convertCodeableConcept(src.getDegree())); + if (src.hasAmount()) + tgt.setAmount(convertSubstanceAmount(src.getAmount())); + return tgt; + } + public static org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent tgt = new org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRepresentation()) + tgt.setRepresentationElement(convertString(src.getRepresentationElement())); + if (src.hasAttachment()) + tgt.setAttachment(convertAttachment(src.getAttachment())); + return tgt; + } + public static org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent convertSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(org.hl7.fhir.r5.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent tgt = new org.hl7.fhir.r4.model.SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasRepresentation()) + tgt.setRepresentationElement(convertString(src.getRepresentationElement())); + if (src.hasAttachment()) + tgt.setAttachment(convertAttachment(src.getAttachment())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceProtein.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceProtein.java index c6c2ef816..5d805529c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceProtein.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceProtein.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,91 +50,90 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SubstanceProtein extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SubstanceProtein convertSubstanceProtein(org.hl7.fhir.r4.model.SubstanceProtein src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceProtein tgt = new org.hl7.fhir.r5.model.SubstanceProtein(); - copyDomainResource(src, tgt); - if (src.hasSequenceType()) - tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); - if (src.hasNumberOfSubunits()) - tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); - for (org.hl7.fhir.r4.model.StringType t : src.getDisulfideLinkage()) - tgt.getDisulfideLinkage().add(convertString(t)); - for (org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent t : src.getSubunit()) - tgt.addSubunit(convertSubstanceProteinSubunitComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceProtein convertSubstanceProtein(org.hl7.fhir.r4.model.SubstanceProtein src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceProtein tgt = new org.hl7.fhir.r5.model.SubstanceProtein(); + copyDomainResource(src, tgt); + if (src.hasSequenceType()) + tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); + if (src.hasNumberOfSubunits()) + tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); + if (src.hasDisulfideLinkage()) { + for (org.hl7.fhir.r4.model.StringType t : src.getDisulfideLinkage()) tgt.getDisulfideLinkage().add(convertString(t)); + } + if (src.hasSubunit()) { + for (org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent t : src.getSubunit()) tgt.addSubunit(convertSubstanceProteinSubunitComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceProtein convertSubstanceProtein(org.hl7.fhir.r5.model.SubstanceProtein src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceProtein tgt = new org.hl7.fhir.r4.model.SubstanceProtein(); - copyDomainResource(src, tgt); - if (src.hasSequenceType()) - tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); - if (src.hasNumberOfSubunits()) - tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); - for (org.hl7.fhir.r5.model.StringType t : src.getDisulfideLinkage()) - tgt.getDisulfideLinkage().add(convertString(t)); - for (org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent t : src.getSubunit()) - tgt.addSubunit(convertSubstanceProteinSubunitComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent convertSubstanceProteinSubunitComponent(org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent tgt = new org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent(); - copyElement(src, tgt); - if (src.hasSubunit()) - tgt.setSubunitElement(convertInteger(src.getSubunitElement())); - if (src.hasSequence()) - tgt.setSequenceElement(convertString(src.getSequenceElement())); - if (src.hasLength()) - tgt.setLengthElement(convertInteger(src.getLengthElement())); - if (src.hasSequenceAttachment()) - tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); - if (src.hasNTerminalModificationId()) - tgt.setNTerminalModificationId(convertIdentifier(src.getNTerminalModificationId())); - if (src.hasNTerminalModification()) - tgt.setNTerminalModificationElement(convertString(src.getNTerminalModificationElement())); - if (src.hasCTerminalModificationId()) - tgt.setCTerminalModificationId(convertIdentifier(src.getCTerminalModificationId())); - if (src.hasCTerminalModification()) - tgt.setCTerminalModificationElement(convertString(src.getCTerminalModificationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent convertSubstanceProteinSubunitComponent(org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent tgt = new org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent(); - copyElement(src, tgt); - if (src.hasSubunit()) - tgt.setSubunitElement(convertInteger(src.getSubunitElement())); - if (src.hasSequence()) - tgt.setSequenceElement(convertString(src.getSequenceElement())); - if (src.hasLength()) - tgt.setLengthElement(convertInteger(src.getLengthElement())); - if (src.hasSequenceAttachment()) - tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); - if (src.hasNTerminalModificationId()) - tgt.setNTerminalModificationId(convertIdentifier(src.getNTerminalModificationId())); - if (src.hasNTerminalModification()) - tgt.setNTerminalModificationElement(convertString(src.getNTerminalModificationElement())); - if (src.hasCTerminalModificationId()) - tgt.setCTerminalModificationId(convertIdentifier(src.getCTerminalModificationId())); - if (src.hasCTerminalModification()) - tgt.setCTerminalModificationElement(convertString(src.getCTerminalModificationElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceProtein convertSubstanceProtein(org.hl7.fhir.r5.model.SubstanceProtein src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceProtein tgt = new org.hl7.fhir.r4.model.SubstanceProtein(); + copyDomainResource(src, tgt); + if (src.hasSequenceType()) + tgt.setSequenceType(convertCodeableConcept(src.getSequenceType())); + if (src.hasNumberOfSubunits()) + tgt.setNumberOfSubunitsElement(convertInteger(src.getNumberOfSubunitsElement())); + if (src.hasDisulfideLinkage()) { + for (org.hl7.fhir.r5.model.StringType t : src.getDisulfideLinkage()) tgt.getDisulfideLinkage().add(convertString(t)); + } + if (src.hasSubunit()) { + for (org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent t : src.getSubunit()) tgt.addSubunit(convertSubstanceProteinSubunitComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent convertSubstanceProteinSubunitComponent(org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent tgt = new org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent(); + copyElement(src, tgt); + if (src.hasSubunit()) + tgt.setSubunitElement(convertInteger(src.getSubunitElement())); + if (src.hasSequence()) + tgt.setSequenceElement(convertString(src.getSequenceElement())); + if (src.hasLength()) + tgt.setLengthElement(convertInteger(src.getLengthElement())); + if (src.hasSequenceAttachment()) + tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); + if (src.hasNTerminalModificationId()) + tgt.setNTerminalModificationId(convertIdentifier(src.getNTerminalModificationId())); + if (src.hasNTerminalModification()) + tgt.setNTerminalModificationElement(convertString(src.getNTerminalModificationElement())); + if (src.hasCTerminalModificationId()) + tgt.setCTerminalModificationId(convertIdentifier(src.getCTerminalModificationId())); + if (src.hasCTerminalModification()) + tgt.setCTerminalModificationElement(convertString(src.getCTerminalModificationElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent convertSubstanceProteinSubunitComponent(org.hl7.fhir.r5.model.SubstanceProtein.SubstanceProteinSubunitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent tgt = new org.hl7.fhir.r4.model.SubstanceProtein.SubstanceProteinSubunitComponent(); + copyElement(src, tgt); + if (src.hasSubunit()) + tgt.setSubunitElement(convertInteger(src.getSubunitElement())); + if (src.hasSequence()) + tgt.setSequenceElement(convertString(src.getSequenceElement())); + if (src.hasLength()) + tgt.setLengthElement(convertInteger(src.getLengthElement())); + if (src.hasSequenceAttachment()) + tgt.setSequenceAttachment(convertAttachment(src.getSequenceAttachment())); + if (src.hasNTerminalModificationId()) + tgt.setNTerminalModificationId(convertIdentifier(src.getNTerminalModificationId())); + if (src.hasNTerminalModification()) + tgt.setNTerminalModificationElement(convertString(src.getNTerminalModificationElement())); + if (src.hasCTerminalModificationId()) + tgt.setCTerminalModificationId(convertIdentifier(src.getCTerminalModificationId())); + if (src.hasCTerminalModification()) + tgt.setCTerminalModificationElement(convertString(src.getCTerminalModificationElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceReferenceInformation.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceReferenceInformation.java index ec49fe07f..38a62793e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceReferenceInformation.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceReferenceInformation.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,183 +50,196 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SubstanceReferenceInformation extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SubstanceReferenceInformation convertSubstanceReferenceInformation(org.hl7.fhir.r4.model.SubstanceReferenceInformation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceReferenceInformation tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation(); - copyDomainResource(src, tgt); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent t : src.getGene()) - tgt.addGene(convertSubstanceReferenceInformationGeneComponent(t)); - for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent t : src.getGeneElement()) - tgt.addGeneElement(convertSubstanceReferenceInformationGeneElementComponent(t)); - for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent t : src.getClassification()) - tgt.addClassification(convertSubstanceReferenceInformationClassificationComponent(t)); - for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent t : src.getTarget()) - tgt.addTarget(convertSubstanceReferenceInformationTargetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceReferenceInformation convertSubstanceReferenceInformation(org.hl7.fhir.r4.model.SubstanceReferenceInformation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceReferenceInformation tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation(); + copyDomainResource(src, tgt); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasGene()) { + for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent t : src.getGene()) tgt.addGene(convertSubstanceReferenceInformationGeneComponent(t)); + } + if (src.hasGeneElement()) { + for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent t : src.getGeneElement()) tgt.addGeneElement(convertSubstanceReferenceInformationGeneElementComponent(t)); + } + if (src.hasClassification()) { + for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent t : src.getClassification()) tgt.addClassification(convertSubstanceReferenceInformationClassificationComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent t : src.getTarget()) tgt.addTarget(convertSubstanceReferenceInformationTargetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceReferenceInformation convertSubstanceReferenceInformation(org.hl7.fhir.r5.model.SubstanceReferenceInformation src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceReferenceInformation tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation(); - copyDomainResource(src, tgt); - if (src.hasComment()) - tgt.setCommentElement(convertString(src.getCommentElement())); - for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent t : src.getGene()) - tgt.addGene(convertSubstanceReferenceInformationGeneComponent(t)); - for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent t : src.getGeneElement()) - tgt.addGeneElement(convertSubstanceReferenceInformationGeneElementComponent(t)); - for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent t : src.getClassification()) - tgt.addClassification(convertSubstanceReferenceInformationClassificationComponent(t)); - for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent t : src.getTarget()) - tgt.addTarget(convertSubstanceReferenceInformationTargetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceReferenceInformation convertSubstanceReferenceInformation(org.hl7.fhir.r5.model.SubstanceReferenceInformation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceReferenceInformation tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation(); + copyDomainResource(src, tgt); + if (src.hasComment()) + tgt.setCommentElement(convertString(src.getCommentElement())); + if (src.hasGene()) { + for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent t : src.getGene()) tgt.addGene(convertSubstanceReferenceInformationGeneComponent(t)); + } + if (src.hasGeneElement()) { + for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent t : src.getGeneElement()) tgt.addGeneElement(convertSubstanceReferenceInformationGeneElementComponent(t)); + } + if (src.hasClassification()) { + for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent t : src.getClassification()) tgt.addClassification(convertSubstanceReferenceInformationClassificationComponent(t)); + } + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent t : src.getTarget()) tgt.addTarget(convertSubstanceReferenceInformationTargetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent convertSubstanceReferenceInformationGeneComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent(); - copyElement(src, tgt); - if (src.hasGeneSequenceOrigin()) - tgt.setGeneSequenceOrigin(convertCodeableConcept(src.getGeneSequenceOrigin())); - if (src.hasGene()) - tgt.setGene(convertCodeableConcept(src.getGene())); - for (org.hl7.fhir.r4.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent convertSubstanceReferenceInformationGeneComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent(); + copyElement(src, tgt); + if (src.hasGeneSequenceOrigin()) + tgt.setGeneSequenceOrigin(convertCodeableConcept(src.getGeneSequenceOrigin())); + if (src.hasGene()) + tgt.setGene(convertCodeableConcept(src.getGene())); + if (src.hasSource()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent convertSubstanceReferenceInformationGeneComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent(); - copyElement(src, tgt); - if (src.hasGeneSequenceOrigin()) - tgt.setGeneSequenceOrigin(convertCodeableConcept(src.getGeneSequenceOrigin())); - if (src.hasGene()) - tgt.setGene(convertCodeableConcept(src.getGene())); - for (org.hl7.fhir.r5.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent convertSubstanceReferenceInformationGeneComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent(); + copyElement(src, tgt); + if (src.hasGeneSequenceOrigin()) + tgt.setGeneSequenceOrigin(convertCodeableConcept(src.getGeneSequenceOrigin())); + if (src.hasGene()) + tgt.setGene(convertCodeableConcept(src.getGene())); + if (src.hasSource()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent convertSubstanceReferenceInformationGeneElementComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasElement()) - tgt.setElement(convertIdentifier(src.getElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent convertSubstanceReferenceInformationGeneElementComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasElement()) + tgt.setElement(convertIdentifier(src.getElement())); + if (src.hasSource()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent convertSubstanceReferenceInformationGeneElementComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasElement()) - tgt.setElement(convertIdentifier(src.getElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent convertSubstanceReferenceInformationGeneElementComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasElement()) + tgt.setElement(convertIdentifier(src.getElement())); + if (src.hasSource()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent convertSubstanceReferenceInformationClassificationComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent(); - copyElement(src, tgt); - if (src.hasDomain()) - tgt.setDomain(convertCodeableConcept(src.getDomain())); - if (src.hasClassification()) - tgt.setClassification(convertCodeableConcept(src.getClassification())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubtype()) - tgt.addSubtype(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent convertSubstanceReferenceInformationClassificationComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent(); + copyElement(src, tgt); + if (src.hasDomain()) + tgt.setDomain(convertCodeableConcept(src.getDomain())); + if (src.hasClassification()) + tgt.setClassification(convertCodeableConcept(src.getClassification())); + if (src.hasSubtype()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubtype()) tgt.addSubtype(convertCodeableConcept(t)); + } + if (src.hasSource()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent convertSubstanceReferenceInformationClassificationComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent(); - copyElement(src, tgt); - if (src.hasDomain()) - tgt.setDomain(convertCodeableConcept(src.getDomain())); - if (src.hasClassification()) - tgt.setClassification(convertCodeableConcept(src.getClassification())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubtype()) - tgt.addSubtype(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent convertSubstanceReferenceInformationTargetComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent(); - copyElement(src, tgt); - if (src.hasTarget()) - tgt.setTarget(convertIdentifier(src.getTarget())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasInteraction()) - tgt.setInteraction(convertCodeableConcept(src.getInteraction())); - if (src.hasOrganism()) - tgt.setOrganism(convertCodeableConcept(src.getOrganism())); - if (src.hasOrganismType()) - tgt.setOrganismType(convertCodeableConcept(src.getOrganismType())); - if (src.hasAmount()) - tgt.setAmount(convertType(src.getAmount())); - if (src.hasAmountType()) - tgt.setAmountType(convertCodeableConcept(src.getAmountType())); - for (org.hl7.fhir.r4.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent convertSubstanceReferenceInformationTargetComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent(); - copyElement(src, tgt); - if (src.hasTarget()) - tgt.setTarget(convertIdentifier(src.getTarget())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasInteraction()) - tgt.setInteraction(convertCodeableConcept(src.getInteraction())); - if (src.hasOrganism()) - tgt.setOrganism(convertCodeableConcept(src.getOrganism())); - if (src.hasOrganismType()) - tgt.setOrganismType(convertCodeableConcept(src.getOrganismType())); - if (src.hasAmount()) - tgt.setAmount(convertType(src.getAmount())); - if (src.hasAmountType()) - tgt.setAmountType(convertCodeableConcept(src.getAmountType())); - for (org.hl7.fhir.r5.model.Reference t : src.getSource()) - tgt.addSource(convertReference(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent convertSubstanceReferenceInformationClassificationComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent(); + copyElement(src, tgt); + if (src.hasDomain()) + tgt.setDomain(convertCodeableConcept(src.getDomain())); + if (src.hasClassification()) + tgt.setClassification(convertCodeableConcept(src.getClassification())); + if (src.hasSubtype()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubtype()) tgt.addSubtype(convertCodeableConcept(t)); + } + if (src.hasSource()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent convertSubstanceReferenceInformationTargetComponent(org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent tgt = new org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent(); + copyElement(src, tgt); + if (src.hasTarget()) + tgt.setTarget(convertIdentifier(src.getTarget())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasInteraction()) + tgt.setInteraction(convertCodeableConcept(src.getInteraction())); + if (src.hasOrganism()) + tgt.setOrganism(convertCodeableConcept(src.getOrganism())); + if (src.hasOrganismType()) + tgt.setOrganismType(convertCodeableConcept(src.getOrganismType())); + if (src.hasAmount()) + tgt.setAmount(convertType(src.getAmount())); + if (src.hasAmountType()) + tgt.setAmountType(convertCodeableConcept(src.getAmountType())); + if (src.hasSource()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent convertSubstanceReferenceInformationTargetComponent(org.hl7.fhir.r5.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent tgt = new org.hl7.fhir.r4.model.SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent(); + copyElement(src, tgt); + if (src.hasTarget()) + tgt.setTarget(convertIdentifier(src.getTarget())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasInteraction()) + tgt.setInteraction(convertCodeableConcept(src.getInteraction())); + if (src.hasOrganism()) + tgt.setOrganism(convertCodeableConcept(src.getOrganism())); + if (src.hasOrganismType()) + tgt.setOrganismType(convertCodeableConcept(src.getOrganismType())); + if (src.hasAmount()) + tgt.setAmount(convertType(src.getAmount())); + if (src.hasAmountType()) + tgt.setAmountType(convertCodeableConcept(src.getAmountType())); + if (src.hasSource()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSource()) tgt.addSource(convertReference(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceSourceMaterial.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceSourceMaterial.java index 23c46137a..0bb3521aa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceSourceMaterial.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SubstanceSourceMaterial.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,267 +50,276 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SubstanceSourceMaterial extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SubstanceSourceMaterial convertSubstanceSourceMaterial(org.hl7.fhir.r4.model.SubstanceSourceMaterial src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceSourceMaterial tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial(); - copyDomainResource(src, tgt); - if (src.hasSourceMaterialClass()) - tgt.setSourceMaterialClass(convertCodeableConcept(src.getSourceMaterialClass())); - if (src.hasSourceMaterialType()) - tgt.setSourceMaterialType(convertCodeableConcept(src.getSourceMaterialType())); - if (src.hasSourceMaterialState()) - tgt.setSourceMaterialState(convertCodeableConcept(src.getSourceMaterialState())); - if (src.hasOrganismId()) - tgt.setOrganismId(convertIdentifier(src.getOrganismId())); - if (src.hasOrganismName()) - tgt.setOrganismNameElement(convertString(src.getOrganismNameElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getParentSubstanceId()) - tgt.addParentSubstanceId(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getParentSubstanceName()) - tgt.getParentSubstanceName().add(convertString(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCountryOfOrigin()) - tgt.addCountryOfOrigin(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getGeographicalLocation()) - tgt.getGeographicalLocation().add(convertString(t)); - if (src.hasDevelopmentStage()) - tgt.setDevelopmentStage(convertCodeableConcept(src.getDevelopmentStage())); - for (org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent t : src.getFractionDescription()) - tgt.addFractionDescription(convertSubstanceSourceMaterialFractionDescriptionComponent(t)); - if (src.hasOrganism()) - tgt.setOrganism(convertSubstanceSourceMaterialOrganismComponent(src.getOrganism())); - for (org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent t : src.getPartDescription()) - tgt.addPartDescription(convertSubstanceSourceMaterialPartDescriptionComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceSourceMaterial convertSubstanceSourceMaterial(org.hl7.fhir.r4.model.SubstanceSourceMaterial src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceSourceMaterial tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial(); + copyDomainResource(src, tgt); + if (src.hasSourceMaterialClass()) + tgt.setSourceMaterialClass(convertCodeableConcept(src.getSourceMaterialClass())); + if (src.hasSourceMaterialType()) + tgt.setSourceMaterialType(convertCodeableConcept(src.getSourceMaterialType())); + if (src.hasSourceMaterialState()) + tgt.setSourceMaterialState(convertCodeableConcept(src.getSourceMaterialState())); + if (src.hasOrganismId()) + tgt.setOrganismId(convertIdentifier(src.getOrganismId())); + if (src.hasOrganismName()) + tgt.setOrganismNameElement(convertString(src.getOrganismNameElement())); + if (src.hasParentSubstanceId()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getParentSubstanceId()) tgt.addParentSubstanceId(convertIdentifier(t)); + } + if (src.hasParentSubstanceName()) { + for (org.hl7.fhir.r4.model.StringType t : src.getParentSubstanceName()) tgt.getParentSubstanceName().add(convertString(t)); + } + if (src.hasCountryOfOrigin()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCountryOfOrigin()) tgt.addCountryOfOrigin(convertCodeableConcept(t)); + } + if (src.hasGeographicalLocation()) { + for (org.hl7.fhir.r4.model.StringType t : src.getGeographicalLocation()) tgt.getGeographicalLocation().add(convertString(t)); + } + if (src.hasDevelopmentStage()) + tgt.setDevelopmentStage(convertCodeableConcept(src.getDevelopmentStage())); + if (src.hasFractionDescription()) { + for (org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent t : src.getFractionDescription()) tgt.addFractionDescription(convertSubstanceSourceMaterialFractionDescriptionComponent(t)); + } + if (src.hasOrganism()) + tgt.setOrganism(convertSubstanceSourceMaterialOrganismComponent(src.getOrganism())); + if (src.hasPartDescription()) { + for (org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent t : src.getPartDescription()) tgt.addPartDescription(convertSubstanceSourceMaterialPartDescriptionComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceSourceMaterial convertSubstanceSourceMaterial(org.hl7.fhir.r5.model.SubstanceSourceMaterial src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceSourceMaterial tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial(); - copyDomainResource(src, tgt); - if (src.hasSourceMaterialClass()) - tgt.setSourceMaterialClass(convertCodeableConcept(src.getSourceMaterialClass())); - if (src.hasSourceMaterialType()) - tgt.setSourceMaterialType(convertCodeableConcept(src.getSourceMaterialType())); - if (src.hasSourceMaterialState()) - tgt.setSourceMaterialState(convertCodeableConcept(src.getSourceMaterialState())); - if (src.hasOrganismId()) - tgt.setOrganismId(convertIdentifier(src.getOrganismId())); - if (src.hasOrganismName()) - tgt.setOrganismNameElement(convertString(src.getOrganismNameElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getParentSubstanceId()) - tgt.addParentSubstanceId(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getParentSubstanceName()) - tgt.getParentSubstanceName().add(convertString(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCountryOfOrigin()) - tgt.addCountryOfOrigin(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getGeographicalLocation()) - tgt.getGeographicalLocation().add(convertString(t)); - if (src.hasDevelopmentStage()) - tgt.setDevelopmentStage(convertCodeableConcept(src.getDevelopmentStage())); - for (org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent t : src.getFractionDescription()) - tgt.addFractionDescription(convertSubstanceSourceMaterialFractionDescriptionComponent(t)); - if (src.hasOrganism()) - tgt.setOrganism(convertSubstanceSourceMaterialOrganismComponent(src.getOrganism())); - for (org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent t : src.getPartDescription()) - tgt.addPartDescription(convertSubstanceSourceMaterialPartDescriptionComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceSourceMaterial convertSubstanceSourceMaterial(org.hl7.fhir.r5.model.SubstanceSourceMaterial src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceSourceMaterial tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial(); + copyDomainResource(src, tgt); + if (src.hasSourceMaterialClass()) + tgt.setSourceMaterialClass(convertCodeableConcept(src.getSourceMaterialClass())); + if (src.hasSourceMaterialType()) + tgt.setSourceMaterialType(convertCodeableConcept(src.getSourceMaterialType())); + if (src.hasSourceMaterialState()) + tgt.setSourceMaterialState(convertCodeableConcept(src.getSourceMaterialState())); + if (src.hasOrganismId()) + tgt.setOrganismId(convertIdentifier(src.getOrganismId())); + if (src.hasOrganismName()) + tgt.setOrganismNameElement(convertString(src.getOrganismNameElement())); + if (src.hasParentSubstanceId()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getParentSubstanceId()) tgt.addParentSubstanceId(convertIdentifier(t)); + } + if (src.hasParentSubstanceName()) { + for (org.hl7.fhir.r5.model.StringType t : src.getParentSubstanceName()) tgt.getParentSubstanceName().add(convertString(t)); + } + if (src.hasCountryOfOrigin()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCountryOfOrigin()) tgt.addCountryOfOrigin(convertCodeableConcept(t)); + } + if (src.hasGeographicalLocation()) { + for (org.hl7.fhir.r5.model.StringType t : src.getGeographicalLocation()) tgt.getGeographicalLocation().add(convertString(t)); + } + if (src.hasDevelopmentStage()) + tgt.setDevelopmentStage(convertCodeableConcept(src.getDevelopmentStage())); + if (src.hasFractionDescription()) { + for (org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent t : src.getFractionDescription()) tgt.addFractionDescription(convertSubstanceSourceMaterialFractionDescriptionComponent(t)); + } + if (src.hasOrganism()) + tgt.setOrganism(convertSubstanceSourceMaterialOrganismComponent(src.getOrganism())); + if (src.hasPartDescription()) { + for (org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent t : src.getPartDescription()) tgt.addPartDescription(convertSubstanceSourceMaterialPartDescriptionComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent convertSubstanceSourceMaterialFractionDescriptionComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent(); - copyElement(src, tgt); - if (src.hasFraction()) - tgt.setFractionElement(convertString(src.getFractionElement())); - if (src.hasMaterialType()) - tgt.setMaterialType(convertCodeableConcept(src.getMaterialType())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent convertSubstanceSourceMaterialFractionDescriptionComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent(); + copyElement(src, tgt); + if (src.hasFraction()) + tgt.setFractionElement(convertString(src.getFractionElement())); + if (src.hasMaterialType()) + tgt.setMaterialType(convertCodeableConcept(src.getMaterialType())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent convertSubstanceSourceMaterialFractionDescriptionComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent(); - copyElement(src, tgt); - if (src.hasFraction()) - tgt.setFractionElement(convertString(src.getFractionElement())); - if (src.hasMaterialType()) - tgt.setMaterialType(convertCodeableConcept(src.getMaterialType())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent convertSubstanceSourceMaterialFractionDescriptionComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent(); + copyElement(src, tgt); + if (src.hasFraction()) + tgt.setFractionElement(convertString(src.getFractionElement())); + if (src.hasMaterialType()) + tgt.setMaterialType(convertCodeableConcept(src.getMaterialType())); + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent convertSubstanceSourceMaterialOrganismComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent(); - copyElement(src, tgt); - if (src.hasFamily()) - tgt.setFamily(convertCodeableConcept(src.getFamily())); - if (src.hasGenus()) - tgt.setGenus(convertCodeableConcept(src.getGenus())); - if (src.hasSpecies()) - tgt.setSpecies(convertCodeableConcept(src.getSpecies())); - if (src.hasIntraspecificType()) - tgt.setIntraspecificType(convertCodeableConcept(src.getIntraspecificType())); - if (src.hasIntraspecificDescription()) - tgt.setIntraspecificDescriptionElement(convertString(src.getIntraspecificDescriptionElement())); - for (org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent t : src.getAuthor()) - tgt.addAuthor(convertSubstanceSourceMaterialOrganismAuthorComponent(t)); - if (src.hasHybrid()) - tgt.setHybrid(convertSubstanceSourceMaterialOrganismHybridComponent(src.getHybrid())); - if (src.hasOrganismGeneral()) - tgt.setOrganismGeneral(convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(src.getOrganismGeneral())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent convertSubstanceSourceMaterialOrganismComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent(); + copyElement(src, tgt); + if (src.hasFamily()) + tgt.setFamily(convertCodeableConcept(src.getFamily())); + if (src.hasGenus()) + tgt.setGenus(convertCodeableConcept(src.getGenus())); + if (src.hasSpecies()) + tgt.setSpecies(convertCodeableConcept(src.getSpecies())); + if (src.hasIntraspecificType()) + tgt.setIntraspecificType(convertCodeableConcept(src.getIntraspecificType())); + if (src.hasIntraspecificDescription()) + tgt.setIntraspecificDescriptionElement(convertString(src.getIntraspecificDescriptionElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent t : src.getAuthor()) tgt.addAuthor(convertSubstanceSourceMaterialOrganismAuthorComponent(t)); + } + if (src.hasHybrid()) + tgt.setHybrid(convertSubstanceSourceMaterialOrganismHybridComponent(src.getHybrid())); + if (src.hasOrganismGeneral()) + tgt.setOrganismGeneral(convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(src.getOrganismGeneral())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent convertSubstanceSourceMaterialOrganismComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent(); - copyElement(src, tgt); - if (src.hasFamily()) - tgt.setFamily(convertCodeableConcept(src.getFamily())); - if (src.hasGenus()) - tgt.setGenus(convertCodeableConcept(src.getGenus())); - if (src.hasSpecies()) - tgt.setSpecies(convertCodeableConcept(src.getSpecies())); - if (src.hasIntraspecificType()) - tgt.setIntraspecificType(convertCodeableConcept(src.getIntraspecificType())); - if (src.hasIntraspecificDescription()) - tgt.setIntraspecificDescriptionElement(convertString(src.getIntraspecificDescriptionElement())); - for (org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent t : src.getAuthor()) - tgt.addAuthor(convertSubstanceSourceMaterialOrganismAuthorComponent(t)); - if (src.hasHybrid()) - tgt.setHybrid(convertSubstanceSourceMaterialOrganismHybridComponent(src.getHybrid())); - if (src.hasOrganismGeneral()) - tgt.setOrganismGeneral(convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(src.getOrganismGeneral())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent convertSubstanceSourceMaterialOrganismComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent(); + copyElement(src, tgt); + if (src.hasFamily()) + tgt.setFamily(convertCodeableConcept(src.getFamily())); + if (src.hasGenus()) + tgt.setGenus(convertCodeableConcept(src.getGenus())); + if (src.hasSpecies()) + tgt.setSpecies(convertCodeableConcept(src.getSpecies())); + if (src.hasIntraspecificType()) + tgt.setIntraspecificType(convertCodeableConcept(src.getIntraspecificType())); + if (src.hasIntraspecificDescription()) + tgt.setIntraspecificDescriptionElement(convertString(src.getIntraspecificDescriptionElement())); + if (src.hasAuthor()) { + for (org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent t : src.getAuthor()) tgt.addAuthor(convertSubstanceSourceMaterialOrganismAuthorComponent(t)); + } + if (src.hasHybrid()) + tgt.setHybrid(convertSubstanceSourceMaterialOrganismHybridComponent(src.getHybrid())); + if (src.hasOrganismGeneral()) + tgt.setOrganismGeneral(convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(src.getOrganismGeneral())); + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent convertSubstanceSourceMaterialOrganismAuthorComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent(); - copyElement(src, tgt); - if (src.hasAuthorType()) - tgt.setAuthorType(convertCodeableConcept(src.getAuthorType())); - if (src.hasAuthorDescription()) - tgt.setAuthorDescriptionElement(convertString(src.getAuthorDescriptionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent convertSubstanceSourceMaterialOrganismAuthorComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent(); + copyElement(src, tgt); + if (src.hasAuthorType()) + tgt.setAuthorType(convertCodeableConcept(src.getAuthorType())); + if (src.hasAuthorDescription()) + tgt.setAuthorDescriptionElement(convertString(src.getAuthorDescriptionElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent convertSubstanceSourceMaterialOrganismAuthorComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent(); - copyElement(src, tgt); - if (src.hasAuthorType()) - tgt.setAuthorType(convertCodeableConcept(src.getAuthorType())); - if (src.hasAuthorDescription()) - tgt.setAuthorDescriptionElement(convertString(src.getAuthorDescriptionElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent convertSubstanceSourceMaterialOrganismAuthorComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent(); + copyElement(src, tgt); + if (src.hasAuthorType()) + tgt.setAuthorType(convertCodeableConcept(src.getAuthorType())); + if (src.hasAuthorDescription()) + tgt.setAuthorDescriptionElement(convertString(src.getAuthorDescriptionElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent convertSubstanceSourceMaterialOrganismHybridComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent(); - copyElement(src, tgt); - if (src.hasMaternalOrganismId()) - tgt.setMaternalOrganismIdElement(convertString(src.getMaternalOrganismIdElement())); - if (src.hasMaternalOrganismName()) - tgt.setMaternalOrganismNameElement(convertString(src.getMaternalOrganismNameElement())); - if (src.hasPaternalOrganismId()) - tgt.setPaternalOrganismIdElement(convertString(src.getPaternalOrganismIdElement())); - if (src.hasPaternalOrganismName()) - tgt.setPaternalOrganismNameElement(convertString(src.getPaternalOrganismNameElement())); - if (src.hasHybridType()) - tgt.setHybridType(convertCodeableConcept(src.getHybridType())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent convertSubstanceSourceMaterialOrganismHybridComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent(); + copyElement(src, tgt); + if (src.hasMaternalOrganismId()) + tgt.setMaternalOrganismIdElement(convertString(src.getMaternalOrganismIdElement())); + if (src.hasMaternalOrganismName()) + tgt.setMaternalOrganismNameElement(convertString(src.getMaternalOrganismNameElement())); + if (src.hasPaternalOrganismId()) + tgt.setPaternalOrganismIdElement(convertString(src.getPaternalOrganismIdElement())); + if (src.hasPaternalOrganismName()) + tgt.setPaternalOrganismNameElement(convertString(src.getPaternalOrganismNameElement())); + if (src.hasHybridType()) + tgt.setHybridType(convertCodeableConcept(src.getHybridType())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent convertSubstanceSourceMaterialOrganismHybridComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent(); - copyElement(src, tgt); - if (src.hasMaternalOrganismId()) - tgt.setMaternalOrganismIdElement(convertString(src.getMaternalOrganismIdElement())); - if (src.hasMaternalOrganismName()) - tgt.setMaternalOrganismNameElement(convertString(src.getMaternalOrganismNameElement())); - if (src.hasPaternalOrganismId()) - tgt.setPaternalOrganismIdElement(convertString(src.getPaternalOrganismIdElement())); - if (src.hasPaternalOrganismName()) - tgt.setPaternalOrganismNameElement(convertString(src.getPaternalOrganismNameElement())); - if (src.hasHybridType()) - tgt.setHybridType(convertCodeableConcept(src.getHybridType())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent convertSubstanceSourceMaterialOrganismHybridComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent(); + copyElement(src, tgt); + if (src.hasMaternalOrganismId()) + tgt.setMaternalOrganismIdElement(convertString(src.getMaternalOrganismIdElement())); + if (src.hasMaternalOrganismName()) + tgt.setMaternalOrganismNameElement(convertString(src.getMaternalOrganismNameElement())); + if (src.hasPaternalOrganismId()) + tgt.setPaternalOrganismIdElement(convertString(src.getPaternalOrganismIdElement())); + if (src.hasPaternalOrganismName()) + tgt.setPaternalOrganismNameElement(convertString(src.getPaternalOrganismNameElement())); + if (src.hasHybridType()) + tgt.setHybridType(convertCodeableConcept(src.getHybridType())); + return tgt; + } - public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent(); - copyElement(src, tgt); - if (src.hasKingdom()) - tgt.setKingdom(convertCodeableConcept(src.getKingdom())); - if (src.hasPhylum()) - tgt.setPhylum(convertCodeableConcept(src.getPhylum())); - if (src.hasClass_()) - tgt.setClass_(convertCodeableConcept(src.getClass_())); - if (src.hasOrder()) - tgt.setOrder(convertCodeableConcept(src.getOrder())); - return tgt; - } + public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent(); + copyElement(src, tgt); + if (src.hasKingdom()) + tgt.setKingdom(convertCodeableConcept(src.getKingdom())); + if (src.hasPhylum()) + tgt.setPhylum(convertCodeableConcept(src.getPhylum())); + if (src.hasClass_()) + tgt.setClass_(convertCodeableConcept(src.getClass_())); + if (src.hasOrder()) + tgt.setOrder(convertCodeableConcept(src.getOrder())); + return tgt; + } - public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent(); - copyElement(src, tgt); - if (src.hasKingdom()) - tgt.setKingdom(convertCodeableConcept(src.getKingdom())); - if (src.hasPhylum()) - tgt.setPhylum(convertCodeableConcept(src.getPhylum())); - if (src.hasClass_()) - tgt.setClass_(convertCodeableConcept(src.getClass_())); - if (src.hasOrder()) - tgt.setOrder(convertCodeableConcept(src.getOrder())); - return tgt; - } - - public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent convertSubstanceSourceMaterialPartDescriptionComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent(); - copyElement(src, tgt); - if (src.hasPart()) - tgt.setPart(convertCodeableConcept(src.getPart())); - if (src.hasPartLocation()) - tgt.setPartLocation(convertCodeableConcept(src.getPartLocation())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent convertSubstanceSourceMaterialPartDescriptionComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent(); - copyElement(src, tgt); - if (src.hasPart()) - tgt.setPart(convertCodeableConcept(src.getPart())); - if (src.hasPartLocation()) - tgt.setPartLocation(convertCodeableConcept(src.getPartLocation())); - return tgt; - } + public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent convertSubstanceSourceMaterialOrganismOrganismGeneralComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent(); + copyElement(src, tgt); + if (src.hasKingdom()) + tgt.setKingdom(convertCodeableConcept(src.getKingdom())); + if (src.hasPhylum()) + tgt.setPhylum(convertCodeableConcept(src.getPhylum())); + if (src.hasClass_()) + tgt.setClass_(convertCodeableConcept(src.getClass_())); + if (src.hasOrder()) + tgt.setOrder(convertCodeableConcept(src.getOrder())); + return tgt; + } + public static org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent convertSubstanceSourceMaterialPartDescriptionComponent(org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent tgt = new org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent(); + copyElement(src, tgt); + if (src.hasPart()) + tgt.setPart(convertCodeableConcept(src.getPart())); + if (src.hasPartLocation()) + tgt.setPartLocation(convertCodeableConcept(src.getPartLocation())); + return tgt; + } + public static org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent convertSubstanceSourceMaterialPartDescriptionComponent(org.hl7.fhir.r5.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent tgt = new org.hl7.fhir.r4.model.SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent(); + copyElement(src, tgt); + if (src.hasPart()) + tgt.setPart(convertCodeableConcept(src.getPart())); + if (src.hasPartLocation()) + tgt.setPartLocation(convertCodeableConcept(src.getPartLocation())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyDelivery.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyDelivery.java index 45abaa089..26e7eb932 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyDelivery.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyDelivery.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,119 +50,132 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SupplyDelivery extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.r4.model.SupplyDelivery src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SupplyDelivery tgt = new org.hl7.fhir.r5.model.SupplyDelivery(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSuppliedItem()) - tgt.setSuppliedItem(convertSupplyDeliverySuppliedItemComponent(src.getSuppliedItem())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasSupplier()) - tgt.setSupplier(convertReference(src.getSupplier())); - if (src.hasDestination()) - tgt.setDestination(convertReference(src.getDestination())); - for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) - tgt.addReceiver(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.r5.model.SupplyDelivery src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SupplyDelivery tgt = new org.hl7.fhir.r4.model.SupplyDelivery(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasSuppliedItem()) - tgt.setSuppliedItem(convertSupplyDeliverySuppliedItemComponent(src.getSuppliedItem())); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasSupplier()) - tgt.setSupplier(convertReference(src.getSupplier())); - if (src.hasDestination()) - tgt.setDestination(convertReference(src.getDestination())); - for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) - tgt.addReceiver(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus convertSupplyDeliveryStatus(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INPROGRESS: return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS; - case COMPLETED: return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED; - case ABANDONED: return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus convertSupplyDeliveryStatus(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INPROGRESS: return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS; - case COMPLETED: return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED; - case ABANDONED: return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent tgt = new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent tgt = new org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent(); - copyElement(src, tgt); - if (src.hasQuantity()) - tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - return tgt; - } + public static org.hl7.fhir.r5.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.r4.model.SupplyDelivery src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyDelivery tgt = new org.hl7.fhir.r5.model.SupplyDelivery(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSuppliedItem()) + tgt.setSuppliedItem(convertSupplyDeliverySuppliedItemComponent(src.getSuppliedItem())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasSupplier()) + tgt.setSupplier(convertReference(src.getSupplier())); + if (src.hasDestination()) + tgt.setDestination(convertReference(src.getDestination())); + if (src.hasReceiver()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.r5.model.SupplyDelivery src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SupplyDelivery tgt = new org.hl7.fhir.r4.model.SupplyDelivery(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasSuppliedItem()) + tgt.setSuppliedItem(convertSupplyDeliverySuppliedItemComponent(src.getSuppliedItem())); + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasSupplier()) + tgt.setSupplier(convertReference(src.getSupplier())); + if (src.hasDestination()) + tgt.setDestination(convertReference(src.getDestination())); + if (src.hasReceiver()) { + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus convertSupplyDeliveryStatus(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INPROGRESS: + return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS; + case COMPLETED: + return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED; + case ABANDONED: + return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus convertSupplyDeliveryStatus(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INPROGRESS: + return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS; + case COMPLETED: + return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED; + case ABANDONED: + return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent tgt = new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + return tgt; + } + + public static org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent tgt = new org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent(); + copyElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyRequest.java index daff6282b..39eb0f01e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SupplyRequest.java @@ -19,13 +19,10 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,167 +51,194 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class SupplyRequest extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.SupplyRequest convertSupplyRequest(org.hl7.fhir.r4.model.SupplyRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SupplyRequest tgt = new org.hl7.fhir.r5.model.SupplyRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertSupplyRequestStatus(src.getStatus())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - for (org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent t : src.getParameter()) - tgt.addParameter(convertSupplyRequestParameterComponent(t)); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - for (org.hl7.fhir.r4.model.Reference t : src.getSupplier()) - tgt.addSupplier(convertReference(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) - tgt.addReason(convertCodeableConceptToCodeableReference(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) - tgt.addReason(convertReferenceToCodeableReference(t)); - if (src.hasDeliverFrom()) - tgt.setDeliverFrom(convertReference(src.getDeliverFrom())); - if (src.hasDeliverTo()) - tgt.setDeliverTo(convertReference(src.getDeliverTo())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SupplyRequest convertSupplyRequest(org.hl7.fhir.r5.model.SupplyRequest src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SupplyRequest tgt = new org.hl7.fhir.r4.model.SupplyRequest(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertSupplyRequestStatus(src.getStatus())); - if (src.hasCategory()) - tgt.setCategory(convertCodeableConcept(src.getCategory())); - if (src.hasPriority()) - tgt.setPriority(convertRequestPriority(src.getPriority())); - if (src.hasItem()) - tgt.setItem(convertType(src.getItem())); - if (src.hasQuantity()) - tgt.setQuantity(convertQuantity(src.getQuantity())); - for (org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent t : src.getParameter()) - tgt.addParameter(convertSupplyRequestParameterComponent(t)); - if (src.hasOccurrence()) - tgt.setOccurrence(convertType(src.getOccurrence())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - for (org.hl7.fhir.r5.model.Reference t : src.getSupplier()) - tgt.addSupplier(convertReference(t)); - for (CodeableReference t : src.getReason()) - if (t.hasConcept()) - tgt.addReasonCode(convertCodeableConcept(t.getConcept())); - for (CodeableReference t : src.getReason()) - if (t.hasReference()) - tgt.addReasonReference(convertReference(t.getReference())); - if (src.hasDeliverFrom()) - tgt.setDeliverFrom(convertReference(src.getDeliverFrom())); - if (src.hasDeliverTo()) - tgt.setDeliverTo(convertReference(src.getDeliverTo())); - return tgt; - } - - public static org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus convertSupplyRequestStatus(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.SUSPENDED; - case CANCELLED: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.CANCELLED; - case COMPLETED: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.UNKNOWN; - default: return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus convertSupplyRequestStatus(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.DRAFT; - case ACTIVE: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ACTIVE; - case SUSPENDED: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.SUSPENDED; - case CANCELLED: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.CANCELLED; - case COMPLETED: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR; - case UNKNOWN: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.UNKNOWN; - default: return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.SupplyRequest.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.STAT; - default: return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent tgt = new org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent tgt = new org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r5.model.SupplyRequest convertSupplyRequest(org.hl7.fhir.r4.model.SupplyRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyRequest tgt = new org.hl7.fhir.r5.model.SupplyRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertSupplyRequestStatus(src.getStatus())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent t : src.getParameter()) tgt.addParameter(convertSupplyRequestParameterComponent(t)); + } + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasSupplier()) { + for (org.hl7.fhir.r4.model.Reference t : src.getSupplier()) tgt.addSupplier(convertReference(t)); + } + if (src.hasReasonCode()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(convertCodeableConceptToCodeableReference(t)); + } + if (src.hasReasonReference()) { + for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) tgt.addReason(convertReferenceToCodeableReference(t)); + } + if (src.hasDeliverFrom()) + tgt.setDeliverFrom(convertReference(src.getDeliverFrom())); + if (src.hasDeliverTo()) + tgt.setDeliverTo(convertReference(src.getDeliverTo())); + return tgt; + } + public static org.hl7.fhir.r4.model.SupplyRequest convertSupplyRequest(org.hl7.fhir.r5.model.SupplyRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SupplyRequest tgt = new org.hl7.fhir.r4.model.SupplyRequest(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertSupplyRequestStatus(src.getStatus())); + if (src.hasCategory()) + tgt.setCategory(convertCodeableConcept(src.getCategory())); + if (src.hasPriority()) + tgt.setPriority(convertRequestPriority(src.getPriority())); + if (src.hasItem()) + tgt.setItem(convertType(src.getItem())); + if (src.hasQuantity()) + tgt.setQuantity(convertQuantity(src.getQuantity())); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent t : src.getParameter()) tgt.addParameter(convertSupplyRequestParameterComponent(t)); + } + if (src.hasOccurrence()) + tgt.setOccurrence(convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasSupplier()) { + for (org.hl7.fhir.r5.model.Reference t : src.getSupplier()) tgt.addSupplier(convertReference(t)); + } + for (CodeableReference t : src.getReason()) if (t.hasConcept()) + tgt.addReasonCode(convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) if (t.hasReference()) + tgt.addReasonReference(convertReference(t.getReference())); + if (src.hasDeliverFrom()) + tgt.setDeliverFrom(convertReference(src.getDeliverFrom())); + if (src.hasDeliverTo()) + tgt.setDeliverTo(convertReference(src.getDeliverTo())); + return tgt; + } + public static org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus convertSupplyRequestStatus(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.SUSPENDED; + case CANCELLED: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.CANCELLED; + case COMPLETED: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus convertSupplyRequestStatus(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.DRAFT; + case ACTIVE: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ACTIVE; + case SUSPENDED: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.SUSPENDED; + case CANCELLED: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.CANCELLED; + case COMPLETED: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR; + case UNKNOWN: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.UNKNOWN; + default: + return org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.SupplyRequest.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.STAT; + default: + return org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent tgt = new org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent tgt = new org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Task.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Task.java index a8d1be621..4cc12c0d0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Task.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Task.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,325 +50,396 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class Task extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.Task convertTask(org.hl7.fhir.r4.model.Task src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Task tgt = new org.hl7.fhir.r5.model.Task(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasInstantiatesCanonical()) - tgt.setInstantiatesCanonicalElement(convertCanonical(src.getInstantiatesCanonicalElement())); - if (src.hasInstantiatesUri()) - tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); - for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertTaskStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasBusinessStatus()) - tgt.setBusinessStatus(convertCodeableConcept(src.getBusinessStatus())); - if (src.hasIntent()) - tgt.setIntent(convertTaskIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertTaskPriority(src.getPriority())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasFocus()) - tgt.setFocus(convertReference(src.getFocus())); - if (src.hasFor()) - tgt.setFor(convertReference(src.getFor())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasExecutionPeriod()) - tgt.setExecutionPeriod(convertPeriod(src.getExecutionPeriod())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasLastModified()) - tgt.setLastModifiedElement(convertDateTime(src.getLastModifiedElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPerformerType()) - tgt.addPerformerType(convertCodeableConcept(t)); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasReasonCode()) - tgt.setReasonCode(convertCodeableConcept(src.getReasonCode())); - if (src.hasReasonReference()) - tgt.setReasonReference(convertReference(src.getReasonReference())); - for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - if (src.hasRestriction()) - tgt.setRestriction(convertTaskRestrictionComponent(src.getRestriction())); - for (org.hl7.fhir.r4.model.Task.ParameterComponent t : src.getInput()) - tgt.addInput(convertParameterComponent(t)); - for (org.hl7.fhir.r4.model.Task.TaskOutputComponent t : src.getOutput()) - tgt.addOutput(convertTaskOutputComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Task convertTask(org.hl7.fhir.r5.model.Task src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Task tgt = new org.hl7.fhir.r4.model.Task(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasInstantiatesCanonical()) - tgt.setInstantiatesCanonicalElement(convertCanonical(src.getInstantiatesCanonicalElement())); - if (src.hasInstantiatesUri()) - tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); - for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) - tgt.addBasedOn(convertReference(t)); - if (src.hasGroupIdentifier()) - tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); - for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) - tgt.addPartOf(convertReference(t)); - if (src.hasStatus()) - tgt.setStatus(convertTaskStatus(src.getStatus())); - if (src.hasStatusReason()) - tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); - if (src.hasBusinessStatus()) - tgt.setBusinessStatus(convertCodeableConcept(src.getBusinessStatus())); - if (src.hasIntent()) - tgt.setIntent(convertTaskIntent(src.getIntent())); - if (src.hasPriority()) - tgt.setPriority(convertTaskPriority(src.getPriority())); - if (src.hasCode()) - tgt.setCode(convertCodeableConcept(src.getCode())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasFocus()) - tgt.setFocus(convertReference(src.getFocus())); - if (src.hasFor()) - tgt.setFor(convertReference(src.getFor())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasExecutionPeriod()) - tgt.setExecutionPeriod(convertPeriod(src.getExecutionPeriod())); - if (src.hasAuthoredOn()) - tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); - if (src.hasLastModified()) - tgt.setLastModifiedElement(convertDateTime(src.getLastModifiedElement())); - if (src.hasRequester()) - tgt.setRequester(convertReference(src.getRequester())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType()) - tgt.addPerformerType(convertCodeableConcept(t)); - if (src.hasOwner()) - tgt.setOwner(convertReference(src.getOwner())); - if (src.hasLocation()) - tgt.setLocation(convertReference(src.getLocation())); - if (src.hasReasonCode()) - tgt.setReasonCode(convertCodeableConcept(src.getReasonCode())); - if (src.hasReasonReference()) - tgt.setReasonReference(convertReference(src.getReasonReference())); - for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) - tgt.addInsurance(convertReference(t)); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) - tgt.addRelevantHistory(convertReference(t)); - if (src.hasRestriction()) - tgt.setRestriction(convertTaskRestrictionComponent(src.getRestriction())); - for (org.hl7.fhir.r5.model.Task.ParameterComponent t : src.getInput()) - tgt.addInput(convertParameterComponent(t)); - for (org.hl7.fhir.r5.model.Task.TaskOutputComponent t : src.getOutput()) - tgt.addOutput(convertTaskOutputComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Task.TaskStatus convertTaskStatus(org.hl7.fhir.r4.model.Task.TaskStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r5.model.Task.TaskStatus.DRAFT; - case REQUESTED: return org.hl7.fhir.r5.model.Task.TaskStatus.REQUESTED; - case RECEIVED: return org.hl7.fhir.r5.model.Task.TaskStatus.RECEIVED; - case ACCEPTED: return org.hl7.fhir.r5.model.Task.TaskStatus.ACCEPTED; - case REJECTED: return org.hl7.fhir.r5.model.Task.TaskStatus.REJECTED; - case READY: return org.hl7.fhir.r5.model.Task.TaskStatus.READY; - case CANCELLED: return org.hl7.fhir.r5.model.Task.TaskStatus.CANCELLED; - case INPROGRESS: return org.hl7.fhir.r5.model.Task.TaskStatus.INPROGRESS; - case ONHOLD: return org.hl7.fhir.r5.model.Task.TaskStatus.ONHOLD; - case FAILED: return org.hl7.fhir.r5.model.Task.TaskStatus.FAILED; - case COMPLETED: return org.hl7.fhir.r5.model.Task.TaskStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Task.TaskStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Task.TaskStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.Task.TaskStatus convertTaskStatus(org.hl7.fhir.r5.model.Task.TaskStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DRAFT: return org.hl7.fhir.r4.model.Task.TaskStatus.DRAFT; - case REQUESTED: return org.hl7.fhir.r4.model.Task.TaskStatus.REQUESTED; - case RECEIVED: return org.hl7.fhir.r4.model.Task.TaskStatus.RECEIVED; - case ACCEPTED: return org.hl7.fhir.r4.model.Task.TaskStatus.ACCEPTED; - case REJECTED: return org.hl7.fhir.r4.model.Task.TaskStatus.REJECTED; - case READY: return org.hl7.fhir.r4.model.Task.TaskStatus.READY; - case CANCELLED: return org.hl7.fhir.r4.model.Task.TaskStatus.CANCELLED; - case INPROGRESS: return org.hl7.fhir.r4.model.Task.TaskStatus.INPROGRESS; - case ONHOLD: return org.hl7.fhir.r4.model.Task.TaskStatus.ONHOLD; - case FAILED: return org.hl7.fhir.r4.model.Task.TaskStatus.FAILED; - case COMPLETED: return org.hl7.fhir.r4.model.Task.TaskStatus.COMPLETED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.Task.TaskStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.Task.TaskStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.Task.TaskIntent convertTaskIntent(org.hl7.fhir.r4.model.Task.TaskIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UNKNOWN: return org.hl7.fhir.r5.model.Task.TaskIntent.UNKNOWN; - case PROPOSAL: return org.hl7.fhir.r5.model.Task.TaskIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r5.model.Task.TaskIntent.PLAN; - case ORDER: return org.hl7.fhir.r5.model.Task.TaskIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r5.model.Task.TaskIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r5.model.Task.TaskIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r5.model.Task.TaskIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r5.model.Task.TaskIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r5.model.Task.TaskIntent.OPTION; - default: return org.hl7.fhir.r5.model.Task.TaskIntent.NULL; - } -} - - public static org.hl7.fhir.r4.model.Task.TaskIntent convertTaskIntent(org.hl7.fhir.r5.model.Task.TaskIntent src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UNKNOWN: return org.hl7.fhir.r4.model.Task.TaskIntent.UNKNOWN; - case PROPOSAL: return org.hl7.fhir.r4.model.Task.TaskIntent.PROPOSAL; - case PLAN: return org.hl7.fhir.r4.model.Task.TaskIntent.PLAN; - case ORDER: return org.hl7.fhir.r4.model.Task.TaskIntent.ORDER; - case ORIGINALORDER: return org.hl7.fhir.r4.model.Task.TaskIntent.ORIGINALORDER; - case REFLEXORDER: return org.hl7.fhir.r4.model.Task.TaskIntent.REFLEXORDER; - case FILLERORDER: return org.hl7.fhir.r4.model.Task.TaskIntent.FILLERORDER; - case INSTANCEORDER: return org.hl7.fhir.r4.model.Task.TaskIntent.INSTANCEORDER; - case OPTION: return org.hl7.fhir.r4.model.Task.TaskIntent.OPTION; - default: return org.hl7.fhir.r4.model.Task.TaskIntent.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertTaskPriority(org.hl7.fhir.r4.model.Task.TaskPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; - case ASAP: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; - case STAT: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; - default: return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; - } -} - - public static org.hl7.fhir.r4.model.Task.TaskPriority convertTaskPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ROUTINE: return org.hl7.fhir.r4.model.Task.TaskPriority.ROUTINE; - case URGENT: return org.hl7.fhir.r4.model.Task.TaskPriority.URGENT; - case ASAP: return org.hl7.fhir.r4.model.Task.TaskPriority.ASAP; - case STAT: return org.hl7.fhir.r4.model.Task.TaskPriority.STAT; - default: return org.hl7.fhir.r4.model.Task.TaskPriority.NULL; - } -} - - public static org.hl7.fhir.r5.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r4.model.Task.TaskRestrictionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Task.TaskRestrictionComponent tgt = new org.hl7.fhir.r5.model.Task.TaskRestrictionComponent(); - copyElement(src, tgt); - if (src.hasRepetitions()) - tgt.setRepetitionsElement(convertPositiveInt(src.getRepetitionsElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r5.model.Task.TaskRestrictionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Task.TaskRestrictionComponent tgt = new org.hl7.fhir.r4.model.Task.TaskRestrictionComponent(); - copyElement(src, tgt); - if (src.hasRepetitions()) - tgt.setRepetitionsElement(convertPositiveInt(src.getRepetitionsElement())); - if (src.hasPeriod()) - tgt.setPeriod(convertPeriod(src.getPeriod())); - for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) - tgt.addRecipient(convertReference(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Task.ParameterComponent convertParameterComponent(org.hl7.fhir.r4.model.Task.ParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Task.ParameterComponent tgt = new org.hl7.fhir.r5.model.Task.ParameterComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Task.ParameterComponent convertParameterComponent(org.hl7.fhir.r5.model.Task.ParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Task.ParameterComponent tgt = new org.hl7.fhir.r4.model.Task.ParameterComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Task.TaskOutputComponent convertTaskOutputComponent(org.hl7.fhir.r4.model.Task.TaskOutputComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Task.TaskOutputComponent tgt = new org.hl7.fhir.r5.model.Task.TaskOutputComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.Task.TaskOutputComponent convertTaskOutputComponent(org.hl7.fhir.r5.model.Task.TaskOutputComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.Task.TaskOutputComponent tgt = new org.hl7.fhir.r4.model.Task.TaskOutputComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCodeableConcept(src.getType())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } + public static org.hl7.fhir.r5.model.Task convertTask(org.hl7.fhir.r4.model.Task src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task tgt = new org.hl7.fhir.r5.model.Task(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonicalElement(convertCanonical(src.getInstantiatesCanonicalElement())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasPartOf()) { + for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertTaskStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasBusinessStatus()) + tgt.setBusinessStatus(convertCodeableConcept(src.getBusinessStatus())); + if (src.hasIntent()) + tgt.setIntent(convertTaskIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertTaskPriority(src.getPriority())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasFocus()) + tgt.setFocus(convertReference(src.getFocus())); + if (src.hasFor()) + tgt.setFor(convertReference(src.getFor())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasExecutionPeriod()) + tgt.setExecutionPeriod(convertPeriod(src.getExecutionPeriod())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(convertDateTime(src.getLastModifiedElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformerType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPerformerType()) tgt.addPerformerType(convertCodeableConcept(t)); + } + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasReasonCode()) + tgt.setReasonCode(convertCodeableConcept(src.getReasonCode())); + if (src.hasReasonReference()) + tgt.setReasonReference(convertReference(src.getReasonReference())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + if (src.hasRestriction()) + tgt.setRestriction(convertTaskRestrictionComponent(src.getRestriction())); + if (src.hasInput()) { + for (org.hl7.fhir.r4.model.Task.ParameterComponent t : src.getInput()) tgt.addInput(convertParameterComponent(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.r4.model.Task.TaskOutputComponent t : src.getOutput()) tgt.addOutput(convertTaskOutputComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.Task convertTask(org.hl7.fhir.r5.model.Task src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Task tgt = new org.hl7.fhir.r4.model.Task(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonicalElement(convertCanonical(src.getInstantiatesCanonicalElement())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement())); + if (src.hasBasedOn()) { + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(convertReference(t)); + } + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier())); + if (src.hasPartOf()) { + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(convertReference(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertTaskStatus(src.getStatus())); + if (src.hasStatusReason()) + tgt.setStatusReason(convertCodeableConcept(src.getStatusReason())); + if (src.hasBusinessStatus()) + tgt.setBusinessStatus(convertCodeableConcept(src.getBusinessStatus())); + if (src.hasIntent()) + tgt.setIntent(convertTaskIntent(src.getIntent())); + if (src.hasPriority()) + tgt.setPriority(convertTaskPriority(src.getPriority())); + if (src.hasCode()) + tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasFocus()) + tgt.setFocus(convertReference(src.getFocus())); + if (src.hasFor()) + tgt.setFor(convertReference(src.getFor())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasExecutionPeriod()) + tgt.setExecutionPeriod(convertPeriod(src.getExecutionPeriod())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(convertDateTime(src.getLastModifiedElement())); + if (src.hasRequester()) + tgt.setRequester(convertReference(src.getRequester())); + if (src.hasPerformerType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType()) tgt.addPerformerType(convertCodeableConcept(t)); + } + if (src.hasOwner()) + tgt.setOwner(convertReference(src.getOwner())); + if (src.hasLocation()) + tgt.setLocation(convertReference(src.getLocation())); + if (src.hasReasonCode()) + tgt.setReasonCode(convertCodeableConcept(src.getReasonCode())); + if (src.hasReasonReference()) + tgt.setReasonReference(convertReference(src.getReasonReference())); + if (src.hasInsurance()) { + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(convertReference(t)); + } + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + if (src.hasRelevantHistory()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) tgt.addRelevantHistory(convertReference(t)); + } + if (src.hasRestriction()) + tgt.setRestriction(convertTaskRestrictionComponent(src.getRestriction())); + if (src.hasInput()) { + for (org.hl7.fhir.r5.model.Task.ParameterComponent t : src.getInput()) tgt.addInput(convertParameterComponent(t)); + } + if (src.hasOutput()) { + for (org.hl7.fhir.r5.model.Task.TaskOutputComponent t : src.getOutput()) tgt.addOutput(convertTaskOutputComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Task.TaskStatus convertTaskStatus(org.hl7.fhir.r4.model.Task.TaskStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r5.model.Task.TaskStatus.DRAFT; + case REQUESTED: + return org.hl7.fhir.r5.model.Task.TaskStatus.REQUESTED; + case RECEIVED: + return org.hl7.fhir.r5.model.Task.TaskStatus.RECEIVED; + case ACCEPTED: + return org.hl7.fhir.r5.model.Task.TaskStatus.ACCEPTED; + case REJECTED: + return org.hl7.fhir.r5.model.Task.TaskStatus.REJECTED; + case READY: + return org.hl7.fhir.r5.model.Task.TaskStatus.READY; + case CANCELLED: + return org.hl7.fhir.r5.model.Task.TaskStatus.CANCELLED; + case INPROGRESS: + return org.hl7.fhir.r5.model.Task.TaskStatus.INPROGRESS; + case ONHOLD: + return org.hl7.fhir.r5.model.Task.TaskStatus.ONHOLD; + case FAILED: + return org.hl7.fhir.r5.model.Task.TaskStatus.FAILED; + case COMPLETED: + return org.hl7.fhir.r5.model.Task.TaskStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Task.TaskStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Task.TaskStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.Task.TaskStatus convertTaskStatus(org.hl7.fhir.r5.model.Task.TaskStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DRAFT: + return org.hl7.fhir.r4.model.Task.TaskStatus.DRAFT; + case REQUESTED: + return org.hl7.fhir.r4.model.Task.TaskStatus.REQUESTED; + case RECEIVED: + return org.hl7.fhir.r4.model.Task.TaskStatus.RECEIVED; + case ACCEPTED: + return org.hl7.fhir.r4.model.Task.TaskStatus.ACCEPTED; + case REJECTED: + return org.hl7.fhir.r4.model.Task.TaskStatus.REJECTED; + case READY: + return org.hl7.fhir.r4.model.Task.TaskStatus.READY; + case CANCELLED: + return org.hl7.fhir.r4.model.Task.TaskStatus.CANCELLED; + case INPROGRESS: + return org.hl7.fhir.r4.model.Task.TaskStatus.INPROGRESS; + case ONHOLD: + return org.hl7.fhir.r4.model.Task.TaskStatus.ONHOLD; + case FAILED: + return org.hl7.fhir.r4.model.Task.TaskStatus.FAILED; + case COMPLETED: + return org.hl7.fhir.r4.model.Task.TaskStatus.COMPLETED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.Task.TaskStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.Task.TaskStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.Task.TaskIntent convertTaskIntent(org.hl7.fhir.r4.model.Task.TaskIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UNKNOWN: + return org.hl7.fhir.r5.model.Task.TaskIntent.UNKNOWN; + case PROPOSAL: + return org.hl7.fhir.r5.model.Task.TaskIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r5.model.Task.TaskIntent.PLAN; + case ORDER: + return org.hl7.fhir.r5.model.Task.TaskIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r5.model.Task.TaskIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r5.model.Task.TaskIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r5.model.Task.TaskIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r5.model.Task.TaskIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r5.model.Task.TaskIntent.OPTION; + default: + return org.hl7.fhir.r5.model.Task.TaskIntent.NULL; + } + } + + public static org.hl7.fhir.r4.model.Task.TaskIntent convertTaskIntent(org.hl7.fhir.r5.model.Task.TaskIntent src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UNKNOWN: + return org.hl7.fhir.r4.model.Task.TaskIntent.UNKNOWN; + case PROPOSAL: + return org.hl7.fhir.r4.model.Task.TaskIntent.PROPOSAL; + case PLAN: + return org.hl7.fhir.r4.model.Task.TaskIntent.PLAN; + case ORDER: + return org.hl7.fhir.r4.model.Task.TaskIntent.ORDER; + case ORIGINALORDER: + return org.hl7.fhir.r4.model.Task.TaskIntent.ORIGINALORDER; + case REFLEXORDER: + return org.hl7.fhir.r4.model.Task.TaskIntent.REFLEXORDER; + case FILLERORDER: + return org.hl7.fhir.r4.model.Task.TaskIntent.FILLERORDER; + case INSTANCEORDER: + return org.hl7.fhir.r4.model.Task.TaskIntent.INSTANCEORDER; + case OPTION: + return org.hl7.fhir.r4.model.Task.TaskIntent.OPTION; + default: + return org.hl7.fhir.r4.model.Task.TaskIntent.NULL; + } + } + + public static org.hl7.fhir.r5.model.Enumerations.RequestPriority convertTaskPriority(org.hl7.fhir.r4.model.Task.TaskPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT; + case ASAP: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP; + case STAT: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT; + default: + return org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL; + } + } + + public static org.hl7.fhir.r4.model.Task.TaskPriority convertTaskPriority(org.hl7.fhir.r5.model.Enumerations.RequestPriority src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ROUTINE: + return org.hl7.fhir.r4.model.Task.TaskPriority.ROUTINE; + case URGENT: + return org.hl7.fhir.r4.model.Task.TaskPriority.URGENT; + case ASAP: + return org.hl7.fhir.r4.model.Task.TaskPriority.ASAP; + case STAT: + return org.hl7.fhir.r4.model.Task.TaskPriority.STAT; + default: + return org.hl7.fhir.r4.model.Task.TaskPriority.NULL; + } + } + + public static org.hl7.fhir.r5.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r4.model.Task.TaskRestrictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task.TaskRestrictionComponent tgt = new org.hl7.fhir.r5.model.Task.TaskRestrictionComponent(); + copyElement(src, tgt); + if (src.hasRepetitions()) + tgt.setRepetitionsElement(convertPositiveInt(src.getRepetitionsElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasRecipient()) { + for (org.hl7.fhir.r4.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r5.model.Task.TaskRestrictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Task.TaskRestrictionComponent tgt = new org.hl7.fhir.r4.model.Task.TaskRestrictionComponent(); + copyElement(src, tgt); + if (src.hasRepetitions()) + tgt.setRepetitionsElement(convertPositiveInt(src.getRepetitionsElement())); + if (src.hasPeriod()) + tgt.setPeriod(convertPeriod(src.getPeriod())); + if (src.hasRecipient()) { + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(convertReference(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.Task.ParameterComponent convertParameterComponent(org.hl7.fhir.r4.model.Task.ParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task.ParameterComponent tgt = new org.hl7.fhir.r5.model.Task.ParameterComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Task.ParameterComponent convertParameterComponent(org.hl7.fhir.r5.model.Task.ParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Task.ParameterComponent tgt = new org.hl7.fhir.r4.model.Task.ParameterComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Task.TaskOutputComponent convertTaskOutputComponent(org.hl7.fhir.r4.model.Task.TaskOutputComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task.TaskOutputComponent tgt = new org.hl7.fhir.r5.model.Task.TaskOutputComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.Task.TaskOutputComponent convertTaskOutputComponent(org.hl7.fhir.r5.model.Task.TaskOutputComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.Task.TaskOutputComponent tgt = new org.hl7.fhir.r4.model.Task.TaskOutputComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TerminologyCapabilities.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TerminologyCapabilities.java index 31741748b..bebe6b906 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TerminologyCapabilities.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TerminologyCapabilities.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,425 +50,454 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class TerminologyCapabilities extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.TerminologyCapabilities convertTerminologyCapabilities(org.hl7.fhir.r4.model.TerminologyCapabilities src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasKind()) - tgt.setKind(convertCapabilityStatementKind(src.getKind())); - if (src.hasSoftware()) - tgt.setSoftware(convertTerminologyCapabilitiesSoftwareComponent(src.getSoftware())); - if (src.hasImplementation()) - tgt.setImplementation(convertTerminologyCapabilitiesImplementationComponent(src.getImplementation())); - if (src.hasLockedDate()) - tgt.setLockedDateElement(convertBoolean(src.getLockedDateElement())); - for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent t : src.getCodeSystem()) - tgt.addCodeSystem(convertTerminologyCapabilitiesCodeSystemComponent(t)); - if (src.hasExpansion()) - tgt.setExpansion(convertTerminologyCapabilitiesExpansionComponent(src.getExpansion())); - if (src.hasCodeSearch()) - tgt.setCodeSearch(convertCodeSearchSupport(src.getCodeSearch())); - if (src.hasValidateCode()) - tgt.setValidateCode(convertTerminologyCapabilitiesValidateCodeComponent(src.getValidateCode())); - if (src.hasTranslation()) - tgt.setTranslation(convertTerminologyCapabilitiesTranslationComponent(src.getTranslation())); - if (src.hasClosure()) - tgt.setClosure(convertTerminologyCapabilitiesClosureComponent(src.getClosure())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities convertTerminologyCapabilities(org.hl7.fhir.r5.model.TerminologyCapabilities src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasKind()) - tgt.setKind(convertCapabilityStatementKind(src.getKind())); - if (src.hasSoftware()) - tgt.setSoftware(convertTerminologyCapabilitiesSoftwareComponent(src.getSoftware())); - if (src.hasImplementation()) - tgt.setImplementation(convertTerminologyCapabilitiesImplementationComponent(src.getImplementation())); - if (src.hasLockedDate()) - tgt.setLockedDateElement(convertBoolean(src.getLockedDateElement())); - for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent t : src.getCodeSystem()) - tgt.addCodeSystem(convertTerminologyCapabilitiesCodeSystemComponent(t)); - if (src.hasExpansion()) - tgt.setExpansion(convertTerminologyCapabilitiesExpansionComponent(src.getExpansion())); - if (src.hasCodeSearch()) - tgt.setCodeSearch(convertCodeSearchSupport(src.getCodeSearch())); - if (src.hasValidateCode()) - tgt.setValidateCode(convertTerminologyCapabilitiesValidateCodeComponent(src.getValidateCode())); - if (src.hasTranslation()) - tgt.setTranslation(convertTerminologyCapabilitiesTranslationComponent(src.getTranslation())); - if (src.hasClosure()) - tgt.setClosure(convertTerminologyCapabilitiesClosureComponent(src.getClosure())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE; - case CAPABILITY: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY; - case REQUIREMENTS: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS; - default: return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL; - } -} - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case INSTANCE: return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.INSTANCE; - case CAPABILITY: return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.CAPABILITY; - case REQUIREMENTS: return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.REQUIREMENTS; - default: return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.NULL; - } -} - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport convertCodeSearchSupport(org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EXPLICIT: return org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT; - case ALL: return org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.ALL; - default: return org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.NULL; - } -} - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport convertCodeSearchSupport(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EXPLICIT: return org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT; - case ALL: return org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.ALL; - default: return org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.NULL; - } -} - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent convertTerminologyCapabilitiesSoftwareComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent convertTerminologyCapabilitiesSoftwareComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent convertTerminologyCapabilitiesImplementationComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertUrl(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent convertTerminologyCapabilitiesImplementationComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent(); - copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertUrl(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent convertTerminologyCapabilitiesCodeSystemComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent(); - copyElement(src, tgt); - if (src.hasUri()) - tgt.setUriElement(convertCanonical(src.getUriElement())); - for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent t : src.getVersion()) - tgt.addVersion(convertTerminologyCapabilitiesCodeSystemVersionComponent(t)); - if (src.hasSubsumption()) - tgt.setSubsumptionElement(convertBoolean(src.getSubsumptionElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent convertTerminologyCapabilitiesCodeSystemComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent(); - copyElement(src, tgt); - if (src.hasUri()) - tgt.setUriElement(convertCanonical(src.getUriElement())); - for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent t : src.getVersion()) - tgt.addVersion(convertTerminologyCapabilitiesCodeSystemVersionComponent(t)); - if (src.hasSubsumption()) - tgt.setSubsumptionElement(convertBoolean(src.getSubsumptionElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent convertTerminologyCapabilitiesCodeSystemVersionComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertString(src.getCodeElement())); - if (src.hasIsDefault()) - tgt.setIsDefaultElement(convertBoolean(src.getIsDefaultElement())); - if (src.hasCompositional()) - tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); - for (org.hl7.fhir.r4.model.CodeType t : src.getLanguage()) - tgt.getLanguage().add(convertCode(t)); - for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent t : src.getFilter()) - tgt.addFilter(convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(t)); - for (org.hl7.fhir.r4.model.CodeType t : src.getProperty()) - tgt.getProperty().add(convertCode(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent convertTerminologyCapabilitiesCodeSystemVersionComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertString(src.getCodeElement())); - if (src.hasIsDefault()) - tgt.setIsDefaultElement(convertBoolean(src.getIsDefaultElement())); - if (src.hasCompositional()) - tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); - for (org.hl7.fhir.r5.model.CodeType t : src.getLanguage()) - tgt.getLanguage().add(convertCode(t)); - for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent t : src.getFilter()) - tgt.addFilter(convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(t)); - for (org.hl7.fhir.r5.model.CodeType t : src.getProperty()) - tgt.getProperty().add(convertCode(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - for (org.hl7.fhir.r4.model.CodeType t : src.getOp()) - tgt.getOp().add(convertCode(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - for (org.hl7.fhir.r5.model.CodeType t : src.getOp()) - tgt.getOp().add(convertCode(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent convertTerminologyCapabilitiesExpansionComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent(); - copyElement(src, tgt); - if (src.hasHierarchical()) - tgt.setHierarchicalElement(convertBoolean(src.getHierarchicalElement())); - if (src.hasPaging()) - tgt.setPagingElement(convertBoolean(src.getPagingElement())); - if (src.hasIncomplete()) - tgt.setIncompleteElement(convertBoolean(src.getIncompleteElement())); - for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent t : src.getParameter()) - tgt.addParameter(convertTerminologyCapabilitiesExpansionParameterComponent(t)); - if (src.hasTextFilter()) - tgt.setTextFilterElement(convertMarkdown(src.getTextFilterElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent convertTerminologyCapabilitiesExpansionComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent(); - copyElement(src, tgt); - if (src.hasHierarchical()) - tgt.setHierarchicalElement(convertBoolean(src.getHierarchicalElement())); - if (src.hasPaging()) - tgt.setPagingElement(convertBoolean(src.getPagingElement())); - if (src.hasIncomplete()) - tgt.setIncompleteElement(convertBoolean(src.getIncompleteElement())); - for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent t : src.getParameter()) - tgt.addParameter(convertTerminologyCapabilitiesExpansionParameterComponent(t)); - if (src.hasTextFilter()) - tgt.setTextFilterElement(convertMarkdown(src.getTextFilterElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent convertTerminologyCapabilitiesExpansionParameterComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertCode(src.getNameElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent convertTerminologyCapabilitiesExpansionParameterComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertCode(src.getNameElement())); - if (src.hasDocumentation()) - tgt.setDocumentationElement(convertString(src.getDocumentationElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent convertTerminologyCapabilitiesValidateCodeComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent(); - copyElement(src, tgt); - if (src.hasTranslations()) - tgt.setTranslationsElement(convertBoolean(src.getTranslationsElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent convertTerminologyCapabilitiesValidateCodeComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent(); - copyElement(src, tgt); - if (src.hasTranslations()) - tgt.setTranslationsElement(convertBoolean(src.getTranslationsElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent convertTerminologyCapabilitiesTranslationComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent(); - copyElement(src, tgt); - if (src.hasNeedsMap()) - tgt.setNeedsMapElement(convertBoolean(src.getNeedsMapElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent convertTerminologyCapabilitiesTranslationComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent(); - copyElement(src, tgt); - if (src.hasNeedsMap()) - tgt.setNeedsMapElement(convertBoolean(src.getNeedsMapElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent convertTerminologyCapabilitiesClosureComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent(); - copyElement(src, tgt); - if (src.hasTranslation()) - tgt.setTranslationElement(convertBoolean(src.getTranslationElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent convertTerminologyCapabilitiesClosureComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent(); - copyElement(src, tgt); - if (src.hasTranslation()) - tgt.setTranslationElement(convertBoolean(src.getTranslationElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.TerminologyCapabilities convertTerminologyCapabilities(org.hl7.fhir.r4.model.TerminologyCapabilities src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKind(convertCapabilityStatementKind(src.getKind())); + if (src.hasSoftware()) + tgt.setSoftware(convertTerminologyCapabilitiesSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertTerminologyCapabilitiesImplementationComponent(src.getImplementation())); + if (src.hasLockedDate()) + tgt.setLockedDateElement(convertBoolean(src.getLockedDateElement())); + if (src.hasCodeSystem()) { + for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent t : src.getCodeSystem()) tgt.addCodeSystem(convertTerminologyCapabilitiesCodeSystemComponent(t)); + } + if (src.hasExpansion()) + tgt.setExpansion(convertTerminologyCapabilitiesExpansionComponent(src.getExpansion())); + if (src.hasCodeSearch()) + tgt.setCodeSearch(convertCodeSearchSupport(src.getCodeSearch())); + if (src.hasValidateCode()) + tgt.setValidateCode(convertTerminologyCapabilitiesValidateCodeComponent(src.getValidateCode())); + if (src.hasTranslation()) + tgt.setTranslation(convertTerminologyCapabilitiesTranslationComponent(src.getTranslation())); + if (src.hasClosure()) + tgt.setClosure(convertTerminologyCapabilitiesClosureComponent(src.getClosure())); + return tgt; + } + public static org.hl7.fhir.r4.model.TerminologyCapabilities convertTerminologyCapabilities(org.hl7.fhir.r5.model.TerminologyCapabilities src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKind(convertCapabilityStatementKind(src.getKind())); + if (src.hasSoftware()) + tgt.setSoftware(convertTerminologyCapabilitiesSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertTerminologyCapabilitiesImplementationComponent(src.getImplementation())); + if (src.hasLockedDate()) + tgt.setLockedDateElement(convertBoolean(src.getLockedDateElement())); + if (src.hasCodeSystem()) { + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent t : src.getCodeSystem()) tgt.addCodeSystem(convertTerminologyCapabilitiesCodeSystemComponent(t)); + } + if (src.hasExpansion()) + tgt.setExpansion(convertTerminologyCapabilitiesExpansionComponent(src.getExpansion())); + if (src.hasCodeSearch()) + tgt.setCodeSearch(convertCodeSearchSupport(src.getCodeSearch())); + if (src.hasValidateCode()) + tgt.setValidateCode(convertTerminologyCapabilitiesValidateCodeComponent(src.getValidateCode())); + if (src.hasTranslation()) + tgt.setTranslation(convertTerminologyCapabilitiesTranslationComponent(src.getTranslation())); + if (src.hasClosure()) + tgt.setClosure(convertTerminologyCapabilitiesClosureComponent(src.getClosure())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE; + case CAPABILITY: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY; + case REQUIREMENTS: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS; + default: + return org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL; + } + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case INSTANCE: + return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.INSTANCE; + case CAPABILITY: + return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.CAPABILITY; + case REQUIREMENTS: + return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.REQUIREMENTS; + default: + return org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.NULL; + } + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport convertCodeSearchSupport(org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EXPLICIT: + return org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT; + case ALL: + return org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.ALL; + default: + return org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.NULL; + } + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport convertCodeSearchSupport(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EXPLICIT: + return org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT; + case ALL: + return org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.ALL; + default: + return org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.NULL; + } + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent convertTerminologyCapabilitiesSoftwareComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent convertTerminologyCapabilitiesSoftwareComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent convertTerminologyCapabilitiesImplementationComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertUrl(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent convertTerminologyCapabilitiesImplementationComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent(); + copyElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertUrl(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent convertTerminologyCapabilitiesCodeSystemComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent(); + copyElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(convertCanonical(src.getUriElement())); + if (src.hasVersion()) { + for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent t : src.getVersion()) tgt.addVersion(convertTerminologyCapabilitiesCodeSystemVersionComponent(t)); + } + if (src.hasSubsumption()) + tgt.setSubsumptionElement(convertBoolean(src.getSubsumptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent convertTerminologyCapabilitiesCodeSystemComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent(); + copyElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(convertCanonical(src.getUriElement())); + if (src.hasVersion()) { + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent t : src.getVersion()) tgt.addVersion(convertTerminologyCapabilitiesCodeSystemVersionComponent(t)); + } + if (src.hasSubsumption()) + tgt.setSubsumptionElement(convertBoolean(src.getSubsumptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent convertTerminologyCapabilitiesCodeSystemVersionComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertString(src.getCodeElement())); + if (src.hasIsDefault()) + tgt.setIsDefaultElement(convertBoolean(src.getIsDefaultElement())); + if (src.hasCompositional()) + tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); + if (src.hasLanguage()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getLanguage()) tgt.getLanguage().add(convertCode(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent t : src.getFilter()) tgt.addFilter(convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getProperty()) tgt.getProperty().add(convertCode(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent convertTerminologyCapabilitiesCodeSystemVersionComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertString(src.getCodeElement())); + if (src.hasIsDefault()) + tgt.setIsDefaultElement(convertBoolean(src.getIsDefaultElement())); + if (src.hasCompositional()) + tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement())); + if (src.hasLanguage()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getLanguage()) tgt.getLanguage().add(convertCode(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent t : src.getFilter()) tgt.addFilter(convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(t)); + } + if (src.hasProperty()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getProperty()) tgt.getProperty().add(convertCode(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasOp()) { + for (org.hl7.fhir.r4.model.CodeType t : src.getOp()) tgt.getOp().add(convertCode(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasOp()) { + for (org.hl7.fhir.r5.model.CodeType t : src.getOp()) tgt.getOp().add(convertCode(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent convertTerminologyCapabilitiesExpansionComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent(); + copyElement(src, tgt); + if (src.hasHierarchical()) + tgt.setHierarchicalElement(convertBoolean(src.getHierarchicalElement())); + if (src.hasPaging()) + tgt.setPagingElement(convertBoolean(src.getPagingElement())); + if (src.hasIncomplete()) + tgt.setIncompleteElement(convertBoolean(src.getIncompleteElement())); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertTerminologyCapabilitiesExpansionParameterComponent(t)); + } + if (src.hasTextFilter()) + tgt.setTextFilterElement(convertMarkdown(src.getTextFilterElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent convertTerminologyCapabilitiesExpansionComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent(); + copyElement(src, tgt); + if (src.hasHierarchical()) + tgt.setHierarchicalElement(convertBoolean(src.getHierarchicalElement())); + if (src.hasPaging()) + tgt.setPagingElement(convertBoolean(src.getPagingElement())); + if (src.hasIncomplete()) + tgt.setIncompleteElement(convertBoolean(src.getIncompleteElement())); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertTerminologyCapabilitiesExpansionParameterComponent(t)); + } + if (src.hasTextFilter()) + tgt.setTextFilterElement(convertMarkdown(src.getTextFilterElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent convertTerminologyCapabilitiesExpansionParameterComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertCode(src.getNameElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent convertTerminologyCapabilitiesExpansionParameterComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertCode(src.getNameElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent convertTerminologyCapabilitiesValidateCodeComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent(); + copyElement(src, tgt); + if (src.hasTranslations()) + tgt.setTranslationsElement(convertBoolean(src.getTranslationsElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent convertTerminologyCapabilitiesValidateCodeComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent(); + copyElement(src, tgt); + if (src.hasTranslations()) + tgt.setTranslationsElement(convertBoolean(src.getTranslationsElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent convertTerminologyCapabilitiesTranslationComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent(); + copyElement(src, tgt); + if (src.hasNeedsMap()) + tgt.setNeedsMapElement(convertBoolean(src.getNeedsMapElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent convertTerminologyCapabilitiesTranslationComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent(); + copyElement(src, tgt); + if (src.hasNeedsMap()) + tgt.setNeedsMapElement(convertBoolean(src.getNeedsMapElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent convertTerminologyCapabilitiesClosureComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent(); + copyElement(src, tgt); + if (src.hasTranslation()) + tgt.setTranslationElement(convertBoolean(src.getTranslationElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent convertTerminologyCapabilitiesClosureComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent tgt = new org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent(); + copyElement(src, tgt); + if (src.hasTranslation()) + tgt.setTranslationElement(convertBoolean(src.getTranslationElement())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestReport.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestReport.java index 4dead86d3..c93165a23 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestReport.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestReport.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,391 +50,436 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class TestReport extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.TestReport convertTestReport(org.hl7.fhir.r4.model.TestReport src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport tgt = new org.hl7.fhir.r5.model.TestReport(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(convertTestReportStatus(src.getStatus())); - if (src.hasTestScript()) - tgt.setTestScript(convertReference(src.getTestScript())); - if (src.hasResult()) - tgt.setResult(convertTestReportResult(src.getResult())); - if (src.hasScore()) - tgt.setScoreElement(convertDecimal(src.getScoreElement())); - if (src.hasTester()) - tgt.setTesterElement(convertString(src.getTesterElement())); - if (src.hasIssued()) - tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); - for (org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertTestReportParticipantComponent(t)); - if (src.hasSetup()) - tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); - for (org.hl7.fhir.r4.model.TestReport.TestReportTestComponent t : src.getTest()) - tgt.addTest(convertTestReportTestComponent(t)); - if (src.hasTeardown()) - tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport convertTestReport(org.hl7.fhir.r5.model.TestReport src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport tgt = new org.hl7.fhir.r4.model.TestReport(); - copyDomainResource(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasStatus()) - tgt.setStatus(convertTestReportStatus(src.getStatus())); - if (src.hasTestScript()) - tgt.setTestScript(convertReference(src.getTestScript())); - if (src.hasResult()) - tgt.setResult(convertTestReportResult(src.getResult())); - if (src.hasScore()) - tgt.setScoreElement(convertDecimal(src.getScoreElement())); - if (src.hasTester()) - tgt.setTesterElement(convertString(src.getTesterElement())); - if (src.hasIssued()) - tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); - for (org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) - tgt.addParticipant(convertTestReportParticipantComponent(t)); - if (src.hasSetup()) - tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); - for (org.hl7.fhir.r5.model.TestReport.TestReportTestComponent t : src.getTest()) - tgt.addTest(convertTestReportTestComponent(t)); - if (src.hasTeardown()) - tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.TestReportStatus convertTestReportStatus(org.hl7.fhir.r4.model.TestReport.TestReportStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETED: return org.hl7.fhir.r5.model.TestReport.TestReportStatus.COMPLETED; - case INPROGRESS: return org.hl7.fhir.r5.model.TestReport.TestReportStatus.INPROGRESS; - case WAITING: return org.hl7.fhir.r5.model.TestReport.TestReportStatus.WAITING; - case STOPPED: return org.hl7.fhir.r5.model.TestReport.TestReportStatus.STOPPED; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.TestReport.TestReportStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.TestReport.TestReportStatus.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestReport.TestReportStatus convertTestReportStatus(org.hl7.fhir.r5.model.TestReport.TestReportStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case COMPLETED: return org.hl7.fhir.r4.model.TestReport.TestReportStatus.COMPLETED; - case INPROGRESS: return org.hl7.fhir.r4.model.TestReport.TestReportStatus.INPROGRESS; - case WAITING: return org.hl7.fhir.r4.model.TestReport.TestReportStatus.WAITING; - case STOPPED: return org.hl7.fhir.r4.model.TestReport.TestReportStatus.STOPPED; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.TestReport.TestReportStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.TestReport.TestReportStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestReport.TestReportResult convertTestReportResult(org.hl7.fhir.r4.model.TestReport.TestReportResult src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PASS: return org.hl7.fhir.r5.model.TestReport.TestReportResult.PASS; - case FAIL: return org.hl7.fhir.r5.model.TestReport.TestReportResult.FAIL; - case PENDING: return org.hl7.fhir.r5.model.TestReport.TestReportResult.PENDING; - default: return org.hl7.fhir.r5.model.TestReport.TestReportResult.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestReport.TestReportResult convertTestReportResult(org.hl7.fhir.r5.model.TestReport.TestReportResult src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PASS: return org.hl7.fhir.r4.model.TestReport.TestReportResult.PASS; - case FAIL: return org.hl7.fhir.r4.model.TestReport.TestReportResult.FAIL; - case PENDING: return org.hl7.fhir.r4.model.TestReport.TestReportResult.PENDING; - default: return org.hl7.fhir.r4.model.TestReport.TestReportResult.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertTestReportParticipantType(src.getType())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertTestReportParticipantType(src.getType())); - if (src.hasUri()) - tgt.setUriElement(convertUri(src.getUriElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantType convertTestReportParticipantType(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case TESTENGINE: return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.TESTENGINE; - case CLIENT: return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.CLIENT; - case SERVER: return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.SERVER; - default: return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestReport.TestReportParticipantType convertTestReportParticipantType(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case TESTENGINE: return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.TESTENGINE; - case CLIENT: return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.CLIENT; - case SERVER: return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.SERVER; - default: return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestReport.SetupActionComponent t : src.getAction()) - tgt.addAction(convertSetupActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestReport.SetupActionComponent t : src.getAction()) - tgt.addAction(convertSetupActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4.model.TestReport.SetupActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestReport.SetupActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent(); - copyElement(src, tgt); - if (src.hasResult()) - tgt.setResult(convertTestReportActionResult(src.getResult())); - if (src.hasMessage()) - tgt.setMessageElement(convertMarkdown(src.getMessageElement())); - if (src.hasDetail()) - tgt.setDetailElement(convertUri(src.getDetailElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent(); - copyElement(src, tgt); - if (src.hasResult()) - tgt.setResult(convertTestReportActionResult(src.getResult())); - if (src.hasMessage()) - tgt.setMessageElement(convertMarkdown(src.getMessageElement())); - if (src.hasDetail()) - tgt.setDetailElement(convertUri(src.getDetailElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.TestReportActionResult convertTestReportActionResult(org.hl7.fhir.r4.model.TestReport.TestReportActionResult src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PASS: return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.PASS; - case SKIP: return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.SKIP; - case FAIL: return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.FAIL; - case WARNING: return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.WARNING; - case ERROR: return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.ERROR; - default: return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestReport.TestReportActionResult convertTestReportActionResult(org.hl7.fhir.r5.model.TestReport.TestReportActionResult src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case PASS: return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.PASS; - case SKIP: return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.SKIP; - case FAIL: return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.FAIL; - case WARNING: return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.WARNING; - case ERROR: return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.ERROR; - default: return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent(); - copyElement(src, tgt); - if (src.hasResult()) - tgt.setResult(convertTestReportActionResult(src.getResult())); - if (src.hasMessage()) - tgt.setMessageElement(convertMarkdown(src.getMessageElement())); - if (src.hasDetail()) - tgt.setDetailElement(convertString(src.getDetailElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent(); - copyElement(src, tgt); - if (src.hasResult()) - tgt.setResult(convertTestReportActionResult(src.getResult())); - if (src.hasMessage()) - tgt.setMessageElement(convertMarkdown(src.getMessageElement())); - if (src.hasDetail()) - tgt.setDetailElement(convertString(src.getDetailElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r4.model.TestReport.TestReportTestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTestComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.TestReport.TestActionComponent t : src.getAction()) - tgt.addAction(convertTestActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r5.model.TestReport.TestReportTestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportTestComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.TestReport.TestActionComponent t : src.getAction()) - tgt.addAction(convertTestActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4.model.TestReport.TestActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestReport.TestActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestReport.TeardownActionComponent t : src.getAction()) - tgt.addAction(convertTeardownActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestReport.TeardownActionComponent t : src.getAction()) - tgt.addAction(convertTeardownActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4.model.TestReport.TeardownActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TeardownActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestReport.TeardownActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.TeardownActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestReport convertTestReport(org.hl7.fhir.r4.model.TestReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport tgt = new org.hl7.fhir.r5.model.TestReport(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(convertTestReportStatus(src.getStatus())); + if (src.hasTestScript()) + tgt.setTestScript(convertReference(src.getTestScript())); + if (src.hasResult()) + tgt.setResult(convertTestReportResult(src.getResult())); + if (src.hasScore()) + tgt.setScoreElement(convertDecimal(src.getScoreElement())); + if (src.hasTester()) + tgt.setTesterElement(convertString(src.getTesterElement())); + if (src.hasIssued()) + tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + } + if (src.hasSetup()) + tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); + if (src.hasTest()) { + for (org.hl7.fhir.r4.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + } + if (src.hasTeardown()) + tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); + return tgt; + } + public static org.hl7.fhir.r4.model.TestReport convertTestReport(org.hl7.fhir.r5.model.TestReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport tgt = new org.hl7.fhir.r4.model.TestReport(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatus(convertTestReportStatus(src.getStatus())); + if (src.hasTestScript()) + tgt.setTestScript(convertReference(src.getTestScript())); + if (src.hasResult()) + tgt.setResult(convertTestReportResult(src.getResult())); + if (src.hasScore()) + tgt.setScoreElement(convertDecimal(src.getScoreElement())); + if (src.hasTester()) + tgt.setTesterElement(convertString(src.getTesterElement())); + if (src.hasIssued()) + tgt.setIssuedElement(convertDateTime(src.getIssuedElement())); + if (src.hasParticipant()) { + for (org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertTestReportParticipantComponent(t)); + } + if (src.hasSetup()) + tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); + if (src.hasTest()) { + for (org.hl7.fhir.r5.model.TestReport.TestReportTestComponent t : src.getTest()) tgt.addTest(convertTestReportTestComponent(t)); + } + if (src.hasTeardown()) + tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); + return tgt; + } + public static org.hl7.fhir.r5.model.TestReport.TestReportStatus convertTestReportStatus(org.hl7.fhir.r4.model.TestReport.TestReportStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETED: + return org.hl7.fhir.r5.model.TestReport.TestReportStatus.COMPLETED; + case INPROGRESS: + return org.hl7.fhir.r5.model.TestReport.TestReportStatus.INPROGRESS; + case WAITING: + return org.hl7.fhir.r5.model.TestReport.TestReportStatus.WAITING; + case STOPPED: + return org.hl7.fhir.r5.model.TestReport.TestReportStatus.STOPPED; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.TestReport.TestReportStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.TestReport.TestReportStatus.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportStatus convertTestReportStatus(org.hl7.fhir.r5.model.TestReport.TestReportStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case COMPLETED: + return org.hl7.fhir.r4.model.TestReport.TestReportStatus.COMPLETED; + case INPROGRESS: + return org.hl7.fhir.r4.model.TestReport.TestReportStatus.INPROGRESS; + case WAITING: + return org.hl7.fhir.r4.model.TestReport.TestReportStatus.WAITING; + case STOPPED: + return org.hl7.fhir.r4.model.TestReport.TestReportStatus.STOPPED; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.TestReport.TestReportStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.TestReport.TestReportStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportResult convertTestReportResult(org.hl7.fhir.r4.model.TestReport.TestReportResult src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PASS: + return org.hl7.fhir.r5.model.TestReport.TestReportResult.PASS; + case FAIL: + return org.hl7.fhir.r5.model.TestReport.TestReportResult.FAIL; + case PENDING: + return org.hl7.fhir.r5.model.TestReport.TestReportResult.PENDING; + default: + return org.hl7.fhir.r5.model.TestReport.TestReportResult.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportResult convertTestReportResult(org.hl7.fhir.r5.model.TestReport.TestReportResult src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PASS: + return org.hl7.fhir.r4.model.TestReport.TestReportResult.PASS; + case FAIL: + return org.hl7.fhir.r4.model.TestReport.TestReportResult.FAIL; + case PENDING: + return org.hl7.fhir.r4.model.TestReport.TestReportResult.PENDING; + default: + return org.hl7.fhir.r4.model.TestReport.TestReportResult.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertTestReportParticipantType(src.getType())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertTestReportParticipantType(src.getType())); + if (src.hasUri()) + tgt.setUriElement(convertUri(src.getUriElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantType convertTestReportParticipantType(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case TESTENGINE: + return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.TESTENGINE; + case CLIENT: + return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.CLIENT; + case SERVER: + return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.SERVER; + default: + return org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportParticipantType convertTestReportParticipantType(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case TESTENGINE: + return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.TESTENGINE; + case CLIENT: + return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.CLIENT; + case SERVER: + return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.SERVER; + default: + return org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestReport.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4.model.TestReport.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestReport.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent(); + copyElement(src, tgt); + if (src.hasResult()) + tgt.setResult(convertTestReportActionResult(src.getResult())); + if (src.hasMessage()) + tgt.setMessageElement(convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(convertUri(src.getDetailElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent(); + copyElement(src, tgt); + if (src.hasResult()) + tgt.setResult(convertTestReportActionResult(src.getResult())); + if (src.hasMessage()) + tgt.setMessageElement(convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(convertUri(src.getDetailElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportActionResult convertTestReportActionResult(org.hl7.fhir.r4.model.TestReport.TestReportActionResult src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PASS: + return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.PASS; + case SKIP: + return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.SKIP; + case FAIL: + return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.FAIL; + case WARNING: + return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.WARNING; + case ERROR: + return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.ERROR; + default: + return org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportActionResult convertTestReportActionResult(org.hl7.fhir.r5.model.TestReport.TestReportActionResult src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case PASS: + return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.PASS; + case SKIP: + return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.SKIP; + case FAIL: + return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.FAIL; + case WARNING: + return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.WARNING; + case ERROR: + return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.ERROR; + default: + return org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent(); + copyElement(src, tgt); + if (src.hasResult()) + tgt.setResult(convertTestReportActionResult(src.getResult())); + if (src.hasMessage()) + tgt.setMessageElement(convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(convertString(src.getDetailElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent(); + copyElement(src, tgt); + if (src.hasResult()) + tgt.setResult(convertTestReportActionResult(src.getResult())); + if (src.hasMessage()) + tgt.setMessageElement(convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(convertString(src.getDetailElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r4.model.TestReport.TestReportTestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTestComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r5.model.TestReport.TestReportTestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportTestComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestReport.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4.model.TestReport.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestReport.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestReport.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4.model.TestReport.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TeardownActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestReport.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.TeardownActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestScript.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestScript.java index 8a6f2952b..fb1c5bce0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestScript.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/TestScript.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,815 +50,916 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class TestScript extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.TestScript convertTestScript(org.hl7.fhir.r4.model.TestScript src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript tgt = new org.hl7.fhir.r5.model.TestScript(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasIdentifier()) - tgt.addIdentifier(convertIdentifier(src.getIdentifier())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - for (org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) - tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) - tgt.addDestination(convertTestScriptDestinationComponent(t)); - if (src.hasMetadata()) - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) - tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.r4.model.Reference t : src.getProfile()) - tgt.addProfile(convertReference(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent t : src.getVariable()) - tgt.addVariable(convertTestScriptVariableComponent(t)); - if (src.hasSetup()) - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent t : src.getTest()) - tgt.addTest(convertTestScriptTestComponent(t)); - if (src.hasTeardown()) - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript convertTestScript(org.hl7.fhir.r4.model.TestScript src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript tgt = new org.hl7.fhir.r5.model.TestScript(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.addIdentifier(convertIdentifier(src.getIdentifier())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasOrigin()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } + if (src.hasMetadata()) + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + if (src.hasFixture()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.r4.model.Reference t : src.getProfile()) tgt.addProfile(convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + if (src.hasTest()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript convertTestScript(org.hl7.fhir.r5.model.TestScript src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript tgt = new org.hl7.fhir.r4.model.TestScript(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasIdentifier()) - tgt.setIdentifier(convertIdentifier(src.getIdentifierFirstRep())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - for (org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) - tgt.addOrigin(convertTestScriptOriginComponent(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) - tgt.addDestination(convertTestScriptDestinationComponent(t)); - if (src.hasMetadata()) - tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); - for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) - tgt.addFixture(convertTestScriptFixtureComponent(t)); - for (org.hl7.fhir.r5.model.Reference t : src.getProfile()) - tgt.addProfile(convertReference(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable()) - tgt.addVariable(convertTestScriptVariableComponent(t)); - if (src.hasSetup()) - tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); - for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest()) - tgt.addTest(convertTestScriptTestComponent(t)); - if (src.hasTeardown()) - tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript convertTestScript(org.hl7.fhir.r5.model.TestScript src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript tgt = new org.hl7.fhir.r4.model.TestScript(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasOrigin()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) tgt.addOrigin(convertTestScriptOriginComponent(t)); + } + if (src.hasDestination()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) tgt.addDestination(convertTestScriptDestinationComponent(t)); + } + if (src.hasMetadata()) + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + if (src.hasFixture()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) tgt.addFixture(convertTestScriptFixtureComponent(t)); + } + if (src.hasProfile()) { + for (org.hl7.fhir.r5.model.Reference t : src.getProfile()) tgt.addProfile(convertReference(t)); + } + if (src.hasVariable()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable()) tgt.addVariable(convertTestScriptVariableComponent(t)); + } + if (src.hasSetup()) + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + if (src.hasTest()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest()) tgt.addTest(convertTestScriptTestComponent(t)); + } + if (src.hasTeardown()) + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent(); - copyElement(src, tgt); - if (src.hasIndex()) - tgt.setIndexElement(convertInteger(src.getIndexElement())); - if (src.hasProfile()) - tgt.setProfile(convertCoding(src.getProfile())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent(); + copyElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(convertCoding(src.getProfile())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent(); - copyElement(src, tgt); - if (src.hasIndex()) - tgt.setIndexElement(convertInteger(src.getIndexElement())); - if (src.hasProfile()) - tgt.setProfile(convertCoding(src.getProfile())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent(); + copyElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(convertCoding(src.getProfile())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent(); - copyElement(src, tgt); - if (src.hasIndex()) - tgt.setIndexElement(convertInteger(src.getIndexElement())); - if (src.hasProfile()) - tgt.setProfile(convertCoding(src.getProfile())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent(); + copyElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(convertCoding(src.getProfile())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent(); - copyElement(src, tgt); - if (src.hasIndex()) - tgt.setIndexElement(convertInteger(src.getIndexElement())); - if (src.hasProfile()) - tgt.setProfile(convertCoding(src.getProfile())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent(); + copyElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(convertCoding(src.getProfile())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) - tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) - tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent(); + copyElement(src, tgt); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) - tgt.addLink(convertTestScriptMetadataLinkComponent(t)); - for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) - tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent(); + copyElement(src, tgt); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + } + if (src.hasCapability()) { + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent(); - copyElement(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent(); + copyElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent(); - copyElement(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent(); + copyElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent(); - copyElement(src, tgt); - if (src.hasRequired()) - tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); - if (src.hasValidated()) - tgt.setValidatedElement(convertBoolean(src.getValidatedElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.IntegerType t : src.getOrigin()) - tgt.getOrigin().add(convertInteger(t)); - if (src.hasDestination()) - tgt.setDestinationElement(convertInteger(src.getDestinationElement())); - for (org.hl7.fhir.r4.model.UriType t : src.getLink()) - tgt.getLink().add(convertUri(t)); - if (src.hasCapabilities()) - tgt.setCapabilitiesElement(convertCanonical(src.getCapabilitiesElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent(); + copyElement(src, tgt); + if (src.hasRequired()) + tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); + if (src.hasValidated()) + tgt.setValidatedElement(convertBoolean(src.getValidatedElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasOrigin()) { + for (org.hl7.fhir.r4.model.IntegerType t : src.getOrigin()) tgt.getOrigin().add(convertInteger(t)); + } + if (src.hasDestination()) + tgt.setDestinationElement(convertInteger(src.getDestinationElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r4.model.UriType t : src.getLink()) tgt.getLink().add(convertUri(t)); + } + if (src.hasCapabilities()) + tgt.setCapabilitiesElement(convertCanonical(src.getCapabilitiesElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent(); - copyElement(src, tgt); - if (src.hasRequired()) - tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); - if (src.hasValidated()) - tgt.setValidatedElement(convertBoolean(src.getValidatedElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.IntegerType t : src.getOrigin()) - tgt.getOrigin().add(convertInteger(t)); - if (src.hasDestination()) - tgt.setDestinationElement(convertInteger(src.getDestinationElement())); - for (org.hl7.fhir.r5.model.UriType t : src.getLink()) - tgt.getLink().add(convertUri(t)); - if (src.hasCapabilities()) - tgt.setCapabilitiesElement(convertCanonical(src.getCapabilitiesElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent(); + copyElement(src, tgt); + if (src.hasRequired()) + tgt.setRequiredElement(convertBoolean(src.getRequiredElement())); + if (src.hasValidated()) + tgt.setValidatedElement(convertBoolean(src.getValidatedElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasOrigin()) { + for (org.hl7.fhir.r5.model.IntegerType t : src.getOrigin()) tgt.getOrigin().add(convertInteger(t)); + } + if (src.hasDestination()) + tgt.setDestinationElement(convertInteger(src.getDestinationElement())); + if (src.hasLink()) { + for (org.hl7.fhir.r5.model.UriType t : src.getLink()) tgt.getLink().add(convertUri(t)); + } + if (src.hasCapabilities()) + tgt.setCapabilitiesElement(convertCanonical(src.getCapabilitiesElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent(); - copyElement(src, tgt); - if (src.hasAutocreate()) - tgt.setAutocreateElement(convertBoolean(src.getAutocreateElement())); - if (src.hasAutodelete()) - tgt.setAutodeleteElement(convertBoolean(src.getAutodeleteElement())); - if (src.hasResource()) - tgt.setResource(convertReference(src.getResource())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent(); + copyElement(src, tgt); + if (src.hasAutocreate()) + tgt.setAutocreateElement(convertBoolean(src.getAutocreateElement())); + if (src.hasAutodelete()) + tgt.setAutodeleteElement(convertBoolean(src.getAutodeleteElement())); + if (src.hasResource()) + tgt.setResource(convertReference(src.getResource())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent(); - copyElement(src, tgt); - if (src.hasAutocreate()) - tgt.setAutocreateElement(convertBoolean(src.getAutocreateElement())); - if (src.hasAutodelete()) - tgt.setAutodeleteElement(convertBoolean(src.getAutodeleteElement())); - if (src.hasResource()) - tgt.setResource(convertReference(src.getResource())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent(); + copyElement(src, tgt); + if (src.hasAutocreate()) + tgt.setAutocreateElement(convertBoolean(src.getAutocreateElement())); + if (src.hasAutodelete()) + tgt.setAutodeleteElement(convertBoolean(src.getAutodeleteElement())); + if (src.hasResource()) + tgt.setResource(convertReference(src.getResource())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDefaultValue()) - tgt.setDefaultValueElement(convertString(src.getDefaultValueElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasHeaderField()) - tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); - if (src.hasHint()) - tgt.setHintElement(convertString(src.getHintElement())); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertId(src.getSourceIdElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValueElement(convertString(src.getDefaultValueElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); + if (src.hasHint()) + tgt.setHintElement(convertString(src.getHintElement())); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertId(src.getSourceIdElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDefaultValue()) - tgt.setDefaultValueElement(convertString(src.getDefaultValueElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasHeaderField()) - tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); - if (src.hasHint()) - tgt.setHintElement(convertString(src.getHintElement())); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertId(src.getSourceIdElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValueElement(convertString(src.getDefaultValueElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); + if (src.hasHint()) + tgt.setHintElement(convertString(src.getHintElement())); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertId(src.getSourceIdElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.SetupActionComponent t : src.getAction()) - tgt.addAction(convertSetupActionComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction()) - tgt.addAction(convertSetupActionComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction()) tgt.addAction(convertSetupActionComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4.model.TestScript.SetupActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4.model.TestScript.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } - public static org.hl7.fhir.r4.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestScript.SetupActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } + public static org.hl7.fhir.r4.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestScript.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } - public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - if (src.hasResource()) - tgt.setResource(org.hl7.fhir.r5.model.TestScript.FHIRDefinedType.fromCode(src.getResource())); - if (src.hasLabel()) - tgt.setLabelElement(convertString(src.getLabelElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasAccept()) - tgt.setAcceptElement(convertCode(src.getAcceptElement())); - if (src.hasContentType()) - tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); - if (src.hasDestination()) - tgt.setDestinationElement(convertInteger(src.getDestinationElement())); - if (src.hasEncodeRequestUrl()) - tgt.setEncodeRequestUrlElement(convertBoolean(src.getEncodeRequestUrlElement())); - if (src.hasMethod()) - tgt.setMethod(convertTestScriptRequestMethodCode(src.getMethod())); - if (src.hasOrigin()) - tgt.setOriginElement(convertInteger(src.getOriginElement())); - if (src.hasParams()) - tgt.setParamsElement(convertString(src.getParamsElement())); - for (org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) - tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - if (src.hasRequestId()) - tgt.setRequestIdElement(convertId(src.getRequestIdElement())); - if (src.hasResponseId()) - tgt.setResponseIdElement(convertId(src.getResponseIdElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertId(src.getSourceIdElement())); - if (src.hasTargetId()) - tgt.setTargetIdElement(convertId(src.getTargetIdElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertString(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent(); - copyElement(src, tgt); - if (src.hasType()) - tgt.setType(convertCoding(src.getType())); - if (src.hasResource()) - tgt.setResource(src.getResource().toCode()); - if (src.hasLabel()) - tgt.setLabelElement(convertString(src.getLabelElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasAccept()) - tgt.setAcceptElement(convertCode(src.getAcceptElement())); - if (src.hasContentType()) - tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); - if (src.hasDestination()) - tgt.setDestinationElement(convertInteger(src.getDestinationElement())); - if (src.hasEncodeRequestUrl()) - tgt.setEncodeRequestUrlElement(convertBoolean(src.getEncodeRequestUrlElement())); - if (src.hasMethod()) - tgt.setMethod(convertTestScriptRequestMethodCode(src.getMethod())); - if (src.hasOrigin()) - tgt.setOriginElement(convertInteger(src.getOriginElement())); - if (src.hasParams()) - tgt.setParamsElement(convertString(src.getParamsElement())); - for (org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) - tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); - if (src.hasRequestId()) - tgt.setRequestIdElement(convertId(src.getRequestIdElement())); - if (src.hasResponseId()) - tgt.setResponseIdElement(convertId(src.getResponseIdElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertId(src.getSourceIdElement())); - if (src.hasTargetId()) - tgt.setTargetIdElement(convertId(src.getTargetIdElement())); - if (src.hasUrl()) - tgt.setUrlElement(convertString(src.getUrlElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode convertTestScriptRequestMethodCode(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DELETE: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.DELETE; - case GET: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.GET; - case OPTIONS: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.OPTIONS; - case PATCH: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PATCH; - case POST: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.POST; - case PUT: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PUT; - case HEAD: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.HEAD; - default: return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode convertTestScriptRequestMethodCode(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case DELETE: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.DELETE; - case GET: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.GET; - case OPTIONS: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.OPTIONS; - case PATCH: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PATCH; - case POST: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.POST; - case PUT: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PUT; - case HEAD: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.HEAD; - default: return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent(); - copyElement(src, tgt); - if (src.hasField()) - tgt.setFieldElement(convertString(src.getFieldElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent(); - copyElement(src, tgt); - if (src.hasField()) - tgt.setFieldElement(convertString(src.getFieldElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent(); - copyElement(src, tgt); - if (src.hasLabel()) - tgt.setLabelElement(convertString(src.getLabelElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasDirection()) - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - if (src.hasCompareToSourceId()) - tgt.setCompareToSourceIdElement(convertString(src.getCompareToSourceIdElement())); - if (src.hasCompareToSourceExpression()) - tgt.setCompareToSourceExpressionElement(convertString(src.getCompareToSourceExpressionElement())); - if (src.hasCompareToSourcePath()) - tgt.setCompareToSourcePathElement(convertString(src.getCompareToSourcePathElement())); - if (src.hasContentType()) - tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasHeaderField()) - tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); - if (src.hasMinimumId()) - tgt.setMinimumIdElement(convertString(src.getMinimumIdElement())); - if (src.hasNavigationLinks()) - tgt.setNavigationLinksElement(convertBoolean(src.getNavigationLinksElement())); - if (src.hasOperator()) - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasRequestMethod()) - tgt.setRequestMethod(convertTestScriptRequestMethodCode(src.getRequestMethod())); - if (src.hasRequestURL()) - tgt.setRequestURLElement(convertString(src.getRequestURLElement())); - if (src.hasResource()) - tgt.setResource(org.hl7.fhir.r5.model.TestScript.FHIRDefinedType.fromCode(src.getResource())); - if (src.hasResponse()) - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - if (src.hasResponseCode()) - tgt.setResponseCodeElement(convertString(src.getResponseCodeElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertId(src.getSourceIdElement())); - if (src.hasValidateProfileId()) - tgt.setValidateProfileIdElement(convertId(src.getValidateProfileIdElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasWarningOnly()) - tgt.setWarningOnlyElement(convertBoolean(src.getWarningOnlyElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent(); - copyElement(src, tgt); - if (src.hasLabel()) - tgt.setLabelElement(convertString(src.getLabelElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - if (src.hasDirection()) - tgt.setDirection(convertAssertionDirectionType(src.getDirection())); - if (src.hasCompareToSourceId()) - tgt.setCompareToSourceIdElement(convertString(src.getCompareToSourceIdElement())); - if (src.hasCompareToSourceExpression()) - tgt.setCompareToSourceExpressionElement(convertString(src.getCompareToSourceExpressionElement())); - if (src.hasCompareToSourcePath()) - tgt.setCompareToSourcePathElement(convertString(src.getCompareToSourcePathElement())); - if (src.hasContentType()) - tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); - if (src.hasExpression()) - tgt.setExpressionElement(convertString(src.getExpressionElement())); - if (src.hasHeaderField()) - tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); - if (src.hasMinimumId()) - tgt.setMinimumIdElement(convertString(src.getMinimumIdElement())); - if (src.hasNavigationLinks()) - tgt.setNavigationLinksElement(convertBoolean(src.getNavigationLinksElement())); - if (src.hasOperator()) - tgt.setOperator(convertAssertionOperatorType(src.getOperator())); - if (src.hasPath()) - tgt.setPathElement(convertString(src.getPathElement())); - if (src.hasRequestMethod()) - tgt.setRequestMethod(convertTestScriptRequestMethodCode(src.getRequestMethod())); - if (src.hasRequestURL()) - tgt.setRequestURLElement(convertString(src.getRequestURLElement())); - if (src.hasResource()) - tgt.setResource(src.getResource().toCode()); - if (src.hasResponse()) - tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); - if (src.hasResponseCode()) - tgt.setResponseCodeElement(convertString(src.getResponseCodeElement())); - if (src.hasSourceId()) - tgt.setSourceIdElement(convertId(src.getSourceIdElement())); - if (src.hasValidateProfileId()) - tgt.setValidateProfileIdElement(convertId(src.getValidateProfileIdElement())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - if (src.hasWarningOnly()) - tgt.setWarningOnlyElement(convertBoolean(src.getWarningOnlyElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestScript.AssertionDirectionType convertAssertionDirectionType(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case RESPONSE: return org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE; - case REQUEST: return org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST; - default: return org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestScript.AssertionDirectionType convertAssertionDirectionType(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case RESPONSE: return org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.RESPONSE; - case REQUEST: return org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.REQUEST; - default: return org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestScript.AssertionOperatorType convertAssertionOperatorType(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQUALS: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS; - case NOTEQUALS: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS; - case IN: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN; - case NOTIN: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN; - case GREATERTHAN: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN; - case LESSTHAN: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN; - case EMPTY: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY; - case NOTEMPTY: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY; - case CONTAINS: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS; - case NOTCONTAINS: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS; - case EVAL: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EVAL; - default: return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestScript.AssertionOperatorType convertAssertionOperatorType(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQUALS: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EQUALS; - case NOTEQUALS: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEQUALS; - case IN: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.IN; - case NOTIN: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTIN; - case GREATERTHAN: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.GREATERTHAN; - case LESSTHAN: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.LESSTHAN; - case EMPTY: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EMPTY; - case NOTEMPTY: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEMPTY; - case CONTAINS: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.CONTAINS; - case NOTCONTAINS: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTCONTAINS; - case EVAL: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EVAL; - default: return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes convertAssertionResponseTypes(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OKAY: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY; - case CREATED: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED; - case NOCONTENT: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT; - case NOTMODIFIED: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED; - case BAD: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BAD; - case FORBIDDEN: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN; - case NOTFOUND: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND; - case METHODNOTALLOWED: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED; - case CONFLICT: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT; - case GONE: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE; - case PRECONDITIONFAILED: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED; - case UNPROCESSABLE: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLE; - default: return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL; - } -} - - public static org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes convertAssertionResponseTypes(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case OKAY: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.OKAY; - case CREATED: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CREATED; - case NOCONTENT: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOCONTENT; - case NOTMODIFIED: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTMODIFIED; - case BAD: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.BAD; - case FORBIDDEN: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.FORBIDDEN; - case NOTFOUND: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTFOUND; - case METHODNOTALLOWED: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED; - case CONFLICT: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CONFLICT; - case GONE: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.GONE; - case PRECONDITIONFAILED: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED; - case UNPROCESSABLE: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.UNPROCESSABLE; - default: return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL; - } -} - - public static org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.TestScript.TestActionComponent t : src.getAction()) - tgt.addAction(convertTestActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasDescription()) - tgt.setDescriptionElement(convertString(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction()) - tgt.addAction(convertTestActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4.model.TestScript.TestActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestScript.TestActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - if (src.hasAssert()) - tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r4.model.TestScript.TeardownActionComponent t : src.getAction()) - tgt.addAction(convertTeardownActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent(); - copyElement(src, tgt); - for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction()) - tgt.addAction(convertTeardownActionComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4.model.TestScript.TeardownActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TeardownActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - return tgt; - } - - public static org.hl7.fhir.r4.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestScript.TeardownActionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TeardownActionComponent(); - copyElement(src, tgt); - if (src.hasOperation()) - tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); - return tgt; - } + public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasResource()) + tgt.setResource(org.hl7.fhir.r5.model.TestScript.FHIRDefinedType.fromCode(src.getResource())); + if (src.hasLabel()) + tgt.setLabelElement(convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasAccept()) + tgt.setAcceptElement(convertCode(src.getAcceptElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); + if (src.hasDestination()) + tgt.setDestinationElement(convertInteger(src.getDestinationElement())); + if (src.hasEncodeRequestUrl()) + tgt.setEncodeRequestUrlElement(convertBoolean(src.getEncodeRequestUrlElement())); + if (src.hasMethod()) + tgt.setMethod(convertTestScriptRequestMethodCode(src.getMethod())); + if (src.hasOrigin()) + tgt.setOriginElement(convertInteger(src.getOriginElement())); + if (src.hasParams()) + tgt.setParamsElement(convertString(src.getParamsElement())); + if (src.hasRequestHeader()) { + for (org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasRequestId()) + tgt.setRequestIdElement(convertId(src.getRequestIdElement())); + if (src.hasResponseId()) + tgt.setResponseIdElement(convertId(src.getResponseIdElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertId(src.getSourceIdElement())); + if (src.hasTargetId()) + tgt.setTargetIdElement(convertId(src.getTargetIdElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertString(src.getUrlElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent(); + copyElement(src, tgt); + if (src.hasType()) + tgt.setType(convertCoding(src.getType())); + if (src.hasResource()) + tgt.setResource(src.getResource().toCode()); + if (src.hasLabel()) + tgt.setLabelElement(convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasAccept()) + tgt.setAcceptElement(convertCode(src.getAcceptElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); + if (src.hasDestination()) + tgt.setDestinationElement(convertInteger(src.getDestinationElement())); + if (src.hasEncodeRequestUrl()) + tgt.setEncodeRequestUrlElement(convertBoolean(src.getEncodeRequestUrlElement())); + if (src.hasMethod()) + tgt.setMethod(convertTestScriptRequestMethodCode(src.getMethod())); + if (src.hasOrigin()) + tgt.setOriginElement(convertInteger(src.getOriginElement())); + if (src.hasParams()) + tgt.setParamsElement(convertString(src.getParamsElement())); + if (src.hasRequestHeader()) { + for (org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + } + if (src.hasRequestId()) + tgt.setRequestIdElement(convertId(src.getRequestIdElement())); + if (src.hasResponseId()) + tgt.setResponseIdElement(convertId(src.getResponseIdElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertId(src.getSourceIdElement())); + if (src.hasTargetId()) + tgt.setTargetIdElement(convertId(src.getTargetIdElement())); + if (src.hasUrl()) + tgt.setUrlElement(convertString(src.getUrlElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode convertTestScriptRequestMethodCode(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DELETE: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.DELETE; + case GET: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.GET; + case OPTIONS: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.OPTIONS; + case PATCH: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PATCH; + case POST: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.POST; + case PUT: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PUT; + case HEAD: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.HEAD; + default: + return org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode convertTestScriptRequestMethodCode(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case DELETE: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.DELETE; + case GET: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.GET; + case OPTIONS: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.OPTIONS; + case PATCH: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PATCH; + case POST: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.POST; + case PUT: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PUT; + case HEAD: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.HEAD; + default: + return org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent(); + copyElement(src, tgt); + if (src.hasField()) + tgt.setFieldElement(convertString(src.getFieldElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent(); + copyElement(src, tgt); + if (src.hasField()) + tgt.setFieldElement(convertString(src.getFieldElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent(); + copyElement(src, tgt); + if (src.hasLabel()) + tgt.setLabelElement(convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasDirection()) + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + if (src.hasCompareToSourceId()) + tgt.setCompareToSourceIdElement(convertString(src.getCompareToSourceIdElement())); + if (src.hasCompareToSourceExpression()) + tgt.setCompareToSourceExpressionElement(convertString(src.getCompareToSourceExpressionElement())); + if (src.hasCompareToSourcePath()) + tgt.setCompareToSourcePathElement(convertString(src.getCompareToSourcePathElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); + if (src.hasMinimumId()) + tgt.setMinimumIdElement(convertString(src.getMinimumIdElement())); + if (src.hasNavigationLinks()) + tgt.setNavigationLinksElement(convertBoolean(src.getNavigationLinksElement())); + if (src.hasOperator()) + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasRequestMethod()) + tgt.setRequestMethod(convertTestScriptRequestMethodCode(src.getRequestMethod())); + if (src.hasRequestURL()) + tgt.setRequestURLElement(convertString(src.getRequestURLElement())); + if (src.hasResource()) + tgt.setResource(org.hl7.fhir.r5.model.TestScript.FHIRDefinedType.fromCode(src.getResource())); + if (src.hasResponse()) + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + if (src.hasResponseCode()) + tgt.setResponseCodeElement(convertString(src.getResponseCodeElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertId(src.getSourceIdElement())); + if (src.hasValidateProfileId()) + tgt.setValidateProfileIdElement(convertId(src.getValidateProfileIdElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasWarningOnly()) + tgt.setWarningOnlyElement(convertBoolean(src.getWarningOnlyElement())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent(); + copyElement(src, tgt); + if (src.hasLabel()) + tgt.setLabelElement(convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasDirection()) + tgt.setDirection(convertAssertionDirectionType(src.getDirection())); + if (src.hasCompareToSourceId()) + tgt.setCompareToSourceIdElement(convertString(src.getCompareToSourceIdElement())); + if (src.hasCompareToSourceExpression()) + tgt.setCompareToSourceExpressionElement(convertString(src.getCompareToSourceExpressionElement())); + if (src.hasCompareToSourcePath()) + tgt.setCompareToSourcePathElement(convertString(src.getCompareToSourcePathElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(convertCode(src.getContentTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(convertString(src.getHeaderFieldElement())); + if (src.hasMinimumId()) + tgt.setMinimumIdElement(convertString(src.getMinimumIdElement())); + if (src.hasNavigationLinks()) + tgt.setNavigationLinksElement(convertBoolean(src.getNavigationLinksElement())); + if (src.hasOperator()) + tgt.setOperator(convertAssertionOperatorType(src.getOperator())); + if (src.hasPath()) + tgt.setPathElement(convertString(src.getPathElement())); + if (src.hasRequestMethod()) + tgt.setRequestMethod(convertTestScriptRequestMethodCode(src.getRequestMethod())); + if (src.hasRequestURL()) + tgt.setRequestURLElement(convertString(src.getRequestURLElement())); + if (src.hasResource()) + tgt.setResource(src.getResource().toCode()); + if (src.hasResponse()) + tgt.setResponse(convertAssertionResponseTypes(src.getResponse())); + if (src.hasResponseCode()) + tgt.setResponseCodeElement(convertString(src.getResponseCodeElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(convertId(src.getSourceIdElement())); + if (src.hasValidateProfileId()) + tgt.setValidateProfileIdElement(convertId(src.getValidateProfileIdElement())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + if (src.hasWarningOnly()) + tgt.setWarningOnlyElement(convertBoolean(src.getWarningOnlyElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.AssertionDirectionType convertAssertionDirectionType(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case RESPONSE: + return org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE; + case REQUEST: + return org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST; + default: + return org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestScript.AssertionDirectionType convertAssertionDirectionType(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case RESPONSE: + return org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.RESPONSE; + case REQUEST: + return org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.REQUEST; + default: + return org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestScript.AssertionOperatorType convertAssertionOperatorType(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQUALS: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS; + case NOTEQUALS: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS; + case IN: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN; + case NOTIN: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN; + case GREATERTHAN: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN; + case LESSTHAN: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN; + case EMPTY: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY; + case NOTEMPTY: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY; + case CONTAINS: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS; + case NOTCONTAINS: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS; + case EVAL: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EVAL; + default: + return org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestScript.AssertionOperatorType convertAssertionOperatorType(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQUALS: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EQUALS; + case NOTEQUALS: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEQUALS; + case IN: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.IN; + case NOTIN: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTIN; + case GREATERTHAN: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.GREATERTHAN; + case LESSTHAN: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.LESSTHAN; + case EMPTY: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EMPTY; + case NOTEMPTY: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEMPTY; + case CONTAINS: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.CONTAINS; + case NOTCONTAINS: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTCONTAINS; + case EVAL: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EVAL; + default: + return org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes convertAssertionResponseTypes(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OKAY: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY; + case CREATED: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED; + case NOCONTENT: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT; + case NOTMODIFIED: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED; + case BAD: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BAD; + case FORBIDDEN: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN; + case NOTFOUND: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND; + case METHODNOTALLOWED: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED; + case CONFLICT: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT; + case GONE: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE; + case PRECONDITIONFAILED: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED; + case UNPROCESSABLE: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLE; + default: + return org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL; + } + } + + public static org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes convertAssertionResponseTypes(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case OKAY: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.OKAY; + case CREATED: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CREATED; + case NOCONTENT: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOCONTENT; + case NOTMODIFIED: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTMODIFIED; + case BAD: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.BAD; + case FORBIDDEN: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.FORBIDDEN; + case NOTFOUND: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTFOUND; + case METHODNOTALLOWED: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED; + case CONFLICT: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CONFLICT; + case GONE: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.GONE; + case PRECONDITIONFAILED: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED; + case UNPROCESSABLE: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.UNPROCESSABLE; + default: + return org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL; + } + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4.model.TestScript.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestScript.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r4.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent(); + copyElement(src, tgt); + if (src.hasAction()) { + for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction()) tgt.addAction(convertTeardownActionComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4.model.TestScript.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TeardownActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + return tgt; + } + + public static org.hl7.fhir.r4.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestScript.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TeardownActionComponent(); + copyElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ValueSet.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ValueSet.java index 086b6690a..429e7abeb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ValueSet.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ValueSet.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,397 +50,440 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class ValueSet extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.ValueSet convertValueSet(org.hl7.fhir.r4.model.ValueSet src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasImmutable()) - tgt.setImmutableElement(convertBoolean(src.getImmutableElement())); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasCompose()) - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); - if (src.hasExpansion()) - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); - return tgt; - } + public static org.hl7.fhir.r5.model.ValueSet convertValueSet(org.hl7.fhir.r4.model.ValueSet src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasImmutable()) + tgt.setImmutableElement(convertBoolean(src.getImmutableElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasCompose()) + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasExpansion()) + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + return tgt; + } - public static org.hl7.fhir.r4.model.ValueSet convertValueSet(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet tgt = new org.hl7.fhir.r4.model.ValueSet(); - copyDomainResource(src, tgt); - if (src.hasUrl()) - tgt.setUrlElement(convertUri(src.getUrlElement())); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasTitle()) - tgt.setTitleElement(convertString(src.getTitleElement())); - if (src.hasStatus()) - tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); - if (src.hasDate()) - tgt.setDateElement(convertDateTime(src.getDateElement())); - if (src.hasPublisher()) - tgt.setPublisherElement(convertString(src.getPublisherElement())); - for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) - tgt.addContact(convertContactDetail(t)); - if (src.hasDescription()) - tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); - for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) - tgt.addUseContext(convertUsageContext(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) - tgt.addJurisdiction(convertCodeableConcept(t)); - if (src.hasImmutable()) - tgt.setImmutableElement(convertBoolean(src.getImmutableElement())); - if (src.hasPurpose()) - tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); - if (src.hasCopyright()) - tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); - if (src.hasCompose()) - tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); - if (src.hasExpansion()) - tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); - return tgt; - } + public static org.hl7.fhir.r4.model.ValueSet convertValueSet(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet tgt = new org.hl7.fhir.r4.model.ValueSet(); + copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(convertUri(src.getUrlElement())); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus())); + if (src.hasExperimental()) + tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(convertString(src.getPublisherElement())); + if (src.hasContact()) { + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t)); + } + if (src.hasDescription()) + tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement())); + if (src.hasUseContext()) { + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t)); + } + if (src.hasJurisdiction()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t)); + } + if (src.hasImmutable()) + tgt.setImmutableElement(convertBoolean(src.getImmutableElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement())); + if (src.hasCompose()) + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasExpansion()) + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + return tgt; + } - public static org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent(); - copyElement(src, tgt); - if (src.hasLockedDate()) - tgt.setLockedDateElement(convertDate(src.getLockedDateElement())); - if (src.hasInactive()) - tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getInclude()) - tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) - tgt.addExclude(convertConceptSetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent(); + copyElement(src, tgt); + if (src.hasLockedDate()) + tgt.setLockedDateElement(convertDate(src.getLockedDateElement())); + if (src.hasInactive()) + tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); + if (src.hasInclude()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent(); - copyElement(src, tgt); - if (src.hasLockedDate()) - tgt.setLockedDateElement(convertDate(src.getLockedDateElement())); - if (src.hasInactive()) - tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getInclude()) - tgt.addInclude(convertConceptSetComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) - tgt.addExclude(convertConceptSetComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent(); + copyElement(src, tgt); + if (src.hasLockedDate()) + tgt.setLockedDateElement(convertDate(src.getLockedDateElement())); + if (src.hasInactive()) + tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); + if (src.hasInclude()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getInclude()) tgt.addInclude(convertConceptSetComponent(t)); + } + if (src.hasExclude()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) tgt.addExclude(convertConceptSetComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent(); - copyElement(src, tgt); - if (src.hasSystem()) - tgt.setSystemElement(convertUri(src.getSystemElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) - tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) - tgt.addFilter(convertConceptSetFilterComponent(t)); - for (org.hl7.fhir.r4.model.CanonicalType t : src.getValueSet()) - tgt.getValueSet().add(convertCanonical(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent(); + copyElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(convertUri(src.getSystemElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasConcept()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } + if (src.hasValueSet()) { + for (org.hl7.fhir.r4.model.CanonicalType t : src.getValueSet()) tgt.getValueSet().add(convertCanonical(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent(); - copyElement(src, tgt); - if (src.hasSystem()) - tgt.setSystemElement(convertUri(src.getSystemElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) - tgt.addConcept(convertConceptReferenceComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) - tgt.addFilter(convertConceptSetFilterComponent(t)); - for (org.hl7.fhir.r5.model.CanonicalType t : src.getValueSet()) - tgt.getValueSet().add(convertCanonical(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent(); + copyElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(convertUri(src.getSystemElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasConcept()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); + } + if (src.hasFilter()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) tgt.addFilter(convertConceptSetFilterComponent(t)); + } + if (src.hasValueSet()) { + for (org.hl7.fhir.r5.model.CanonicalType t : src.getValueSet()) tgt.getValueSet().add(convertCanonical(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) - tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent(); - copyElement(src, tgt); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) - tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - return tgt; - } + public static org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent(); + copyElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + return tgt; + } - public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguageElement(convertCode(src.getLanguageElement())); - if (src.hasUse()) - tgt.setUse(convertCoding(src.getUse())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } + public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } - public static org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent(); - copyElement(src, tgt); - if (src.hasLanguage()) - tgt.setLanguageElement(convertCode(src.getLanguageElement())); - if (src.hasUse()) - tgt.setUse(convertCoding(src.getUse())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } + public static org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent(); + copyElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } - public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent(); - copyElement(src, tgt); - if (src.hasProperty()) - tgt.setPropertyElement(convertCode(src.getPropertyElement())); - if (src.hasOp()) - tgt.setOp(convertFilterOperator(src.getOp())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent(); - copyElement(src, tgt); - if (src.hasProperty()) - tgt.setPropertyElement(convertCode(src.getPropertyElement())); - if (src.hasOp()) - tgt.setOp(convertFilterOperator(src.getOp())); - if (src.hasValue()) - tgt.setValueElement(convertString(src.getValueElement())); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FilterOperator convertFilterOperator(org.hl7.fhir.r4.model.ValueSet.FilterOperator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQUAL: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL; - case ISA: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA; - case DESCENDENTOF: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF; - case ISNOTA: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA; - case REGEX: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX; - case IN: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN; - case NOTIN: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN; - case GENERALIZES: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES; - case EXISTS: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS; - default: return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL; - } -} - - public static org.hl7.fhir.r4.model.ValueSet.FilterOperator convertFilterOperator(org.hl7.fhir.r5.model.Enumerations.FilterOperator src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case EQUAL: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.EQUAL; - case ISA: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISA; - case DESCENDENTOF: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.DESCENDENTOF; - case ISNOTA: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISNOTA; - case REGEX: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.REGEX; - case IN: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.IN; - case NOTIN: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.NOTIN; - case GENERALIZES: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.GENERALIZES; - case EXISTS: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.EXISTS; - default: return org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL; - } -} - - public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifierElement(convertUri(src.getIdentifierElement())); - if (src.hasTimestamp()) - tgt.setTimestampElement(convertDateTime(src.getTimestampElement())); - if (src.hasTotal()) - tgt.setTotalElement(convertInteger(src.getTotalElement())); - if (src.hasOffset()) - tgt.setOffsetElement(convertInteger(src.getOffsetElement())); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) - tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) - tgt.addContains(convertValueSetExpansionContainsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent(); - copyElement(src, tgt); - if (src.hasIdentifier()) - tgt.setIdentifierElement(convertUri(src.getIdentifierElement())); - if (src.hasTimestamp()) - tgt.setTimestampElement(convertDateTime(src.getTimestampElement())); - if (src.hasTotal()) - tgt.setTotalElement(convertInteger(src.getTotalElement())); - if (src.hasOffset()) - tgt.setOffsetElement(convertInteger(src.getOffsetElement())); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) - tgt.addParameter(convertValueSetExpansionParameterComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) - tgt.addContains(convertValueSetExpansionContainsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent(); - copyElement(src, tgt); - if (src.hasName()) - tgt.setNameElement(convertString(src.getNameElement())); - if (src.hasValue()) - tgt.setValue(convertType(src.getValue())); - return tgt; - } - - public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent(); - copyElement(src, tgt); - if (src.hasSystem()) - tgt.setSystemElement(convertUri(src.getSystemElement())); - if (src.hasAbstract()) - tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); - if (src.hasInactive()) - tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) - tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) - tgt.addContains(convertValueSetExpansionContainsComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent(); - copyElement(src, tgt); - if (src.hasSystem()) - tgt.setSystemElement(convertUri(src.getSystemElement())); - if (src.hasAbstract()) - tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); - if (src.hasInactive()) - tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); - if (src.hasVersion()) - tgt.setVersionElement(convertString(src.getVersionElement())); - if (src.hasCode()) - tgt.setCodeElement(convertCode(src.getCodeElement())); - if (src.hasDisplay()) - tgt.setDisplayElement(convertString(src.getDisplayElement())); - for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) - tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); - for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) - tgt.addContains(convertValueSetExpansionContainsComponent(t)); - return tgt; - } + public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent(); + copyElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(convertCode(src.getPropertyElement())); + if (src.hasOp()) + tgt.setOp(convertFilterOperator(src.getOp())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + public static org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent(); + copyElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(convertCode(src.getPropertyElement())); + if (src.hasOp()) + tgt.setOp(convertFilterOperator(src.getOp())); + if (src.hasValue()) + tgt.setValueElement(convertString(src.getValueElement())); + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FilterOperator convertFilterOperator(org.hl7.fhir.r4.model.ValueSet.FilterOperator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQUAL: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL; + case ISA: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA; + case DESCENDENTOF: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF; + case ISNOTA: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA; + case REGEX: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX; + case IN: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN; + case NOTIN: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN; + case GENERALIZES: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES; + case EXISTS: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS; + default: + return org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL; + } + } + + public static org.hl7.fhir.r4.model.ValueSet.FilterOperator convertFilterOperator(org.hl7.fhir.r5.model.Enumerations.FilterOperator src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case EQUAL: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.EQUAL; + case ISA: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISA; + case DESCENDENTOF: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.DESCENDENTOF; + case ISNOTA: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISNOTA; + case REGEX: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.REGEX; + case IN: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.IN; + case NOTIN: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.NOTIN; + case GENERALIZES: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.GENERALIZES; + case EXISTS: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.EXISTS; + default: + return org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL; + } + } + + public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifierElement(convertUri(src.getIdentifierElement())); + if (src.hasTimestamp()) + tgt.setTimestampElement(convertDateTime(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(convertInteger(src.getTotalElement())); + if (src.hasOffset()) + tgt.setOffsetElement(convertInteger(src.getOffsetElement())); + if (src.hasParameter()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent(); + copyElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifierElement(convertUri(src.getIdentifierElement())); + if (src.hasTimestamp()) + tgt.setTimestampElement(convertDateTime(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(convertInteger(src.getTotalElement())); + if (src.hasOffset()) + tgt.setOffsetElement(convertInteger(src.getOffsetElement())); + if (src.hasParameter()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent(); + copyElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent(); + copyElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(convertUri(src.getSystemElement())); + if (src.hasAbstract()) + tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); + if (src.hasInactive()) + tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasDesignation()) { + for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent(); + copyElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(convertUri(src.getSystemElement())); + if (src.hasAbstract()) + tgt.setAbstractElement(convertBoolean(src.getAbstractElement())); + if (src.hasInactive()) + tgt.setInactiveElement(convertBoolean(src.getInactiveElement())); + if (src.hasVersion()) + tgt.setVersionElement(convertString(src.getVersionElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(convertString(src.getDisplayElement())); + if (src.hasDesignation()) { + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + } + if (src.hasContains()) { + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); + } + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VerificationResult.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VerificationResult.java index 749870cdd..c797ef28b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VerificationResult.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VerificationResult.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,231 +50,256 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class VerificationResult extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.VerificationResult convertVerificationResult(org.hl7.fhir.r4.model.VerificationResult src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.VerificationResult tgt = new org.hl7.fhir.r5.model.VerificationResult(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Reference t : src.getTarget()) - tgt.addTarget(convertReference(t)); - for (org.hl7.fhir.r4.model.StringType t : src.getTargetLocation()) - tgt.getTargetLocation().add(convertString(t)); - if (src.hasNeed()) - tgt.setNeed(convertCodeableConcept(src.getNeed())); - if (src.hasStatus()) - tgt.setStatus(convertStatus(src.getStatus())); - if (src.hasStatusDate()) - tgt.setStatusDateElement(convertDateTime(src.getStatusDateElement())); - if (src.hasValidationType()) - tgt.setValidationType(convertCodeableConcept(src.getValidationType())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValidationProcess()) - tgt.addValidationProcess(convertCodeableConcept(t)); - if (src.hasFrequency()) - tgt.setFrequency(convertTiming(src.getFrequency())); - if (src.hasLastPerformed()) - tgt.setLastPerformedElement(convertDateTime(src.getLastPerformedElement())); - if (src.hasNextScheduled()) - tgt.setNextScheduledElement(convertDate(src.getNextScheduledElement())); - if (src.hasFailureAction()) - tgt.setFailureAction(convertCodeableConcept(src.getFailureAction())); - for (org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent t : src.getPrimarySource()) - tgt.addPrimarySource(convertVerificationResultPrimarySourceComponent(t)); - if (src.hasAttestation()) - tgt.setAttestation(convertVerificationResultAttestationComponent(src.getAttestation())); - for (org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent t : src.getValidator()) - tgt.addValidator(convertVerificationResultValidatorComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.VerificationResult convertVerificationResult(org.hl7.fhir.r5.model.VerificationResult src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.VerificationResult tgt = new org.hl7.fhir.r4.model.VerificationResult(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Reference t : src.getTarget()) - tgt.addTarget(convertReference(t)); - for (org.hl7.fhir.r5.model.StringType t : src.getTargetLocation()) - tgt.getTargetLocation().add(convertString(t)); - if (src.hasNeed()) - tgt.setNeed(convertCodeableConcept(src.getNeed())); - if (src.hasStatus()) - tgt.setStatus(convertStatus(src.getStatus())); - if (src.hasStatusDate()) - tgt.setStatusDateElement(convertDateTime(src.getStatusDateElement())); - if (src.hasValidationType()) - tgt.setValidationType(convertCodeableConcept(src.getValidationType())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValidationProcess()) - tgt.addValidationProcess(convertCodeableConcept(t)); - if (src.hasFrequency()) - tgt.setFrequency(convertTiming(src.getFrequency())); - if (src.hasLastPerformed()) - tgt.setLastPerformedElement(convertDateTime(src.getLastPerformedElement())); - if (src.hasNextScheduled()) - tgt.setNextScheduledElement(convertDate(src.getNextScheduledElement())); - if (src.hasFailureAction()) - tgt.setFailureAction(convertCodeableConcept(src.getFailureAction())); - for (org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent t : src.getPrimarySource()) - tgt.addPrimarySource(convertVerificationResultPrimarySourceComponent(t)); - if (src.hasAttestation()) - tgt.setAttestation(convertVerificationResultAttestationComponent(src.getAttestation())); - for (org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent t : src.getValidator()) - tgt.addValidator(convertVerificationResultValidatorComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.VerificationResult.Status convertStatus(org.hl7.fhir.r4.model.VerificationResult.Status src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ATTESTED: return org.hl7.fhir.r5.model.VerificationResult.Status.ATTESTED; - case VALIDATED: return org.hl7.fhir.r5.model.VerificationResult.Status.VALIDATED; - case INPROCESS: return org.hl7.fhir.r5.model.VerificationResult.Status.INPROCESS; - case REQREVALID: return org.hl7.fhir.r5.model.VerificationResult.Status.REQREVALID; - case VALFAIL: return org.hl7.fhir.r5.model.VerificationResult.Status.VALFAIL; - case REVALFAIL: return org.hl7.fhir.r5.model.VerificationResult.Status.REVALFAIL; - default: return org.hl7.fhir.r5.model.VerificationResult.Status.NULL; - } -} - - public static org.hl7.fhir.r4.model.VerificationResult.Status convertStatus(org.hl7.fhir.r5.model.VerificationResult.Status src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ATTESTED: return org.hl7.fhir.r4.model.VerificationResult.Status.ATTESTED; - case VALIDATED: return org.hl7.fhir.r4.model.VerificationResult.Status.VALIDATED; - case INPROCESS: return org.hl7.fhir.r4.model.VerificationResult.Status.INPROCESS; - case REQREVALID: return org.hl7.fhir.r4.model.VerificationResult.Status.REQREVALID; - case VALFAIL: return org.hl7.fhir.r4.model.VerificationResult.Status.VALFAIL; - case REVALFAIL: return org.hl7.fhir.r4.model.VerificationResult.Status.REVALFAIL; - default: return org.hl7.fhir.r4.model.VerificationResult.Status.NULL; - } -} - - public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent(); - copyElement(src, tgt); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunicationMethod()) - tgt.addCommunicationMethod(convertCodeableConcept(t)); - if (src.hasValidationStatus()) - tgt.setValidationStatus(convertCodeableConcept(src.getValidationStatus())); - if (src.hasValidationDate()) - tgt.setValidationDateElement(convertDateTime(src.getValidationDateElement())); - if (src.hasCanPushUpdates()) - tgt.setCanPushUpdates(convertCodeableConcept(src.getCanPushUpdates())); - for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPushTypeAvailable()) - tgt.addPushTypeAvailable(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent tgt = new org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent(); - copyElement(src, tgt); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) - tgt.addType(convertCodeableConcept(t)); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunicationMethod()) - tgt.addCommunicationMethod(convertCodeableConcept(t)); - if (src.hasValidationStatus()) - tgt.setValidationStatus(convertCodeableConcept(src.getValidationStatus())); - if (src.hasValidationDate()) - tgt.setValidationDateElement(convertDateTime(src.getValidationDateElement())); - if (src.hasCanPushUpdates()) - tgt.setCanPushUpdates(convertCodeableConcept(src.getCanPushUpdates())); - for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPushTypeAvailable()) - tgt.addPushTypeAvailable(convertCodeableConcept(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent convertVerificationResultAttestationComponent(org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent(); - copyElement(src, tgt); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - if (src.hasCommunicationMethod()) - tgt.setCommunicationMethod(convertCodeableConcept(src.getCommunicationMethod())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasSourceIdentityCertificate()) - tgt.setSourceIdentityCertificateElement(convertString(src.getSourceIdentityCertificateElement())); - if (src.hasProxyIdentityCertificate()) - tgt.setProxyIdentityCertificateElement(convertString(src.getProxyIdentityCertificateElement())); - if (src.hasProxySignature()) - tgt.setProxySignature(convertSignature(src.getProxySignature())); - if (src.hasSourceSignature()) - tgt.setSourceSignature(convertSignature(src.getSourceSignature())); - return tgt; - } - - public static org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent convertVerificationResultAttestationComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent tgt = new org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent(); - copyElement(src, tgt); - if (src.hasWho()) - tgt.setWho(convertReference(src.getWho())); - if (src.hasOnBehalfOf()) - tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); - if (src.hasCommunicationMethod()) - tgt.setCommunicationMethod(convertCodeableConcept(src.getCommunicationMethod())); - if (src.hasDate()) - tgt.setDateElement(convertDate(src.getDateElement())); - if (src.hasSourceIdentityCertificate()) - tgt.setSourceIdentityCertificateElement(convertString(src.getSourceIdentityCertificateElement())); - if (src.hasProxyIdentityCertificate()) - tgt.setProxyIdentityCertificateElement(convertString(src.getProxyIdentityCertificateElement())); - if (src.hasProxySignature()) - tgt.setProxySignature(convertSignature(src.getProxySignature())); - if (src.hasSourceSignature()) - tgt.setSourceSignature(convertSignature(src.getSourceSignature())); - return tgt; - } - - public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent convertVerificationResultValidatorComponent(org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent(); - copyElement(src, tgt); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasIdentityCertificate()) - tgt.setIdentityCertificateElement(convertString(src.getIdentityCertificateElement())); - if (src.hasAttestationSignature()) - tgt.setAttestationSignature(convertSignature(src.getAttestationSignature())); - return tgt; - } - - public static org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent convertVerificationResultValidatorComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent tgt = new org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent(); - copyElement(src, tgt); - if (src.hasOrganization()) - tgt.setOrganization(convertReference(src.getOrganization())); - if (src.hasIdentityCertificate()) - tgt.setIdentityCertificateElement(convertString(src.getIdentityCertificateElement())); - if (src.hasAttestationSignature()) - tgt.setAttestationSignature(convertSignature(src.getAttestationSignature())); - return tgt; - } + public static org.hl7.fhir.r5.model.VerificationResult convertVerificationResult(org.hl7.fhir.r4.model.VerificationResult src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult tgt = new org.hl7.fhir.r5.model.VerificationResult(); + copyDomainResource(src, tgt); + if (src.hasTarget()) { + for (org.hl7.fhir.r4.model.Reference t : src.getTarget()) tgt.addTarget(convertReference(t)); + } + if (src.hasTargetLocation()) { + for (org.hl7.fhir.r4.model.StringType t : src.getTargetLocation()) tgt.getTargetLocation().add(convertString(t)); + } + if (src.hasNeed()) + tgt.setNeed(convertCodeableConcept(src.getNeed())); + if (src.hasStatus()) + tgt.setStatus(convertStatus(src.getStatus())); + if (src.hasStatusDate()) + tgt.setStatusDateElement(convertDateTime(src.getStatusDateElement())); + if (src.hasValidationType()) + tgt.setValidationType(convertCodeableConcept(src.getValidationType())); + if (src.hasValidationProcess()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValidationProcess()) tgt.addValidationProcess(convertCodeableConcept(t)); + } + if (src.hasFrequency()) + tgt.setFrequency(convertTiming(src.getFrequency())); + if (src.hasLastPerformed()) + tgt.setLastPerformedElement(convertDateTime(src.getLastPerformedElement())); + if (src.hasNextScheduled()) + tgt.setNextScheduledElement(convertDate(src.getNextScheduledElement())); + if (src.hasFailureAction()) + tgt.setFailureAction(convertCodeableConcept(src.getFailureAction())); + if (src.hasPrimarySource()) { + for (org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent t : src.getPrimarySource()) tgt.addPrimarySource(convertVerificationResultPrimarySourceComponent(t)); + } + if (src.hasAttestation()) + tgt.setAttestation(convertVerificationResultAttestationComponent(src.getAttestation())); + if (src.hasValidator()) { + for (org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent t : src.getValidator()) tgt.addValidator(convertVerificationResultValidatorComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.VerificationResult convertVerificationResult(org.hl7.fhir.r5.model.VerificationResult src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.VerificationResult tgt = new org.hl7.fhir.r4.model.VerificationResult(); + copyDomainResource(src, tgt); + if (src.hasTarget()) { + for (org.hl7.fhir.r5.model.Reference t : src.getTarget()) tgt.addTarget(convertReference(t)); + } + if (src.hasTargetLocation()) { + for (org.hl7.fhir.r5.model.StringType t : src.getTargetLocation()) tgt.getTargetLocation().add(convertString(t)); + } + if (src.hasNeed()) + tgt.setNeed(convertCodeableConcept(src.getNeed())); + if (src.hasStatus()) + tgt.setStatus(convertStatus(src.getStatus())); + if (src.hasStatusDate()) + tgt.setStatusDateElement(convertDateTime(src.getStatusDateElement())); + if (src.hasValidationType()) + tgt.setValidationType(convertCodeableConcept(src.getValidationType())); + if (src.hasValidationProcess()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValidationProcess()) tgt.addValidationProcess(convertCodeableConcept(t)); + } + if (src.hasFrequency()) + tgt.setFrequency(convertTiming(src.getFrequency())); + if (src.hasLastPerformed()) + tgt.setLastPerformedElement(convertDateTime(src.getLastPerformedElement())); + if (src.hasNextScheduled()) + tgt.setNextScheduledElement(convertDate(src.getNextScheduledElement())); + if (src.hasFailureAction()) + tgt.setFailureAction(convertCodeableConcept(src.getFailureAction())); + if (src.hasPrimarySource()) { + for (org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent t : src.getPrimarySource()) tgt.addPrimarySource(convertVerificationResultPrimarySourceComponent(t)); + } + if (src.hasAttestation()) + tgt.setAttestation(convertVerificationResultAttestationComponent(src.getAttestation())); + if (src.hasValidator()) { + for (org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent t : src.getValidator()) tgt.addValidator(convertVerificationResultValidatorComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.VerificationResult.Status convertStatus(org.hl7.fhir.r4.model.VerificationResult.Status src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ATTESTED: + return org.hl7.fhir.r5.model.VerificationResult.Status.ATTESTED; + case VALIDATED: + return org.hl7.fhir.r5.model.VerificationResult.Status.VALIDATED; + case INPROCESS: + return org.hl7.fhir.r5.model.VerificationResult.Status.INPROCESS; + case REQREVALID: + return org.hl7.fhir.r5.model.VerificationResult.Status.REQREVALID; + case VALFAIL: + return org.hl7.fhir.r5.model.VerificationResult.Status.VALFAIL; + case REVALFAIL: + return org.hl7.fhir.r5.model.VerificationResult.Status.REVALFAIL; + default: + return org.hl7.fhir.r5.model.VerificationResult.Status.NULL; + } + } + + public static org.hl7.fhir.r4.model.VerificationResult.Status convertStatus(org.hl7.fhir.r5.model.VerificationResult.Status src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ATTESTED: + return org.hl7.fhir.r4.model.VerificationResult.Status.ATTESTED; + case VALIDATED: + return org.hl7.fhir.r4.model.VerificationResult.Status.VALIDATED; + case INPROCESS: + return org.hl7.fhir.r4.model.VerificationResult.Status.INPROCESS; + case REQREVALID: + return org.hl7.fhir.r4.model.VerificationResult.Status.REQREVALID; + case VALFAIL: + return org.hl7.fhir.r4.model.VerificationResult.Status.VALFAIL; + case REVALFAIL: + return org.hl7.fhir.r4.model.VerificationResult.Status.REVALFAIL; + default: + return org.hl7.fhir.r4.model.VerificationResult.Status.NULL; + } + } + + public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent(); + copyElement(src, tgt); + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasType()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasCommunicationMethod()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunicationMethod()) tgt.addCommunicationMethod(convertCodeableConcept(t)); + } + if (src.hasValidationStatus()) + tgt.setValidationStatus(convertCodeableConcept(src.getValidationStatus())); + if (src.hasValidationDate()) + tgt.setValidationDateElement(convertDateTime(src.getValidationDateElement())); + if (src.hasCanPushUpdates()) + tgt.setCanPushUpdates(convertCodeableConcept(src.getCanPushUpdates())); + if (src.hasPushTypeAvailable()) { + for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPushTypeAvailable()) tgt.addPushTypeAvailable(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent tgt = new org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent(); + copyElement(src, tgt); + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasType()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) tgt.addType(convertCodeableConcept(t)); + } + if (src.hasCommunicationMethod()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunicationMethod()) tgt.addCommunicationMethod(convertCodeableConcept(t)); + } + if (src.hasValidationStatus()) + tgt.setValidationStatus(convertCodeableConcept(src.getValidationStatus())); + if (src.hasValidationDate()) + tgt.setValidationDateElement(convertDateTime(src.getValidationDateElement())); + if (src.hasCanPushUpdates()) + tgt.setCanPushUpdates(convertCodeableConcept(src.getCanPushUpdates())); + if (src.hasPushTypeAvailable()) { + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPushTypeAvailable()) tgt.addPushTypeAvailable(convertCodeableConcept(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent convertVerificationResultAttestationComponent(org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent(); + copyElement(src, tgt); + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + if (src.hasCommunicationMethod()) + tgt.setCommunicationMethod(convertCodeableConcept(src.getCommunicationMethod())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasSourceIdentityCertificate()) + tgt.setSourceIdentityCertificateElement(convertString(src.getSourceIdentityCertificateElement())); + if (src.hasProxyIdentityCertificate()) + tgt.setProxyIdentityCertificateElement(convertString(src.getProxyIdentityCertificateElement())); + if (src.hasProxySignature()) + tgt.setProxySignature(convertSignature(src.getProxySignature())); + if (src.hasSourceSignature()) + tgt.setSourceSignature(convertSignature(src.getSourceSignature())); + return tgt; + } + + public static org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent convertVerificationResultAttestationComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent tgt = new org.hl7.fhir.r4.model.VerificationResult.VerificationResultAttestationComponent(); + copyElement(src, tgt); + if (src.hasWho()) + tgt.setWho(convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf())); + if (src.hasCommunicationMethod()) + tgt.setCommunicationMethod(convertCodeableConcept(src.getCommunicationMethod())); + if (src.hasDate()) + tgt.setDateElement(convertDate(src.getDateElement())); + if (src.hasSourceIdentityCertificate()) + tgt.setSourceIdentityCertificateElement(convertString(src.getSourceIdentityCertificateElement())); + if (src.hasProxyIdentityCertificate()) + tgt.setProxyIdentityCertificateElement(convertString(src.getProxyIdentityCertificateElement())); + if (src.hasProxySignature()) + tgt.setProxySignature(convertSignature(src.getProxySignature())); + if (src.hasSourceSignature()) + tgt.setSourceSignature(convertSignature(src.getSourceSignature())); + return tgt; + } + + public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent convertVerificationResultValidatorComponent(org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent(); + copyElement(src, tgt); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasIdentityCertificate()) + tgt.setIdentityCertificateElement(convertString(src.getIdentityCertificateElement())); + if (src.hasAttestationSignature()) + tgt.setAttestationSignature(convertSignature(src.getAttestationSignature())); + return tgt; + } + + public static org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent convertVerificationResultValidatorComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent tgt = new org.hl7.fhir.r4.model.VerificationResult.VerificationResultValidatorComponent(); + copyElement(src, tgt); + if (src.hasOrganization()) + tgt.setOrganization(convertReference(src.getOrganization())); + if (src.hasIdentityCertificate()) + tgt.setIdentityCertificateElement(convertString(src.getIdentityCertificateElement())); + if (src.hasAttestationSignature()) + tgt.setAttestationSignature(convertSignature(src.getAttestationSignature())); + return tgt; + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VisionPrescription.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VisionPrescription.java index ed81691d5..0c7c9d50e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VisionPrescription.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/VisionPrescription.java @@ -19,13 +19,9 @@ package org.hl7.fhir.convertors.conv40_50; * limitations under the License. * #L% */ - - import org.hl7.fhir.exceptions.FHIRException; - import org.hl7.fhir.convertors.VersionConvertor_40_50; - /* Copyright (c) 2011+, HL7, Inc. All rights reserved. @@ -54,223 +50,252 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50; POSSIBILITY OF SUCH DAMAGE. */ - // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 - - public class VisionPrescription extends VersionConvertor_40_50 { - public static org.hl7.fhir.r5.model.VisionPrescription convertVisionPrescription(org.hl7.fhir.r4.model.VisionPrescription src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.VisionPrescription tgt = new org.hl7.fhir.r5.model.VisionPrescription(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertVisionStatus(src.getStatus())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDateWritten()) - tgt.setDateWrittenElement(convertDateTime(src.getDateWrittenElement())); - if (src.hasPrescriber()) - tgt.setPrescriber(convertReference(src.getPrescriber())); - for (org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent t : src.getLensSpecification()) - tgt.addLensSpecification(convertVisionPrescriptionLensSpecificationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.VisionPrescription convertVisionPrescription(org.hl7.fhir.r5.model.VisionPrescription src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.VisionPrescription tgt = new org.hl7.fhir.r4.model.VisionPrescription(); - copyDomainResource(src, tgt); - for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) - tgt.addIdentifier(convertIdentifier(t)); - if (src.hasStatus()) - tgt.setStatus(convertVisionStatus(src.getStatus())); - if (src.hasCreated()) - tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); - if (src.hasPatient()) - tgt.setPatient(convertReference(src.getPatient())); - if (src.hasEncounter()) - tgt.setEncounter(convertReference(src.getEncounter())); - if (src.hasDateWritten()) - tgt.setDateWrittenElement(convertDateTime(src.getDateWrittenElement())); - if (src.hasPrescriber()) - tgt.setPrescriber(convertReference(src.getPrescriber())); - for (org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent t : src.getLensSpecification()) - tgt.addLensSpecification(convertVisionPrescriptionLensSpecificationComponent(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertVisionStatus(org.hl7.fhir.r4.model.VisionPrescription.VisionStatus src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; - case CANCELLED: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; - case DRAFT: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; - default: return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; - } -} - - public static org.hl7.fhir.r4.model.VisionPrescription.VisionStatus convertVisionStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case ACTIVE: return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.ACTIVE; - case CANCELLED: return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.CANCELLED; - case DRAFT: return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.DRAFT; - case ENTEREDINERROR: return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.ENTEREDINERROR; - default: return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.NULL; - } -} - - public static org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent tgt = new org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent(); - copyElement(src, tgt); - if (src.hasProduct()) - tgt.setProduct(convertCodeableConcept(src.getProduct())); - if (src.hasEye()) - tgt.setEye(convertVisionEyes(src.getEye())); - if (src.hasSphere()) - tgt.setSphereElement(convertDecimal(src.getSphereElement())); - if (src.hasCylinder()) - tgt.setCylinderElement(convertDecimal(src.getCylinderElement())); - if (src.hasAxis()) - tgt.setAxisElement(convertInteger(src.getAxisElement())); - for (org.hl7.fhir.r4.model.VisionPrescription.PrismComponent t : src.getPrism()) - tgt.addPrism(convertPrismComponent(t)); - if (src.hasAdd()) - tgt.setAddElement(convertDecimal(src.getAddElement())); - if (src.hasPower()) - tgt.setPowerElement(convertDecimal(src.getPowerElement())); - if (src.hasBackCurve()) - tgt.setBackCurveElement(convertDecimal(src.getBackCurveElement())); - if (src.hasDiameter()) - tgt.setDiameterElement(convertDecimal(src.getDiameterElement())); - if (src.hasDuration()) - tgt.setDuration(convertSimpleQuantity(src.getDuration())); - if (src.hasColor()) - tgt.setColorElement(convertString(src.getColorElement())); - if (src.hasBrand()) - tgt.setBrandElement(convertString(src.getBrandElement())); - for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent tgt = new org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent(); - copyElement(src, tgt); - if (src.hasProduct()) - tgt.setProduct(convertCodeableConcept(src.getProduct())); - if (src.hasEye()) - tgt.setEye(convertVisionEyes(src.getEye())); - if (src.hasSphere()) - tgt.setSphereElement(convertDecimal(src.getSphereElement())); - if (src.hasCylinder()) - tgt.setCylinderElement(convertDecimal(src.getCylinderElement())); - if (src.hasAxis()) - tgt.setAxisElement(convertInteger(src.getAxisElement())); - for (org.hl7.fhir.r5.model.VisionPrescription.PrismComponent t : src.getPrism()) - tgt.addPrism(convertPrismComponent(t)); - if (src.hasAdd()) - tgt.setAddElement(convertDecimal(src.getAddElement())); - if (src.hasPower()) - tgt.setPowerElement(convertDecimal(src.getPowerElement())); - if (src.hasBackCurve()) - tgt.setBackCurveElement(convertDecimal(src.getBackCurveElement())); - if (src.hasDiameter()) - tgt.setDiameterElement(convertDecimal(src.getDiameterElement())); - if (src.hasDuration()) - tgt.setDuration(convertSimpleQuantity(src.getDuration())); - if (src.hasColor()) - tgt.setColorElement(convertString(src.getColorElement())); - if (src.hasBrand()) - tgt.setBrandElement(convertString(src.getBrandElement())); - for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) - tgt.addNote(convertAnnotation(t)); - return tgt; - } - - public static org.hl7.fhir.r5.model.VisionPrescription.VisionEyes convertVisionEyes(org.hl7.fhir.r4.model.VisionPrescription.VisionEyes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case RIGHT: return org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.RIGHT; - case LEFT: return org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.LEFT; - default: return org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.NULL; - } -} - - public static org.hl7.fhir.r4.model.VisionPrescription.VisionEyes convertVisionEyes(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case RIGHT: return org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.RIGHT; - case LEFT: return org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.LEFT; - default: return org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.NULL; - } -} - - public static org.hl7.fhir.r5.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r4.model.VisionPrescription.PrismComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.VisionPrescription.PrismComponent tgt = new org.hl7.fhir.r5.model.VisionPrescription.PrismComponent(); - copyElement(src, tgt); - if (src.hasAmount()) - tgt.setAmountElement(convertDecimal(src.getAmountElement())); - if (src.hasBase()) - tgt.setBase(convertVisionBase(src.getBase())); - return tgt; - } - - public static org.hl7.fhir.r4.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r5.model.VisionPrescription.PrismComponent src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r4.model.VisionPrescription.PrismComponent tgt = new org.hl7.fhir.r4.model.VisionPrescription.PrismComponent(); - copyElement(src, tgt); - if (src.hasAmount()) - tgt.setAmountElement(convertDecimal(src.getAmountElement())); - if (src.hasBase()) - tgt.setBase(convertVisionBase(src.getBase())); - return tgt; - } - - public static org.hl7.fhir.r5.model.VisionPrescription.VisionBase convertVisionBase(org.hl7.fhir.r4.model.VisionPrescription.VisionBase src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UP: return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.UP; - case DOWN: return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.DOWN; - case IN: return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.IN; - case OUT: return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.OUT; - default: return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.NULL; - } -} - - public static org.hl7.fhir.r4.model.VisionPrescription.VisionBase convertVisionBase(org.hl7.fhir.r5.model.VisionPrescription.VisionBase src) throws FHIRException { - if (src == null) - return null; - switch (src) { - case UP: return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.UP; - case DOWN: return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.DOWN; - case IN: return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.IN; - case OUT: return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.OUT; - default: return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.NULL; - } -} + public static org.hl7.fhir.r5.model.VisionPrescription convertVisionPrescription(org.hl7.fhir.r4.model.VisionPrescription src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VisionPrescription tgt = new org.hl7.fhir.r5.model.VisionPrescription(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertVisionStatus(src.getStatus())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDateWritten()) + tgt.setDateWrittenElement(convertDateTime(src.getDateWrittenElement())); + if (src.hasPrescriber()) + tgt.setPrescriber(convertReference(src.getPrescriber())); + if (src.hasLensSpecification()) { + for (org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent t : src.getLensSpecification()) tgt.addLensSpecification(convertVisionPrescriptionLensSpecificationComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r4.model.VisionPrescription convertVisionPrescription(org.hl7.fhir.r5.model.VisionPrescription src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.VisionPrescription tgt = new org.hl7.fhir.r4.model.VisionPrescription(); + copyDomainResource(src, tgt); + if (src.hasIdentifier()) { + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); + } + if (src.hasStatus()) + tgt.setStatus(convertVisionStatus(src.getStatus())); + if (src.hasCreated()) + tgt.setCreatedElement(convertDateTime(src.getCreatedElement())); + if (src.hasPatient()) + tgt.setPatient(convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(convertReference(src.getEncounter())); + if (src.hasDateWritten()) + tgt.setDateWrittenElement(convertDateTime(src.getDateWrittenElement())); + if (src.hasPrescriber()) + tgt.setPrescriber(convertReference(src.getPrescriber())); + if (src.hasLensSpecification()) { + for (org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent t : src.getLensSpecification()) tgt.addLensSpecification(convertVisionPrescriptionLensSpecificationComponent(t)); + } + return tgt; + } + public static org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes convertVisionStatus(org.hl7.fhir.r4.model.VisionPrescription.VisionStatus src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED; + case DRAFT: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR; + default: + return org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL; + } + } + + public static org.hl7.fhir.r4.model.VisionPrescription.VisionStatus convertVisionStatus(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case ACTIVE: + return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.ACTIVE; + case CANCELLED: + return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.CANCELLED; + case DRAFT: + return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.DRAFT; + case ENTEREDINERROR: + return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.ENTEREDINERROR; + default: + return org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.NULL; + } + } + + public static org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent tgt = new org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent(); + copyElement(src, tgt); + if (src.hasProduct()) + tgt.setProduct(convertCodeableConcept(src.getProduct())); + if (src.hasEye()) + tgt.setEye(convertVisionEyes(src.getEye())); + if (src.hasSphere()) + tgt.setSphereElement(convertDecimal(src.getSphereElement())); + if (src.hasCylinder()) + tgt.setCylinderElement(convertDecimal(src.getCylinderElement())); + if (src.hasAxis()) + tgt.setAxisElement(convertInteger(src.getAxisElement())); + if (src.hasPrism()) { + for (org.hl7.fhir.r4.model.VisionPrescription.PrismComponent t : src.getPrism()) tgt.addPrism(convertPrismComponent(t)); + } + if (src.hasAdd()) + tgt.setAddElement(convertDecimal(src.getAddElement())); + if (src.hasPower()) + tgt.setPowerElement(convertDecimal(src.getPowerElement())); + if (src.hasBackCurve()) + tgt.setBackCurveElement(convertDecimal(src.getBackCurveElement())); + if (src.hasDiameter()) + tgt.setDiameterElement(convertDecimal(src.getDiameterElement())); + if (src.hasDuration()) + tgt.setDuration(convertSimpleQuantity(src.getDuration())); + if (src.hasColor()) + tgt.setColorElement(convertString(src.getColorElement())); + if (src.hasBrand()) + tgt.setBrandElement(convertString(src.getBrandElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent tgt = new org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent(); + copyElement(src, tgt); + if (src.hasProduct()) + tgt.setProduct(convertCodeableConcept(src.getProduct())); + if (src.hasEye()) + tgt.setEye(convertVisionEyes(src.getEye())); + if (src.hasSphere()) + tgt.setSphereElement(convertDecimal(src.getSphereElement())); + if (src.hasCylinder()) + tgt.setCylinderElement(convertDecimal(src.getCylinderElement())); + if (src.hasAxis()) + tgt.setAxisElement(convertInteger(src.getAxisElement())); + if (src.hasPrism()) { + for (org.hl7.fhir.r5.model.VisionPrescription.PrismComponent t : src.getPrism()) tgt.addPrism(convertPrismComponent(t)); + } + if (src.hasAdd()) + tgt.setAddElement(convertDecimal(src.getAddElement())); + if (src.hasPower()) + tgt.setPowerElement(convertDecimal(src.getPowerElement())); + if (src.hasBackCurve()) + tgt.setBackCurveElement(convertDecimal(src.getBackCurveElement())); + if (src.hasDiameter()) + tgt.setDiameterElement(convertDecimal(src.getDiameterElement())); + if (src.hasDuration()) + tgt.setDuration(convertSimpleQuantity(src.getDuration())); + if (src.hasColor()) + tgt.setColorElement(convertString(src.getColorElement())); + if (src.hasBrand()) + tgt.setBrandElement(convertString(src.getBrandElement())); + if (src.hasNote()) { + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.VisionPrescription.VisionEyes convertVisionEyes(org.hl7.fhir.r4.model.VisionPrescription.VisionEyes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case RIGHT: + return org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.RIGHT; + case LEFT: + return org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.LEFT; + default: + return org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.NULL; + } + } + + public static org.hl7.fhir.r4.model.VisionPrescription.VisionEyes convertVisionEyes(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case RIGHT: + return org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.RIGHT; + case LEFT: + return org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.LEFT; + default: + return org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.NULL; + } + } + + public static org.hl7.fhir.r5.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r4.model.VisionPrescription.PrismComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VisionPrescription.PrismComponent tgt = new org.hl7.fhir.r5.model.VisionPrescription.PrismComponent(); + copyElement(src, tgt); + if (src.hasAmount()) + tgt.setAmountElement(convertDecimal(src.getAmountElement())); + if (src.hasBase()) + tgt.setBase(convertVisionBase(src.getBase())); + return tgt; + } + + public static org.hl7.fhir.r4.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r5.model.VisionPrescription.PrismComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4.model.VisionPrescription.PrismComponent tgt = new org.hl7.fhir.r4.model.VisionPrescription.PrismComponent(); + copyElement(src, tgt); + if (src.hasAmount()) + tgt.setAmountElement(convertDecimal(src.getAmountElement())); + if (src.hasBase()) + tgt.setBase(convertVisionBase(src.getBase())); + return tgt; + } + + public static org.hl7.fhir.r5.model.VisionPrescription.VisionBase convertVisionBase(org.hl7.fhir.r4.model.VisionPrescription.VisionBase src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UP: + return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.UP; + case DOWN: + return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.DOWN; + case IN: + return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.IN; + case OUT: + return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.OUT; + default: + return org.hl7.fhir.r5.model.VisionPrescription.VisionBase.NULL; + } + } + + public static org.hl7.fhir.r4.model.VisionPrescription.VisionBase convertVisionBase(org.hl7.fhir.r5.model.VisionPrescription.VisionBase src) throws FHIRException { + if (src == null) + return null; + switch(src) { + case UP: + return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.UP; + case DOWN: + return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.DOWN; + case IN: + return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.IN; + case OUT: + return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.OUT; + default: + return org.hl7.fhir.r4.model.VisionPrescription.VisionBase.NULL; + } + } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java new file mode 100644 index 000000000..a6ca29c08 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java @@ -0,0 +1,1244 @@ +package org.hl7.fhir.convertors.parser; + +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.*; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.FieldDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.body.VariableDeclarator; +import com.github.javaparser.ast.comments.Comment; +import com.github.javaparser.ast.expr.MethodCallExpr; +import com.github.javaparser.ast.expr.NameExpr; +import com.github.javaparser.ast.nodeTypes.NodeWithIdentifier; +import com.github.javaparser.ast.nodeTypes.NodeWithName; +import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName; +import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStaticModifier; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.ExpressionStmt; +import com.github.javaparser.ast.stmt.ForEachStmt; +import com.github.javaparser.ast.stmt.IfStmt; +import com.github.javaparser.ast.type.Type; +import com.github.javaparser.ast.type.VarType; +import com.github.javaparser.ast.visitor.ModifierVisitor; +import com.github.javaparser.ast.visitor.Visitable; +import com.github.javaparser.ast.visitor.VoidVisitorAdapter; +import com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration; +import com.github.javaparser.symbolsolver.JavaSymbolSolver; +import com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserMethodDeclaration; +import com.github.javaparser.symbolsolver.model.resolution.TypeSolver; +import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver; +import com.github.javaparser.symbolsolver.resolution.typesolvers.JarTypeSolver; +import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver; +import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver; + +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * TODO Line auditing function, try copying based on line numbers and based on MethodDeclr, and compare the outputs + */ +public class Parser { + + private static final String RESOURCE_FILE_FORMAT = "_%s"; //TODO fix + private static final List VERSION_FILES = Arrays.asList("10_30", "10_40", "10_50", "14_30", "14_40", "14_50", "30_40", "30_50", "40_50"); + + /** + * @param args + */ + public static void main(String[] args) { + /* + * every tgt.setX(convertT(src.getX)) should be dependent on a hasX - in principle that doesn't matter when you're + * dealing with singleton elements if convertT checks for null and setX accepts null - which *should* be the case. + * But there's enough special cases and other things that I have a lot less bugs where we always do if (src.hasX()) + */ + + VERSION_FILES.forEach(version -> { + List filenames = listAllJavaFilesInDirectory(new File("").getAbsolutePath() + "/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv"+version+"/"); + filenames.forEach(name -> { + cleanAccessorsForFile("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv"+version+"/", name, ".java"); + }); + }); + System.out.println(); + } + + public static void cleanAccessorsForFile(String srcdirectory, String filename, String extension) { + String projectDirectory = new File("").getAbsolutePath(); + String srcFilePathWithExtension = projectDirectory + srcdirectory + filename + extension; + + CompilationUnit compilationUnit = getCompilationUnit(projectDirectory + srcdirectory + filename + extension); + ClassOrInterfaceDeclaration classOrInterfaceDeclaration = initializeTypeSovlerAndParser(compilationUnit, + projectDirectory, srcdirectory, filename); + + String ifStatementTemplate = "if(%1$s){%2$s;}"; + String ifStatementTemplate2 = "if(%1$s){%2$s}"; + + final HashMap replacementMap = new HashMap<>(); + final HashMap generatedBlockStmt = new HashMap<>(); + + List methods = classOrInterfaceDeclaration.getMethods(); + methods.forEach(md -> { + String assembledMethod = ""; + md.accept(new ModifierVisitor() { + @Override + public Visitable visit(MethodCallExpr n, String arg) { + super.visit(n, arg); + if (n.getTokenRange().toString().contains("src.get")) { + + Node getStatement = getRootGetMethodCall(n); + String topLevelMethodExpr = getTopLevelMethodExpr(n); + if (topLevelMethodExpr != null) { + String condition = "src.has" + getStatement.toString().replace("FirstRep", "").replaceFirst("get", "") + "()"; + String statement = topLevelMethodExpr; + String ifStmt = String.format(statement.startsWith("for") ? ifStatementTemplate2 : ifStatementTemplate, condition, statement); + if (!replacementMap.containsKey(topLevelMethodExpr)) { + replacementMap.put(topLevelMethodExpr, ifStmt); + } + } + } + return n; + } + }, assembledMethod); + String body = md.getBody().get().toString(); + Set keySet = replacementMap.keySet(); + for (String key : keySet) { + if (key.startsWith("for")) { + body = body.replace(key, replacementMap.get(key)); + } else { + body = body.replace(key + ";", replacementMap.get(key)); + } + } + replacementMap.clear(); + try { + generatedBlockStmt.put(md, StaticJavaParser.parseBlock(body)); + }catch (Exception e) { + System.out.println(); + } + }); + + classOrInterfaceDeclaration.accept(new ModifierVisitor() { + @Override + public MethodDeclaration visit(MethodDeclaration md, Void arg) { + super.visit(md, arg); + if (generatedBlockStmt.containsKey(md)) { + return md.setBody(generatedBlockStmt.get(md)); + } else { + return md; + } + } + }, null); + + deleteFile(srcFilePathWithExtension); + + try { + writeStringToFile(compilationUnit.toString(), srcFilePathWithExtension); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static Node getRootGetMethodCall(Node n) { + if (n.getChildNodes().size() == 0) return n; + + Optional get = n.getChildNodes().stream() + .filter(node -> node.toString().contains("get")) + .findFirst(); + + return get.map(Parser::getRootGetMethodCall).orElse(null); + } + + private static String getTopLevelMethodExpr(Node exp) { + Optional node = exp.getParentNode(); + if (node.isPresent() && node.get() instanceof ExpressionStmt && node.get().getParentNode().get() instanceof IfStmt) { + return null; + } else if ((node.isPresent()) && ((node.get() instanceof MethodCallExpr)||(node.get() instanceof ForEachStmt))) { + return getTopLevelMethodExpr(node.get()); + } + return exp.toString(); + } + + // ================== OLD CODE ====================== + + + private static final String COMMON_FILENAME = "Common"; + private static final String DEST_DIRECTORY_FORMAT = "conv%s"; + private static final String SRC_FILE_FORMAT = "VersionConvertor_%s"; + + private static final String KEYWORD_CONVERT = "convert"; + private static final String KEYWORD_COPY = "copy"; + private static final String KEYWORD_FIND = "find"; + private static final String KEYWORD_GOD_METHOD = "convertResource"; + + private static final String DIRECTORY_WHERE_THE_CODE_LIVES = "/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/"; + private static final String COMMENT_REPORT = "comment_report%s.txt"; + + //Exception case variables + public static final String DSTU = "dstu"; + public static final String R = "r"; + + public static final String MODEL_RESOURCE = "org.hl7.fhir.%1$s%2$s.model.Resource"; + public static final String MODEL_VALUESET = "org.hl7.fhir.%1$s%2$s.model.ValueSet"; + public static final String MODEL_BUNDLECOMP = "org.hl7.fhir.%1$s%2$s.model.Bundle.BundleEntryComponent"; + public static final String MODEL_BUNDLE = "org.hl7.fhir.%1$s%2$s.model.Bundle"; + public static final String VERSION_CONVERTOR_IMPORT = "org.hl7.fhir.convertors.VersionConvertorAdvisor%s0"; + public static final String VERSION_CONVERTOR = "VersionConvertorAdvisor%s0"; + public static final String ADVISOR_VARIABLE = "advisor"; + + public static String convertPath(String path, String version) { + String versionloc = (version.equals("2") || version.equals("3")) ? DSTU : R; + return String.format(path, versionloc, version); + } + + public static void parseAllTheCodes() { + String projectDirectory = new File("").getAbsolutePath(); + + VERSION_FILES.forEach(version -> { + + String srcFilePathWithExtension = projectDirectory + DIRECTORY_WHERE_THE_CODE_LIVES + String.format(SRC_FILE_FORMAT, version) + ".java"; + String destDirectoryName = String.format(DEST_DIRECTORY_FORMAT, version); + + CompilationUnit compilationUnit = getCompilationUnit(srcFilePathWithExtension); + ClassOrInterfaceDeclaration classOrInterfaceDeclaration + = initializeTypeSovlerAndParser(compilationUnit, projectDirectory, DIRECTORY_WHERE_THE_CODE_LIVES, String.format(SRC_FILE_FORMAT, version)); + + if (version.contains("10")) + dealWithV2ExceptionCasesPreProcessing(compilationUnit, classOrInterfaceDeclaration, version); + + List externalClassNames = getAdditionalClassDeclarations(classOrInterfaceDeclaration).stream() + .filter(c -> !c.getNameAsString().equals(classOrInterfaceDeclaration.getNameAsString())) + .map(NodeWithSimpleName::getNameAsString) + .collect(Collectors.toList()); + + HashMap> generatedTopLevelMethodMap = generateMapOfTopLevelMethods(classOrInterfaceDeclaration); + HashMap generatedMethodMap = new HashMap<>(); + HashMap> generatedStaticFieldMappings = new HashMap<>(); + populateMethodAndFieldMaps(classOrInterfaceDeclaration, generatedTopLevelMethodMap, generatedMethodMap, generatedStaticFieldMappings); + + if (version.equals("10_40") || version.equals("10_50")) { + generatedMethodMap.keySet().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("hasConcept")) + .collect(Collectors.toList()) + .forEach(methodDeclaration -> { + generatedMethodMap.put(methodDeclaration, COMMON_FILENAME); + }); + } + + populateClassMappings(generatedTopLevelMethodMap, generatedMethodMap); + + createCommentReport(srcFilePathWithExtension, + projectDirectory + DIRECTORY_WHERE_THE_CODE_LIVES + String.format(COMMENT_REPORT, version)); + + modifySourceFile(compilationUnit, classOrInterfaceDeclaration, srcFilePathWithExtension, + generatedTopLevelMethodMap, generatedStaticFieldMappings, version); + + String packageDeclaration = compilationUnit.getPackageDeclaration().get().getNameAsString() + "." + + destDirectoryName; + System.out.println("Files will be generated with the package :: " + packageDeclaration); + NodeList imports = compilationUnit.getImports(); + System.out.println("Imports will be taken from the top level file <" + String.format(SRC_FILE_FORMAT, version) + ".java>, you will have to " + + "optimize imports on the generated files. Import list as follows :: \n-----"); + imports.stream().map(NodeWithName::getNameAsString).forEach(System.out::println); + System.out.println("-----\n"); + String directoryPath = projectDirectory + DIRECTORY_WHERE_THE_CODE_LIVES + destDirectoryName + "/"; + createDirectory(directoryPath); + System.out.println("Generated type conversion files will be stored in :: " + directoryPath); + + createJavaFiles(classOrInterfaceDeclaration, generatedTopLevelMethodMap, generatedStaticFieldMappings, + String.format(SRC_FILE_FORMAT, version), packageDeclaration, imports, directoryPath, externalClassNames, version); + }); + + + } + + private static List getAdditionalClassDeclarations(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { + List collect = new ArrayList<>(); + classOrInterfaceDeclaration.accept(new VoidVisitorAdapter() { + @Override + public void visit(ClassOrInterfaceDeclaration n, Void arg) { + super.visit(n, arg); + collect.add(n); + } + }, null); + return collect; + } + + private static CompilationUnit getCompilationUnit(String filePathWithExtension) { + Optional compilationUnit = initializeParser(filePathWithExtension); + if (!compilationUnit.isPresent()) { + System.out.println("\nNo compilation unit generated during class parsing...aborting."); + System.exit(0); + } + return compilationUnit.get(); + } + + private static ClassOrInterfaceDeclaration initializeTypeSovlerAndParser(CompilationUnit compilationUnit, + String projectDirectory, + String codeDirectory, + String filename) { + System.out.println("==================== Initializing TypeSolver and Parser ====================\n"); + + try { + initializeResolver(projectDirectory, codeDirectory); + } catch (IOException e) { + System.out.println("Error initializing typesolver, exiting process..."); + e.printStackTrace(); + System.exit(0); + } + + System.out.println("Loading class: " + filename); + Optional classOrInterfaceDeclaration = loadClass(compilationUnit, filename); + if (!classOrInterfaceDeclaration.isPresent()) { + System.out.println("\nNo class or interface declaration loaded during parsing...aborting."); + System.exit(0); + } + + System.out.println("\n"); + + return classOrInterfaceDeclaration.get(); + } + + private static HashMap> generateMapOfTopLevelMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { + System.out.println("==================== Generating List of Parsable Types ====================\n"); + + HashMap> mapToReturn = new HashMap<>(); + + System.out.println("Fetching list of top level parsing methods..."); + System.out.println("---------------------------------------------"); + List listOfParsableMethodCalls = getListOfParsableTypes(classOrInterfaceDeclaration).stream() + .map(methodCallExpr -> methodCallExpr.getName().toString()) + .sorted(Comparator.comparing(Function.identity())) + .distinct() + .collect(Collectors.toList()); + listOfParsableMethodCalls.forEach(System.out::println); + System.out.println("---------------------------------------------"); + System.out.println("\n"); + + System.out.println("==================== Generate Map of Top Level Method Names ====================\n"); + System.out.println("Pulling all top level methods from the parsed class --> " + classOrInterfaceDeclaration.getNameAsString()); + List topLevelMethods = getTopLevelMethods(classOrInterfaceDeclaration, listOfParsableMethodCalls); + System.out.println("\nFetched the following top level methods:"); + System.out.println("------------------------------------------"); + topLevelMethods.forEach(md -> System.out.println(md.getSignature().toString())); + System.out.println("------------------------------------------\n"); + System.out.println("\n"); + + for (String type : listOfParsableMethodCalls) { + topLevelMethods.stream() + .filter(methodDeclaration -> type.equals(methodDeclaration.getName().asString())) + .forEach(md -> { + if (!mapToReturn.containsKey(type.replaceFirst(KEYWORD_CONVERT, ""))) { + mapToReturn.put(type.replaceFirst(KEYWORD_CONVERT, ""), new ArrayList<>()); + } + mapToReturn.get(type.replaceFirst(KEYWORD_CONVERT, "")).add(md); + }); + } + return mapToReturn; + } + + public static void populateMethodAndFieldMaps(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, + HashMap> generatedTopLevelMethodMap, + HashMap methodMapToPopulate, + HashMap> fieldMapToPopulate) { + + System.out.println("==================== Generate Method and Field Maps ====================\n"); + + HashMap fieldDeclarationMap = new HashMap<>(); + + List fieldDeclarations = classOrInterfaceDeclaration.getFields().stream() + .filter(NodeWithStaticModifier::isStatic) + .collect(Collectors.toList()); + + for (String key : generatedTopLevelMethodMap.keySet()) { + for (MethodDeclaration md : generatedTopLevelMethodMap.get(key)) { + recursiveSearchAndAdd(classOrInterfaceDeclaration, methodMapToPopulate, fieldDeclarationMap, fieldDeclarations, md, key); + } + } + + fieldDeclarationMap.keySet().forEach(key -> { + if (!fieldMapToPopulate.containsKey(fieldDeclarationMap.get(key))) { + fieldMapToPopulate.put(fieldDeclarationMap.get(key), new ArrayList<>()); + } + fieldMapToPopulate.get(fieldDeclarationMap.get(key)).add(key); + }); + } + + public static void populateClassMappings(HashMap> generatedTopLevelMethodMap, + HashMap generatedMethodMap) { + System.out.println("==================== Generate Method to Class Mappings ====================\n"); + + generatedTopLevelMethodMap.put(COMMON_FILENAME, new ArrayList<>()); + generatedTopLevelMethodMap.clear(); + generatedMethodMap.keySet().forEach(md -> { + if (!generatedTopLevelMethodMap.containsKey(generatedMethodMap.get(md))) { + generatedTopLevelMethodMap.put(generatedMethodMap.get(md), new ArrayList<>()); + } + generatedTopLevelMethodMap.get(generatedMethodMap.get(md)).add(md); + }); + + for (String className : generatedTopLevelMethodMap.keySet()) { + System.out.println("Class :: " + className); + generatedTopLevelMethodMap.get(className).stream() + .sorted(Comparator.comparing(methodDeclaration -> methodDeclaration.getName().toString())) + .forEach(md -> System.out.println("\t" + md.getSignature())); + System.out.println("\n"); + } + } + + public static void createCommentReport(String fullSrcFilePath, String fullDstFilePath) { + try { + List commentReportEntries = generateCommentReportData(fullSrcFilePath); + String report = commentReportEntries.stream() + .map(Object::toString).collect(Collectors.joining("\n")); + writeStringToFile(report, fullDstFilePath); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void dealWithV2ExceptionCasesPreProcessing(CompilationUnit cu, ClassOrInterfaceDeclaration classOrInterfaceDeclaration, String version) { + String from = "2";//version.substring(0, version.indexOf('_')); + String to = version.substring(version.indexOf('_') + 1, version.indexOf('_') + 2); + + + modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_VALUESET, "convertValueSet"); + modifyConvertResourceCalls(classOrInterfaceDeclaration, from, to, to, MODEL_VALUESET, "convertValueSet"); + modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_BUNDLECOMP, "convertBundleEntryComponent"); + modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_BUNDLE, "convertBundle"); + + addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertBundle", MODEL_BUNDLE, from, "convertBundleEntryComponent"); + + } + + public static void dealWithV2ExceptionCasesPostProcessing(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, String version) { + String from = "2";//version.substring(0, version.indexOf('_')); + String to = version.substring(version.indexOf('_') + 1, version.indexOf('_') + 2); + + Optional advisorOptional = classOrInterfaceDeclaration.getFields().stream() + .map(FieldDeclaration::getVariables) + .flatMap(Collection::stream) + .filter(v -> v.getNameAsString().equals(ADVISOR_VARIABLE)) + .findFirst(); + + if (advisorOptional.isPresent()) { + VariableDeclarator advisorVariable = advisorOptional.get(); + Type advisorType = advisorVariable.getType(); + advisorOptional.get().getParentNode().ifPresent(Node::remove); + + modifyConvertResourceCalls(classOrInterfaceDeclaration, from, to, to, MODEL_RESOURCE, "convertResource"); + modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_RESOURCE, "convertResource"); + + addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertResource", MODEL_RESOURCE, from, "convertBundle"); + addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertResource", MODEL_RESOURCE, from, "convertValueSet"); + addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertResource", MODEL_RESOURCE, to, "convertValueSet"); + + classOrInterfaceDeclaration.getConstructors().forEach(Node::remove); + + System.out.println(); +// classOrInterfaceDeclaration.addMethod(); + + } + + System.out.println(); + } + + public static void modifyConvertResourceCalls(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, + String parameterVersionNo, + String typeVersionNo, + String convertorVersionNumber, + String typeFormat, + String methodName) { + MethodDeclaration oldConvertResource = getConvertResourceMethodForVersion(classOrInterfaceDeclaration, methodName, typeFormat, typeVersionNo); + oldConvertResource.addParameter(String.format(VERSION_CONVERTOR, convertorVersionNumber), ADVISOR_VARIABLE); + + MethodDeclaration newConvertResource = classOrInterfaceDeclaration.addMethod(methodName); + newConvertResource.setModifier(Modifier.Keyword.PUBLIC, true); + newConvertResource.setModifier(Modifier.Keyword.STATIC, true); + newConvertResource.setType(convertPath(typeFormat, typeVersionNo)); + newConvertResource.setThrownExceptions(oldConvertResource.getThrownExceptions()); + newConvertResource.addParameter(convertPath(typeFormat, parameterVersionNo), "src"); + newConvertResource.setBody(new BlockStmt().addStatement("return " + methodName + "(src, null);")); + } + + public static void addAdvisorToMethodCalls(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, + String parentMethodName, + String modelType, + String version, + String subMethodCall) { + + Optional methodDeclaration = classOrInterfaceDeclaration.getMethods().stream() + .filter(md -> md.getNameAsString().equals(parentMethodName)) + .filter(md -> md.getType().toString().equals(convertPath(modelType, version))) + .findAny(); + + methodDeclaration.ifPresent(declaration -> declaration.accept(new ModifierVisitor() { + @Override + public Visitable visit(MethodCallExpr n, Void arg) { + super.visit(n, arg); + if (n.getNameAsString().contains(subMethodCall)) { + n.addArgument("advisor"); + } + return n; + } + }, null)); + + } + + public static MethodDeclaration getConvertResourceMethodForVersion(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, + String methodName, + String modelType, + String version) { + Optional methodDeclaration = classOrInterfaceDeclaration.getMethods().stream() + .filter(md -> md.getNameAsString().equals(methodName)) + .filter(md -> md.getType().toString().equals(convertPath(modelType, version))) + .findAny(); + + if (methodDeclaration.isPresent()) { + return methodDeclaration.get(); + } else { + System.out.println("Cannot find method " + methodName + " that returns type " + convertPath(modelType, version)); + System.exit(0); + } + return null; + } + + public static void modifySourceFile(CompilationUnit compilationUnit, + ClassOrInterfaceDeclaration classOrInterfaceDeclaration, + String srcFilePathWithExtension, + HashMap> generatedTopLevelMethodMap, + HashMap> generatedStaticFieldMappings, + String version) { + + + List listOfParsableMethodCalls = getListOfParsableTypes(classOrInterfaceDeclaration).stream() + .map(methodCallExpr -> methodCallExpr.getName().toString()) + .sorted(Comparator.comparing(Function.identity())) + .distinct() + .collect(Collectors.toList()); + + modifyMainFile(compilationUnit, + classOrInterfaceDeclaration, + generatedTopLevelMethodMap.get(COMMON_FILENAME), + generatedTopLevelMethodMap.keySet().stream() + .filter(key -> !key.equals(COMMON_FILENAME)) + .map(generatedTopLevelMethodMap::get) + .flatMap(Collection::stream) + .collect(Collectors.toList()), + listOfParsableMethodCalls, + generatedStaticFieldMappings.keySet().stream() + .filter(key -> !key.equals(COMMON_FILENAME)) + .map(generatedStaticFieldMappings::get) + .flatMap(Collection::stream) + .collect(Collectors.toList()), + generatedStaticFieldMappings.keySet().stream() + .filter(key -> key.equals(COMMON_FILENAME)) + .map(generatedStaticFieldMappings::get) + .flatMap(Collection::stream) + .collect(Collectors.toList()), + version); + + deleteFile(srcFilePathWithExtension); + + try { + writeStringToFile(compilationUnit.toString(), srcFilePathWithExtension); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void modifyMainFile(CompilationUnit compilationUnit, + ClassOrInterfaceDeclaration classOrInterfaceDeclaration, + List methodsToExpose, + List methodsToDelete, + List methodsToAddStaticAccess, + List fieldsToDelete, + List fieldsToExpose, + String versionCode) { + + compilationUnit.getAllContainedComments().stream() + .filter(Comment::isLineComment) + .forEach(Comment::remove); + + compilationUnit.accept(new MethodDeleter(methodsToDelete), null); + compilationUnit.accept(new MethodExposer(methodsToExpose), null); + + compilationUnit.addImport("org.hl7.fhir.convertors." + String.format(DEST_DIRECTORY_FORMAT, versionCode), false, true); + + fieldsToDelete.forEach(classOrInterfaceDeclaration::remove); + classOrInterfaceDeclaration.getFields().stream() + .filter(NodeWithStaticModifier::isStatic) + .filter(fieldsToExpose::contains) + .forEach(fd -> { + fd.setModifier(Modifier.Keyword.PRIVATE, false); + fd.setModifier(Modifier.Keyword.PUBLIC, true); + }); + + List listOfClassMethods = getListOfClassMethods(KEYWORD_GOD_METHOD, classOrInterfaceDeclaration); + listOfClassMethods.forEach(md -> { + md.accept(new MethodStaticCallAdder(methodsToAddStaticAccess, versionCode), null); + }); + + //Deal with the old, non static access convertors (1-3, 1-4, 1-5) + compilationUnit.accept(new ModifierVisitor() { + @Override + public MethodDeclaration visit(MethodDeclaration md, Void arg) { + super.visit(md, arg); + + md.setModifier(Modifier.Keyword.PRIVATE, false); + md.setModifier(Modifier.Keyword.STATIC, true); + md.setModifier(Modifier.Keyword.PUBLIC, true); + + return md; + } + }, null); + + classOrInterfaceDeclaration.accept(new ModifierVisitor() { + @Override + public ClassOrInterfaceDeclaration visit(ClassOrInterfaceDeclaration n, Void arg) { + super.visit(n, arg); + if (!n.getNameAsString().equals(String.format(SRC_FILE_FORMAT, versionCode))) { + n.setModifier(Modifier.Keyword.PRIVATE, false); + n.setModifier(Modifier.Keyword.STATIC, true); + n.setModifier(Modifier.Keyword.PUBLIC, true); + n.accept(new ModifierVisitor() { + @Override + public FieldDeclaration visit(FieldDeclaration md, Void arg) { + super.visit(md, arg); + md.setModifier(Modifier.Keyword.PRIVATE, false); + md.setModifier(Modifier.Keyword.STATIC, false); + md.setModifier(Modifier.Keyword.PUBLIC, true); + return md; + } + }, null); + } + return n; + } + }, null); + + if (versionCode.contains("10")) dealWithV2ExceptionCasesPostProcessing(classOrInterfaceDeclaration, versionCode); + + } + + public static void createJavaFiles(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, + HashMap> generatedTopLevelMethodMap, + HashMap> generatedStaticFieldMappings, + String filename, + String packageDeclaration, + NodeList imports, + String outputDirectoryPath, + List externalClassNames, + String version) { + System.out.println("==================== Create Java Files ====================\n"); + + generatedTopLevelMethodMap.keySet().stream() + .filter(s -> !s.equals(COMMON_FILENAME)) + .forEach(s -> { + String generatedCode = generateFileContents(classOrInterfaceDeclaration, + filename, + s + version, + packageDeclaration, + imports, + generatedStaticFieldMappings.get(s), + generatedStaticFieldMappings.get(COMMON_FILENAME), + generatedTopLevelMethodMap.get(s).stream() + .sorted(Comparator.comparing(methodDeclaration -> methodDeclaration.getName().toString())) + .collect(Collectors.toList()), + externalClassNames, + version); + + try { + String filePath = outputDirectoryPath + s + version + ".java"; + System.out.println("Attempting to write file -> " + filePath); + writeStringToFile(generatedCode, filePath); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } + + public static void writeStringToFile(String string, String filepath) throws IOException { + BufferedWriter writer = new BufferedWriter(new FileWriter(filepath)); + writer.write(string); + writer.close(); + } + + public static String generateFileContents(ClassOrInterfaceDeclaration oldInterfaceDec, + String commonMethodClassName, + String className, + String packageDeclaration, + NodeList imports, + List fieldDeclarations, + List externalFieldDeclarations, + List methods, + List externalClassNames, + String version) { + + CompilationUnit cu = new CompilationUnit(); + + + cu.setPackageDeclaration(packageDeclaration); + cu.setImports(imports); + cu.addImport("org.hl7.fhir.convertors." + String.format(SRC_FILE_FORMAT, version)); + cu.addImport("org.hl7.fhir.convertors.VersionConvertorConstants"); + if (version.contains("10")) + cu.addImport(String.format(VERSION_CONVERTOR_IMPORT, version.substring(version.indexOf('_') + 1, version.indexOf('_') + 2))); + + ClassOrInterfaceDeclaration generatedClass = cu.addClass(className); + if (fieldDeclarations != null) { + fieldDeclarations.forEach(generatedClass::addMember); + } + + methods.forEach(method -> { + + MethodDeclaration methodDeclaration = generatedClass.addMethod(method.getNameAsString()); + + if (method.getBody().isPresent()) { + BlockStmt blockStmt = method.getBody().get(); + if (externalFieldDeclarations != null) { + blockStmt.accept(new VarAccessChanger(externalFieldDeclarations.stream() + .map(fd -> fd.getVariable(0).getNameAsString()) + .collect(Collectors.toList()), String.format(SRC_FILE_FORMAT, version)), null); + } + List allCalledMethods = getAllCalledMethods(oldInterfaceDec, method); + + allCalledMethods.stream() + .filter(md -> !methods.contains(md)) + .map(NodeWithSimpleName::getNameAsString) + .distinct() + .forEach(methodName -> { + List methodCallExprs = new ArrayList<>(); + blockStmt.accept(new MethodCallVisitor(methodName, true), methodCallExprs); + methodCallExprs.stream() + .distinct() + .forEach(methodCallExpr -> { + methodCallExpr.setName(commonMethodClassName + "." + methodCallExpr.getNameAsString()); + }); + }); + methodDeclaration.setBody(blockStmt); + + } + + methodDeclaration.setParameters(method.getParameters()); + methodDeclaration.setModifiers(method.getModifiers()); + methodDeclaration.addModifier(Modifier.Keyword.STATIC); + methodDeclaration.setModifier(Modifier.Keyword.PRIVATE, false); + methodDeclaration.setModifier(Modifier.Keyword.PUBLIC, true); + methodDeclaration.setThrownExceptions(method.getThrownExceptions()); + methodDeclaration.setType(method.getType()); + methodDeclaration.setTypeParameters(method.getTypeParameters()); + }); + + + generatedClass.walk(node -> { + String identifier = ""; + if (node instanceof NodeWithIdentifier) + if (externalClassNames.contains(((NodeWithIdentifier) node).getIdentifier())) { + ((NodeWithIdentifier) node).setIdentifier(String.format(SRC_FILE_FORMAT, version) + "." + ((NodeWithIdentifier) node).getIdentifier()); + } + }); + + return cu.toString(); + } + + public static Predicate distinctByKey(Function keyExtractor) { + Set seen = ConcurrentHashMap.newKeySet(); + return t -> seen.add(keyExtractor.apply(t)); + } + + private static void recursiveSearchAndAdd(ClassOrInterfaceDeclaration cd, + HashMap methodDeclarationMap, + HashMap fieldDeclarationMap, + List globalStaticFields, + MethodDeclaration key, + String value) { + if (methodDeclarationMap.containsKey(key) && (methodDeclarationMap.get(key).equals(COMMON_FILENAME) || methodDeclarationMap.get(key).equals(value))) + return; + if (key.getName().toString().equals("convertResource")) return; + + addMethodDeclarationToMap(methodDeclarationMap, value, key); + searchAndSortMethodFields(key, value, fieldDeclarationMap, globalStaticFields); + + getAllCalledMethods(cd, key).forEach(md -> { + recursiveSearchAndAdd(cd, methodDeclarationMap, fieldDeclarationMap, globalStaticFields, md, value); + }); + + } + + private static void searchAndSortMethodFields(MethodDeclaration md, + String classKey, + HashMap fieldToClassMap, + List fieldDeclarations) { + + List collector = new ArrayList<>(); + md.accept(new MethodFieldVisitor(), collector); + + md.accept(new VoidVisitorAdapter() { + @Override + public void visit(VarType n, Void arg) { + super.visit(n, arg); + } + }, null); + + List staticFieldLabels = fieldDeclarations.stream() + .map(fd -> fd.getVariable(0).getName().asString()) + .collect(Collectors.toList()); + + collector.stream() + .filter(ne -> staticFieldLabels.contains(ne.getNameAsString())) + .map(ne -> fieldDeclarations.stream() + .filter(fd -> fd.getVariable(0).getName().asString().equals(ne.getNameAsString())) + .findFirst() + .get()) + .forEach(fd -> { + if (!fieldToClassMap.containsKey(fd)) { + fieldToClassMap.put(fd, classKey); + } else if (!fieldToClassMap.get(fd).equals(classKey)) { + fieldToClassMap.put(fd, COMMON_FILENAME); + } + }); + } + + + private static void createDirectory(String path) { + File file = new File(path); + //Creating the directory + boolean bool = file.mkdir(); + if (bool) { + System.out.println("Directory created successfully"); + } else { + System.out.println("Sorry couldn’t create specified directory"); + } + } + + /** + * Attempts to delete the file at the given path.) + * + * @param path + */ + public static void deleteFile(String path) { + File file = new File(path); + if (file.delete()) { + System.out.println("File <" + path + "> deleted successfully"); + } else { + System.out.println("Failed to delete the file <" + path + ">"); + } + } + + /** + * Finds the god method in the given convertor, and parses out all the method calls that method makes. + * + * @param classOrInterfaceDeclaration + * @return + */ + protected static List getListOfParsableTypes(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { + List listOfClassMethods = getListOfClassMethods(KEYWORD_GOD_METHOD, classOrInterfaceDeclaration); + List calledMethods = new ArrayList<>(); + listOfClassMethods.forEach(md -> md.accept(new MethodCallVisitor(KEYWORD_CONVERT), calledMethods)); + return calledMethods; + } + + /** + * Pulls all internal conversion method calls out of the passed in method and maps those calls to the corresponding + * {@link MethodDeclaration} and returns those as a list. + * + * @param classOrInterfaceDeclaration + * @param method + * @return List of all {@link MethodDeclaration} + */ + public static List getAllCalledMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, MethodDeclaration method) { + List result = new ArrayList<>(); + + List methodCallExprs = new ArrayList<>(); + method.accept(new VoidVisitorAdapter>() { + @Override + public void visit(MethodCallExpr methodCallExpr, List collector) { + collector.add(methodCallExpr); + super.visit(methodCallExpr, collector); + } + }, methodCallExprs); + + Set methodExpressionNames = methodCallExprs.stream() + .filter(methodCallExpr -> !methodCallExpr.getScope().isPresent()) + .map(me -> me.getName().toString()) + .collect(Collectors.toSet()); + + classOrInterfaceDeclaration.getMethods().stream() + .filter(e -> methodExpressionNames.contains(e.getName().toString())) + .collect(Collectors.toCollection(() -> result)); + + return result; + } + + /** + * Searches the passed in {@link ClassOrInterfaceDeclaration} for any method declaration matching any of the method + * names in the passed in List. + * + * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} to search + * @param methodNames {@link List} of method names + * @return {@link List } containing any of the keywords + */ + protected static List getTopLevelMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, List methodNames) { + List toReturn = new ArrayList<>(); + methodNames.stream() + .map(s -> getListOfClassMethods(s, classOrInterfaceDeclaration)) + .flatMap(List::stream) + .collect(Collectors.toCollection(() -> toReturn)); + return toReturn; + } + + /** + * Searched the generated declaration map for the matching {@link MethodDeclaration}, if it already exists within the + * map and is not currently pointing the class label we pass in, it will mark it with the {@link Parser#COMMON_FILENAME} + * + * @param className {@link String} class label we want to associate the method with + * @param methodDeclaration {@link MethodDeclaration} + */ + protected static void addMethodDeclarationToMap(HashMap map, + String className, MethodDeclaration methodDeclaration) { + if (!map.containsKey(methodDeclaration)) { + map.put(methodDeclaration, className); + } else if (!map.get(methodDeclaration).equals(className)) { + map.put(methodDeclaration, COMMON_FILENAME); + } + } + + /** + * Returns a list of all java files within the passed in directory path, without extension. + * + * @param path {@link String} filepath + * @return {@link List < String >} of all filenames + */ + protected static List listAllJavaFilesInDirectory(String path) { + List result = new ArrayList<>(); + + try (Stream walk = Files.walk(Paths.get(path))) { + walk.map(Path::toString) + .filter(f -> f.endsWith(".java")) + .map(Parser::pullFileNameFromPath) + .collect(Collectors.toCollection(() -> result)); + } catch (IOException e) { + e.printStackTrace(); + } + + return result; + } + + /** + * Takes the passed in file path and extracts the filename without extension. + * + * @param path + * @return + */ + protected static String pullFileNameFromPath(String path) { + int lastSlashIndex = path.lastIndexOf('/'); + int lastPeriodIndex = path.lastIndexOf('.'); + return path.substring(lastSlashIndex + 1, lastPeriodIndex); + } + + /** + * The parser works by listing method calls within the individual resource conversion methods as + * {@link MethodCallExpr}. To extract the information we need to refactor the code, + * such as method body, references, signature, etc, we rely on the javaparser {@link TypeSolver} to parse the code + * library and convert the expressions to concrete {@link MethodDeclaration}. + *

+ * NB. The more source files in the directory you pass in (this will search recursively), the longer the + * MethodDeclaration lookups will take. Be smart, choose S-Mart. + * + * @param rootProjectDirectory + * @param projectDirectory {@link String} path to the directory that contains the souce files we want to be available for + */ + public static void initializeResolver(String rootProjectDirectory, String projectDirectory) throws IOException { + System.out.println("Initializing resolver against the following root directory:\n" + rootProjectDirectory); + System.out.println("Project codebase located here:\n" + projectDirectory); + + TypeSolver myTypeSolver = new CombinedTypeSolver( + new ReflectionTypeSolver(), + new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.convertors/src/main/java/")), + new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.utilities/src/main/java/")), + new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.dstu2/src/main/java/")), + new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.dstu3/src/main/java/")), + new JarTypeSolver("/Users/markiantorno/.m2/repository/ca/uhn/hapi/fhir/hapi-fhir-structures-r4/4.1.0/hapi-fhir-structures-r4-4.1.0.jar"), + new JarTypeSolver("/Users/markiantorno/.m2/repository/ca/uhn/hapi/fhir/hapi-fhir-base/4.1.0/hapi-fhir-base-4.1.0.jar") + ); + + JavaSymbolSolver symbolSolver = new JavaSymbolSolver(myTypeSolver); + StaticJavaParser.getConfiguration().setSymbolResolver(symbolSolver); + } + + /** + * Initializes the parser and runs it against the file located at the passed in path. + * + * @param path {@link String} path to the file. + * @return {@link Optional } + */ + public static Optional initializeParser(String path) { + System.out.println("Initializing parser, and parsing the following file:\n" + path); + CompilationUnit compilationUnit = null; + try { + compilationUnit = StaticJavaParser.parse(new File(path)); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + return Optional.ofNullable(compilationUnit); + } + + /** + * Loads a class using the {@link CompilationUnit} passed in and returns the resulting declaration for parsing. This + * class must exist within the directory parsed originally in {@link #initializeParser(String)} + * + * @param cu {@link CompilationUnit} + * @param classname {@link String} The name of the class to load. + * @return {@link Optional } for the named class. + */ + protected static Optional loadClass(CompilationUnit cu, String classname) { + return cu.getClassByName(classname); + } + + /** + * Takes a given {@link MethodCallExpr} and uses the initialized {@link JavaSymbolSolver} to search the source code + * for the appropriate {@link MethodDeclaration}. + * + * @param methodCallExpr {@link MethodCallExpr} + * @return An {@link Optional}, containing the corresponding {@link MethodDeclaration} + */ + protected static Optional resolveMethodDeclaration(MethodCallExpr methodCallExpr) { + MethodDeclaration wrappedDeclaration = null; + ResolvedMethodDeclaration correspondingDeclaration = methodCallExpr.resolve(); + + if (correspondingDeclaration instanceof JavaParserMethodDeclaration) { + JavaParserMethodDeclaration declaration = (JavaParserMethodDeclaration) correspondingDeclaration; + Node wrappedNode = declaration.getWrappedNode(); + wrappedDeclaration = (MethodDeclaration) wrappedNode; + System.out.println(); + } + + return Optional.ofNullable(wrappedDeclaration); + } + + /** + * Takes the content {@link String} passed in, and writes it to a java file with the provided name, in the provided + * directory location. + * + * @param filename Name of the file, including extension, ex: "Book.java" + * @param directory Path to directory to create the file + * @param content {@link String} content of the file + * @throws IOException + */ + public static void writeJavaCodeToFile(String filename, String directory, String content) throws IOException { + BufferedWriter writer = new BufferedWriter(new FileWriter(directory + filename)); + writer.write(content); + writer.close(); + } + + /** + * Returns the list of class methods. + * + * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} + * @return {@link List} of all {@link MethodDeclaration} + */ + protected static List getListOfClassMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { + return getListOfClassMethods("", classOrInterfaceDeclaration); + } + + /** + * Returns the list of class methods containing the passed in method name. + * + * @param methodName {@link String} method name to search for + * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} + * @return {@link List} of all matching {@link MethodDeclaration} + */ + protected static List getListOfClassMethods(String methodName, ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { + List result = new ArrayList<>(); + classOrInterfaceDeclaration.getMethods().stream() + .filter(method -> method.getName().toString().equals(methodName)) + .collect(Collectors.toCollection(() -> result)); + return result; + } + + private static List generateCommentReportData(String filepath) throws FileNotFoundException { + + CompilationUnit cu = StaticJavaParser.parse(new File(filepath)); + + return cu.getAllContainedComments().stream() + .filter(Comment::isOrphan) + .filter(Comment::isLineComment) + .map(p -> new CommentReportEntry(filepath.substring(filepath.lastIndexOf('/') + 1), + p.getClass().getSimpleName(), p.getContent(), p.getRange().get().begin.line, + !p.getCommentedNode().isPresent())) + .collect(Collectors.toList()); + } + + /** + * Class that visits all method calls within a given method and returns the results as a list. + */ + public static class MethodCallVisitor extends VoidVisitorAdapter> { + + private final String keyword; + private final boolean strict; + + public MethodCallVisitor(String keywords) { + super(); + this.keyword = keywords; + this.strict = false; + } + + public MethodCallVisitor(String keywords, boolean strict) { + super(); + this.keyword = keywords; + this.strict = strict; + } + + @Override + public void visit(MethodCallExpr methodCallExpr, List collector) { + if (strict) { + if (methodCallExpr.getName().asString().equals(keyword)) { + collector.add(methodCallExpr); + } + } else { + if (methodCallExpr.getName().asString().contains(keyword)) { + collector.add(methodCallExpr); + } + } + super.visit(methodCallExpr, collector); + } + } + + /** + * Class that visits all method calls within a given method and returns the results as a list. + */ + public static class MethodFieldVisitor extends VoidVisitorAdapter> { + + public MethodFieldVisitor() { + super(); + } + + @Override + public void visit(NameExpr fieldAccessExpr, List collector) { + super.visit(fieldAccessExpr, collector); + collector.add(fieldAccessExpr); + } + } + + /** + * Class that visits all method calls within a given method and returns the results as a list. + */ + public static class VarAccessChanger extends ModifierVisitor { + + private final List varsToAccessInMainFile; + private final String parentClassName; + + public VarAccessChanger(List varsToAccessInMainFile, String parentClassName) { + super(); + this.varsToAccessInMainFile = varsToAccessInMainFile; + this.parentClassName = parentClassName; + } + + @Override + public NameExpr visit(NameExpr nameExpr, Void arg) { + super.visit(nameExpr, arg); + if (varsToAccessInMainFile.contains(nameExpr.getNameAsString())) { + nameExpr.setName(parentClassName + "." + nameExpr.getNameAsString()); + } + return nameExpr; + } + } + + /** + * Class that visits all methods and deletes them if they are in the list of passed in MethodDeclarations + */ + public static class MethodDeleter extends ModifierVisitor { + + private List toDelete; + + public MethodDeleter(List toDelete) { + this.toDelete = toDelete; + } + + @Override + public MethodDeclaration visit(MethodDeclaration md, Void arg) { + super.visit(md, arg); + if (toDelete.contains(md)) { + return null; + } + return md; + } + } + + /** + * Class that visits all methods and deletes them if they are in the list of passed in MethodDeclarations + */ + public static class MethodExposer extends ModifierVisitor { + + private List toModify; + + public MethodExposer(List toModify) { + this.toModify = toModify; + } + + @Override + public MethodDeclaration visit(MethodDeclaration md, Void arg) { + super.visit(md, arg); + if (toModify.contains(md)) { + md.setModifier(Modifier.Keyword.PRIVATE, false); + md.setModifier(Modifier.Keyword.STATIC, true); + md.setModifier(Modifier.Keyword.PUBLIC, true); + } + return md; + } + } + + /** + * Class that visits all calls in calls and changes the access to an external class if it matches one of the passed + * in labels. + */ + public static class MethodStaticCallAdder extends ModifierVisitor { + + private List methodNames; + private String versionCode; + + public MethodStaticCallAdder(List methodNames, String versionCode) { + this.methodNames = methodNames; + this.versionCode = versionCode; + } + + @Override + public MethodCallExpr visit(MethodCallExpr methodCallExpr, Void arg) { + super.visit(methodCallExpr, arg); + if (methodNames.contains(methodCallExpr.getNameAsString())) { + //eg. convertPatient -> Patient30_50.convertPatient + methodCallExpr.setName(methodCallExpr.getNameAsString().replace(KEYWORD_CONVERT, "") + + versionCode + "." + methodCallExpr.getNameAsString()); + } + return methodCallExpr; + } + } + + private static class CommentReportEntry { + public String filename; + public String type; + public String text; + public int lineNumber; + public boolean isOrphan; + + CommentReportEntry(String filename, String type, String text, int lineNumber, + boolean isOrphan) { + this.filename = filename; + this.type = type; + this.text = text; + this.lineNumber = lineNumber; + this.isOrphan = isOrphan; + } + + @Override + public String toString() { + return filename + " | " + lineNumber + " | " + type + " | " + text.replaceAll("\\n", "").trim(); + } + } +} + From 810f5eabca9fa01231410dc51c593554536f4d53 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 28 Jan 2020 17:07:53 -0500 Subject: [PATCH 2/2] Removed parser. --- org.hl7.fhir.convertors/pom.xml | 7 - .../hl7/fhir/convertors/parser/Parser.java | 1244 ----------------- 2 files changed, 1251 deletions(-) delete mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 0dbc844b6..c31501189 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -59,13 +59,6 @@ true - - - com.github.javaparser - javaparser-symbol-solver-core - 3.15.9 - - diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java deleted file mode 100644 index a6ca29c08..000000000 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/parser/Parser.java +++ /dev/null @@ -1,1244 +0,0 @@ -package org.hl7.fhir.convertors.parser; - -import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.*; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.FieldDeclaration; -import com.github.javaparser.ast.body.MethodDeclaration; -import com.github.javaparser.ast.body.VariableDeclarator; -import com.github.javaparser.ast.comments.Comment; -import com.github.javaparser.ast.expr.MethodCallExpr; -import com.github.javaparser.ast.expr.NameExpr; -import com.github.javaparser.ast.nodeTypes.NodeWithIdentifier; -import com.github.javaparser.ast.nodeTypes.NodeWithName; -import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName; -import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStaticModifier; -import com.github.javaparser.ast.stmt.BlockStmt; -import com.github.javaparser.ast.stmt.ExpressionStmt; -import com.github.javaparser.ast.stmt.ForEachStmt; -import com.github.javaparser.ast.stmt.IfStmt; -import com.github.javaparser.ast.type.Type; -import com.github.javaparser.ast.type.VarType; -import com.github.javaparser.ast.visitor.ModifierVisitor; -import com.github.javaparser.ast.visitor.Visitable; -import com.github.javaparser.ast.visitor.VoidVisitorAdapter; -import com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration; -import com.github.javaparser.symbolsolver.JavaSymbolSolver; -import com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserMethodDeclaration; -import com.github.javaparser.symbolsolver.model.resolution.TypeSolver; -import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver; -import com.github.javaparser.symbolsolver.resolution.typesolvers.JarTypeSolver; -import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver; -import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver; - -import java.io.*; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Function; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * TODO Line auditing function, try copying based on line numbers and based on MethodDeclr, and compare the outputs - */ -public class Parser { - - private static final String RESOURCE_FILE_FORMAT = "_%s"; //TODO fix - private static final List VERSION_FILES = Arrays.asList("10_30", "10_40", "10_50", "14_30", "14_40", "14_50", "30_40", "30_50", "40_50"); - - /** - * @param args - */ - public static void main(String[] args) { - /* - * every tgt.setX(convertT(src.getX)) should be dependent on a hasX - in principle that doesn't matter when you're - * dealing with singleton elements if convertT checks for null and setX accepts null - which *should* be the case. - * But there's enough special cases and other things that I have a lot less bugs where we always do if (src.hasX()) - */ - - VERSION_FILES.forEach(version -> { - List filenames = listAllJavaFilesInDirectory(new File("").getAbsolutePath() + "/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv"+version+"/"); - filenames.forEach(name -> { - cleanAccessorsForFile("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv"+version+"/", name, ".java"); - }); - }); - System.out.println(); - } - - public static void cleanAccessorsForFile(String srcdirectory, String filename, String extension) { - String projectDirectory = new File("").getAbsolutePath(); - String srcFilePathWithExtension = projectDirectory + srcdirectory + filename + extension; - - CompilationUnit compilationUnit = getCompilationUnit(projectDirectory + srcdirectory + filename + extension); - ClassOrInterfaceDeclaration classOrInterfaceDeclaration = initializeTypeSovlerAndParser(compilationUnit, - projectDirectory, srcdirectory, filename); - - String ifStatementTemplate = "if(%1$s){%2$s;}"; - String ifStatementTemplate2 = "if(%1$s){%2$s}"; - - final HashMap replacementMap = new HashMap<>(); - final HashMap generatedBlockStmt = new HashMap<>(); - - List methods = classOrInterfaceDeclaration.getMethods(); - methods.forEach(md -> { - String assembledMethod = ""; - md.accept(new ModifierVisitor() { - @Override - public Visitable visit(MethodCallExpr n, String arg) { - super.visit(n, arg); - if (n.getTokenRange().toString().contains("src.get")) { - - Node getStatement = getRootGetMethodCall(n); - String topLevelMethodExpr = getTopLevelMethodExpr(n); - if (topLevelMethodExpr != null) { - String condition = "src.has" + getStatement.toString().replace("FirstRep", "").replaceFirst("get", "") + "()"; - String statement = topLevelMethodExpr; - String ifStmt = String.format(statement.startsWith("for") ? ifStatementTemplate2 : ifStatementTemplate, condition, statement); - if (!replacementMap.containsKey(topLevelMethodExpr)) { - replacementMap.put(topLevelMethodExpr, ifStmt); - } - } - } - return n; - } - }, assembledMethod); - String body = md.getBody().get().toString(); - Set keySet = replacementMap.keySet(); - for (String key : keySet) { - if (key.startsWith("for")) { - body = body.replace(key, replacementMap.get(key)); - } else { - body = body.replace(key + ";", replacementMap.get(key)); - } - } - replacementMap.clear(); - try { - generatedBlockStmt.put(md, StaticJavaParser.parseBlock(body)); - }catch (Exception e) { - System.out.println(); - } - }); - - classOrInterfaceDeclaration.accept(new ModifierVisitor() { - @Override - public MethodDeclaration visit(MethodDeclaration md, Void arg) { - super.visit(md, arg); - if (generatedBlockStmt.containsKey(md)) { - return md.setBody(generatedBlockStmt.get(md)); - } else { - return md; - } - } - }, null); - - deleteFile(srcFilePathWithExtension); - - try { - writeStringToFile(compilationUnit.toString(), srcFilePathWithExtension); - } catch (IOException e) { - e.printStackTrace(); - } - } - - private static Node getRootGetMethodCall(Node n) { - if (n.getChildNodes().size() == 0) return n; - - Optional get = n.getChildNodes().stream() - .filter(node -> node.toString().contains("get")) - .findFirst(); - - return get.map(Parser::getRootGetMethodCall).orElse(null); - } - - private static String getTopLevelMethodExpr(Node exp) { - Optional node = exp.getParentNode(); - if (node.isPresent() && node.get() instanceof ExpressionStmt && node.get().getParentNode().get() instanceof IfStmt) { - return null; - } else if ((node.isPresent()) && ((node.get() instanceof MethodCallExpr)||(node.get() instanceof ForEachStmt))) { - return getTopLevelMethodExpr(node.get()); - } - return exp.toString(); - } - - // ================== OLD CODE ====================== - - - private static final String COMMON_FILENAME = "Common"; - private static final String DEST_DIRECTORY_FORMAT = "conv%s"; - private static final String SRC_FILE_FORMAT = "VersionConvertor_%s"; - - private static final String KEYWORD_CONVERT = "convert"; - private static final String KEYWORD_COPY = "copy"; - private static final String KEYWORD_FIND = "find"; - private static final String KEYWORD_GOD_METHOD = "convertResource"; - - private static final String DIRECTORY_WHERE_THE_CODE_LIVES = "/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/"; - private static final String COMMENT_REPORT = "comment_report%s.txt"; - - //Exception case variables - public static final String DSTU = "dstu"; - public static final String R = "r"; - - public static final String MODEL_RESOURCE = "org.hl7.fhir.%1$s%2$s.model.Resource"; - public static final String MODEL_VALUESET = "org.hl7.fhir.%1$s%2$s.model.ValueSet"; - public static final String MODEL_BUNDLECOMP = "org.hl7.fhir.%1$s%2$s.model.Bundle.BundleEntryComponent"; - public static final String MODEL_BUNDLE = "org.hl7.fhir.%1$s%2$s.model.Bundle"; - public static final String VERSION_CONVERTOR_IMPORT = "org.hl7.fhir.convertors.VersionConvertorAdvisor%s0"; - public static final String VERSION_CONVERTOR = "VersionConvertorAdvisor%s0"; - public static final String ADVISOR_VARIABLE = "advisor"; - - public static String convertPath(String path, String version) { - String versionloc = (version.equals("2") || version.equals("3")) ? DSTU : R; - return String.format(path, versionloc, version); - } - - public static void parseAllTheCodes() { - String projectDirectory = new File("").getAbsolutePath(); - - VERSION_FILES.forEach(version -> { - - String srcFilePathWithExtension = projectDirectory + DIRECTORY_WHERE_THE_CODE_LIVES + String.format(SRC_FILE_FORMAT, version) + ".java"; - String destDirectoryName = String.format(DEST_DIRECTORY_FORMAT, version); - - CompilationUnit compilationUnit = getCompilationUnit(srcFilePathWithExtension); - ClassOrInterfaceDeclaration classOrInterfaceDeclaration - = initializeTypeSovlerAndParser(compilationUnit, projectDirectory, DIRECTORY_WHERE_THE_CODE_LIVES, String.format(SRC_FILE_FORMAT, version)); - - if (version.contains("10")) - dealWithV2ExceptionCasesPreProcessing(compilationUnit, classOrInterfaceDeclaration, version); - - List externalClassNames = getAdditionalClassDeclarations(classOrInterfaceDeclaration).stream() - .filter(c -> !c.getNameAsString().equals(classOrInterfaceDeclaration.getNameAsString())) - .map(NodeWithSimpleName::getNameAsString) - .collect(Collectors.toList()); - - HashMap> generatedTopLevelMethodMap = generateMapOfTopLevelMethods(classOrInterfaceDeclaration); - HashMap generatedMethodMap = new HashMap<>(); - HashMap> generatedStaticFieldMappings = new HashMap<>(); - populateMethodAndFieldMaps(classOrInterfaceDeclaration, generatedTopLevelMethodMap, generatedMethodMap, generatedStaticFieldMappings); - - if (version.equals("10_40") || version.equals("10_50")) { - generatedMethodMap.keySet().stream() - .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("hasConcept")) - .collect(Collectors.toList()) - .forEach(methodDeclaration -> { - generatedMethodMap.put(methodDeclaration, COMMON_FILENAME); - }); - } - - populateClassMappings(generatedTopLevelMethodMap, generatedMethodMap); - - createCommentReport(srcFilePathWithExtension, - projectDirectory + DIRECTORY_WHERE_THE_CODE_LIVES + String.format(COMMENT_REPORT, version)); - - modifySourceFile(compilationUnit, classOrInterfaceDeclaration, srcFilePathWithExtension, - generatedTopLevelMethodMap, generatedStaticFieldMappings, version); - - String packageDeclaration = compilationUnit.getPackageDeclaration().get().getNameAsString() + "." - + destDirectoryName; - System.out.println("Files will be generated with the package :: " + packageDeclaration); - NodeList imports = compilationUnit.getImports(); - System.out.println("Imports will be taken from the top level file <" + String.format(SRC_FILE_FORMAT, version) + ".java>, you will have to " + - "optimize imports on the generated files. Import list as follows :: \n-----"); - imports.stream().map(NodeWithName::getNameAsString).forEach(System.out::println); - System.out.println("-----\n"); - String directoryPath = projectDirectory + DIRECTORY_WHERE_THE_CODE_LIVES + destDirectoryName + "/"; - createDirectory(directoryPath); - System.out.println("Generated type conversion files will be stored in :: " + directoryPath); - - createJavaFiles(classOrInterfaceDeclaration, generatedTopLevelMethodMap, generatedStaticFieldMappings, - String.format(SRC_FILE_FORMAT, version), packageDeclaration, imports, directoryPath, externalClassNames, version); - }); - - - } - - private static List getAdditionalClassDeclarations(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { - List collect = new ArrayList<>(); - classOrInterfaceDeclaration.accept(new VoidVisitorAdapter() { - @Override - public void visit(ClassOrInterfaceDeclaration n, Void arg) { - super.visit(n, arg); - collect.add(n); - } - }, null); - return collect; - } - - private static CompilationUnit getCompilationUnit(String filePathWithExtension) { - Optional compilationUnit = initializeParser(filePathWithExtension); - if (!compilationUnit.isPresent()) { - System.out.println("\nNo compilation unit generated during class parsing...aborting."); - System.exit(0); - } - return compilationUnit.get(); - } - - private static ClassOrInterfaceDeclaration initializeTypeSovlerAndParser(CompilationUnit compilationUnit, - String projectDirectory, - String codeDirectory, - String filename) { - System.out.println("==================== Initializing TypeSolver and Parser ====================\n"); - - try { - initializeResolver(projectDirectory, codeDirectory); - } catch (IOException e) { - System.out.println("Error initializing typesolver, exiting process..."); - e.printStackTrace(); - System.exit(0); - } - - System.out.println("Loading class: " + filename); - Optional classOrInterfaceDeclaration = loadClass(compilationUnit, filename); - if (!classOrInterfaceDeclaration.isPresent()) { - System.out.println("\nNo class or interface declaration loaded during parsing...aborting."); - System.exit(0); - } - - System.out.println("\n"); - - return classOrInterfaceDeclaration.get(); - } - - private static HashMap> generateMapOfTopLevelMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { - System.out.println("==================== Generating List of Parsable Types ====================\n"); - - HashMap> mapToReturn = new HashMap<>(); - - System.out.println("Fetching list of top level parsing methods..."); - System.out.println("---------------------------------------------"); - List listOfParsableMethodCalls = getListOfParsableTypes(classOrInterfaceDeclaration).stream() - .map(methodCallExpr -> methodCallExpr.getName().toString()) - .sorted(Comparator.comparing(Function.identity())) - .distinct() - .collect(Collectors.toList()); - listOfParsableMethodCalls.forEach(System.out::println); - System.out.println("---------------------------------------------"); - System.out.println("\n"); - - System.out.println("==================== Generate Map of Top Level Method Names ====================\n"); - System.out.println("Pulling all top level methods from the parsed class --> " + classOrInterfaceDeclaration.getNameAsString()); - List topLevelMethods = getTopLevelMethods(classOrInterfaceDeclaration, listOfParsableMethodCalls); - System.out.println("\nFetched the following top level methods:"); - System.out.println("------------------------------------------"); - topLevelMethods.forEach(md -> System.out.println(md.getSignature().toString())); - System.out.println("------------------------------------------\n"); - System.out.println("\n"); - - for (String type : listOfParsableMethodCalls) { - topLevelMethods.stream() - .filter(methodDeclaration -> type.equals(methodDeclaration.getName().asString())) - .forEach(md -> { - if (!mapToReturn.containsKey(type.replaceFirst(KEYWORD_CONVERT, ""))) { - mapToReturn.put(type.replaceFirst(KEYWORD_CONVERT, ""), new ArrayList<>()); - } - mapToReturn.get(type.replaceFirst(KEYWORD_CONVERT, "")).add(md); - }); - } - return mapToReturn; - } - - public static void populateMethodAndFieldMaps(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, - HashMap> generatedTopLevelMethodMap, - HashMap methodMapToPopulate, - HashMap> fieldMapToPopulate) { - - System.out.println("==================== Generate Method and Field Maps ====================\n"); - - HashMap fieldDeclarationMap = new HashMap<>(); - - List fieldDeclarations = classOrInterfaceDeclaration.getFields().stream() - .filter(NodeWithStaticModifier::isStatic) - .collect(Collectors.toList()); - - for (String key : generatedTopLevelMethodMap.keySet()) { - for (MethodDeclaration md : generatedTopLevelMethodMap.get(key)) { - recursiveSearchAndAdd(classOrInterfaceDeclaration, methodMapToPopulate, fieldDeclarationMap, fieldDeclarations, md, key); - } - } - - fieldDeclarationMap.keySet().forEach(key -> { - if (!fieldMapToPopulate.containsKey(fieldDeclarationMap.get(key))) { - fieldMapToPopulate.put(fieldDeclarationMap.get(key), new ArrayList<>()); - } - fieldMapToPopulate.get(fieldDeclarationMap.get(key)).add(key); - }); - } - - public static void populateClassMappings(HashMap> generatedTopLevelMethodMap, - HashMap generatedMethodMap) { - System.out.println("==================== Generate Method to Class Mappings ====================\n"); - - generatedTopLevelMethodMap.put(COMMON_FILENAME, new ArrayList<>()); - generatedTopLevelMethodMap.clear(); - generatedMethodMap.keySet().forEach(md -> { - if (!generatedTopLevelMethodMap.containsKey(generatedMethodMap.get(md))) { - generatedTopLevelMethodMap.put(generatedMethodMap.get(md), new ArrayList<>()); - } - generatedTopLevelMethodMap.get(generatedMethodMap.get(md)).add(md); - }); - - for (String className : generatedTopLevelMethodMap.keySet()) { - System.out.println("Class :: " + className); - generatedTopLevelMethodMap.get(className).stream() - .sorted(Comparator.comparing(methodDeclaration -> methodDeclaration.getName().toString())) - .forEach(md -> System.out.println("\t" + md.getSignature())); - System.out.println("\n"); - } - } - - public static void createCommentReport(String fullSrcFilePath, String fullDstFilePath) { - try { - List commentReportEntries = generateCommentReportData(fullSrcFilePath); - String report = commentReportEntries.stream() - .map(Object::toString).collect(Collectors.joining("\n")); - writeStringToFile(report, fullDstFilePath); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static void dealWithV2ExceptionCasesPreProcessing(CompilationUnit cu, ClassOrInterfaceDeclaration classOrInterfaceDeclaration, String version) { - String from = "2";//version.substring(0, version.indexOf('_')); - String to = version.substring(version.indexOf('_') + 1, version.indexOf('_') + 2); - - - modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_VALUESET, "convertValueSet"); - modifyConvertResourceCalls(classOrInterfaceDeclaration, from, to, to, MODEL_VALUESET, "convertValueSet"); - modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_BUNDLECOMP, "convertBundleEntryComponent"); - modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_BUNDLE, "convertBundle"); - - addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertBundle", MODEL_BUNDLE, from, "convertBundleEntryComponent"); - - } - - public static void dealWithV2ExceptionCasesPostProcessing(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, String version) { - String from = "2";//version.substring(0, version.indexOf('_')); - String to = version.substring(version.indexOf('_') + 1, version.indexOf('_') + 2); - - Optional advisorOptional = classOrInterfaceDeclaration.getFields().stream() - .map(FieldDeclaration::getVariables) - .flatMap(Collection::stream) - .filter(v -> v.getNameAsString().equals(ADVISOR_VARIABLE)) - .findFirst(); - - if (advisorOptional.isPresent()) { - VariableDeclarator advisorVariable = advisorOptional.get(); - Type advisorType = advisorVariable.getType(); - advisorOptional.get().getParentNode().ifPresent(Node::remove); - - modifyConvertResourceCalls(classOrInterfaceDeclaration, from, to, to, MODEL_RESOURCE, "convertResource"); - modifyConvertResourceCalls(classOrInterfaceDeclaration, to, from, to, MODEL_RESOURCE, "convertResource"); - - addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertResource", MODEL_RESOURCE, from, "convertBundle"); - addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertResource", MODEL_RESOURCE, from, "convertValueSet"); - addAdvisorToMethodCalls(classOrInterfaceDeclaration, "convertResource", MODEL_RESOURCE, to, "convertValueSet"); - - classOrInterfaceDeclaration.getConstructors().forEach(Node::remove); - - System.out.println(); -// classOrInterfaceDeclaration.addMethod(); - - } - - System.out.println(); - } - - public static void modifyConvertResourceCalls(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, - String parameterVersionNo, - String typeVersionNo, - String convertorVersionNumber, - String typeFormat, - String methodName) { - MethodDeclaration oldConvertResource = getConvertResourceMethodForVersion(classOrInterfaceDeclaration, methodName, typeFormat, typeVersionNo); - oldConvertResource.addParameter(String.format(VERSION_CONVERTOR, convertorVersionNumber), ADVISOR_VARIABLE); - - MethodDeclaration newConvertResource = classOrInterfaceDeclaration.addMethod(methodName); - newConvertResource.setModifier(Modifier.Keyword.PUBLIC, true); - newConvertResource.setModifier(Modifier.Keyword.STATIC, true); - newConvertResource.setType(convertPath(typeFormat, typeVersionNo)); - newConvertResource.setThrownExceptions(oldConvertResource.getThrownExceptions()); - newConvertResource.addParameter(convertPath(typeFormat, parameterVersionNo), "src"); - newConvertResource.setBody(new BlockStmt().addStatement("return " + methodName + "(src, null);")); - } - - public static void addAdvisorToMethodCalls(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, - String parentMethodName, - String modelType, - String version, - String subMethodCall) { - - Optional methodDeclaration = classOrInterfaceDeclaration.getMethods().stream() - .filter(md -> md.getNameAsString().equals(parentMethodName)) - .filter(md -> md.getType().toString().equals(convertPath(modelType, version))) - .findAny(); - - methodDeclaration.ifPresent(declaration -> declaration.accept(new ModifierVisitor() { - @Override - public Visitable visit(MethodCallExpr n, Void arg) { - super.visit(n, arg); - if (n.getNameAsString().contains(subMethodCall)) { - n.addArgument("advisor"); - } - return n; - } - }, null)); - - } - - public static MethodDeclaration getConvertResourceMethodForVersion(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, - String methodName, - String modelType, - String version) { - Optional methodDeclaration = classOrInterfaceDeclaration.getMethods().stream() - .filter(md -> md.getNameAsString().equals(methodName)) - .filter(md -> md.getType().toString().equals(convertPath(modelType, version))) - .findAny(); - - if (methodDeclaration.isPresent()) { - return methodDeclaration.get(); - } else { - System.out.println("Cannot find method " + methodName + " that returns type " + convertPath(modelType, version)); - System.exit(0); - } - return null; - } - - public static void modifySourceFile(CompilationUnit compilationUnit, - ClassOrInterfaceDeclaration classOrInterfaceDeclaration, - String srcFilePathWithExtension, - HashMap> generatedTopLevelMethodMap, - HashMap> generatedStaticFieldMappings, - String version) { - - - List listOfParsableMethodCalls = getListOfParsableTypes(classOrInterfaceDeclaration).stream() - .map(methodCallExpr -> methodCallExpr.getName().toString()) - .sorted(Comparator.comparing(Function.identity())) - .distinct() - .collect(Collectors.toList()); - - modifyMainFile(compilationUnit, - classOrInterfaceDeclaration, - generatedTopLevelMethodMap.get(COMMON_FILENAME), - generatedTopLevelMethodMap.keySet().stream() - .filter(key -> !key.equals(COMMON_FILENAME)) - .map(generatedTopLevelMethodMap::get) - .flatMap(Collection::stream) - .collect(Collectors.toList()), - listOfParsableMethodCalls, - generatedStaticFieldMappings.keySet().stream() - .filter(key -> !key.equals(COMMON_FILENAME)) - .map(generatedStaticFieldMappings::get) - .flatMap(Collection::stream) - .collect(Collectors.toList()), - generatedStaticFieldMappings.keySet().stream() - .filter(key -> key.equals(COMMON_FILENAME)) - .map(generatedStaticFieldMappings::get) - .flatMap(Collection::stream) - .collect(Collectors.toList()), - version); - - deleteFile(srcFilePathWithExtension); - - try { - writeStringToFile(compilationUnit.toString(), srcFilePathWithExtension); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static void modifyMainFile(CompilationUnit compilationUnit, - ClassOrInterfaceDeclaration classOrInterfaceDeclaration, - List methodsToExpose, - List methodsToDelete, - List methodsToAddStaticAccess, - List fieldsToDelete, - List fieldsToExpose, - String versionCode) { - - compilationUnit.getAllContainedComments().stream() - .filter(Comment::isLineComment) - .forEach(Comment::remove); - - compilationUnit.accept(new MethodDeleter(methodsToDelete), null); - compilationUnit.accept(new MethodExposer(methodsToExpose), null); - - compilationUnit.addImport("org.hl7.fhir.convertors." + String.format(DEST_DIRECTORY_FORMAT, versionCode), false, true); - - fieldsToDelete.forEach(classOrInterfaceDeclaration::remove); - classOrInterfaceDeclaration.getFields().stream() - .filter(NodeWithStaticModifier::isStatic) - .filter(fieldsToExpose::contains) - .forEach(fd -> { - fd.setModifier(Modifier.Keyword.PRIVATE, false); - fd.setModifier(Modifier.Keyword.PUBLIC, true); - }); - - List listOfClassMethods = getListOfClassMethods(KEYWORD_GOD_METHOD, classOrInterfaceDeclaration); - listOfClassMethods.forEach(md -> { - md.accept(new MethodStaticCallAdder(methodsToAddStaticAccess, versionCode), null); - }); - - //Deal with the old, non static access convertors (1-3, 1-4, 1-5) - compilationUnit.accept(new ModifierVisitor() { - @Override - public MethodDeclaration visit(MethodDeclaration md, Void arg) { - super.visit(md, arg); - - md.setModifier(Modifier.Keyword.PRIVATE, false); - md.setModifier(Modifier.Keyword.STATIC, true); - md.setModifier(Modifier.Keyword.PUBLIC, true); - - return md; - } - }, null); - - classOrInterfaceDeclaration.accept(new ModifierVisitor() { - @Override - public ClassOrInterfaceDeclaration visit(ClassOrInterfaceDeclaration n, Void arg) { - super.visit(n, arg); - if (!n.getNameAsString().equals(String.format(SRC_FILE_FORMAT, versionCode))) { - n.setModifier(Modifier.Keyword.PRIVATE, false); - n.setModifier(Modifier.Keyword.STATIC, true); - n.setModifier(Modifier.Keyword.PUBLIC, true); - n.accept(new ModifierVisitor() { - @Override - public FieldDeclaration visit(FieldDeclaration md, Void arg) { - super.visit(md, arg); - md.setModifier(Modifier.Keyword.PRIVATE, false); - md.setModifier(Modifier.Keyword.STATIC, false); - md.setModifier(Modifier.Keyword.PUBLIC, true); - return md; - } - }, null); - } - return n; - } - }, null); - - if (versionCode.contains("10")) dealWithV2ExceptionCasesPostProcessing(classOrInterfaceDeclaration, versionCode); - - } - - public static void createJavaFiles(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, - HashMap> generatedTopLevelMethodMap, - HashMap> generatedStaticFieldMappings, - String filename, - String packageDeclaration, - NodeList imports, - String outputDirectoryPath, - List externalClassNames, - String version) { - System.out.println("==================== Create Java Files ====================\n"); - - generatedTopLevelMethodMap.keySet().stream() - .filter(s -> !s.equals(COMMON_FILENAME)) - .forEach(s -> { - String generatedCode = generateFileContents(classOrInterfaceDeclaration, - filename, - s + version, - packageDeclaration, - imports, - generatedStaticFieldMappings.get(s), - generatedStaticFieldMappings.get(COMMON_FILENAME), - generatedTopLevelMethodMap.get(s).stream() - .sorted(Comparator.comparing(methodDeclaration -> methodDeclaration.getName().toString())) - .collect(Collectors.toList()), - externalClassNames, - version); - - try { - String filePath = outputDirectoryPath + s + version + ".java"; - System.out.println("Attempting to write file -> " + filePath); - writeStringToFile(generatedCode, filePath); - } catch (IOException e) { - e.printStackTrace(); - } - }); - } - - public static void writeStringToFile(String string, String filepath) throws IOException { - BufferedWriter writer = new BufferedWriter(new FileWriter(filepath)); - writer.write(string); - writer.close(); - } - - public static String generateFileContents(ClassOrInterfaceDeclaration oldInterfaceDec, - String commonMethodClassName, - String className, - String packageDeclaration, - NodeList imports, - List fieldDeclarations, - List externalFieldDeclarations, - List methods, - List externalClassNames, - String version) { - - CompilationUnit cu = new CompilationUnit(); - - - cu.setPackageDeclaration(packageDeclaration); - cu.setImports(imports); - cu.addImport("org.hl7.fhir.convertors." + String.format(SRC_FILE_FORMAT, version)); - cu.addImport("org.hl7.fhir.convertors.VersionConvertorConstants"); - if (version.contains("10")) - cu.addImport(String.format(VERSION_CONVERTOR_IMPORT, version.substring(version.indexOf('_') + 1, version.indexOf('_') + 2))); - - ClassOrInterfaceDeclaration generatedClass = cu.addClass(className); - if (fieldDeclarations != null) { - fieldDeclarations.forEach(generatedClass::addMember); - } - - methods.forEach(method -> { - - MethodDeclaration methodDeclaration = generatedClass.addMethod(method.getNameAsString()); - - if (method.getBody().isPresent()) { - BlockStmt blockStmt = method.getBody().get(); - if (externalFieldDeclarations != null) { - blockStmt.accept(new VarAccessChanger(externalFieldDeclarations.stream() - .map(fd -> fd.getVariable(0).getNameAsString()) - .collect(Collectors.toList()), String.format(SRC_FILE_FORMAT, version)), null); - } - List allCalledMethods = getAllCalledMethods(oldInterfaceDec, method); - - allCalledMethods.stream() - .filter(md -> !methods.contains(md)) - .map(NodeWithSimpleName::getNameAsString) - .distinct() - .forEach(methodName -> { - List methodCallExprs = new ArrayList<>(); - blockStmt.accept(new MethodCallVisitor(methodName, true), methodCallExprs); - methodCallExprs.stream() - .distinct() - .forEach(methodCallExpr -> { - methodCallExpr.setName(commonMethodClassName + "." + methodCallExpr.getNameAsString()); - }); - }); - methodDeclaration.setBody(blockStmt); - - } - - methodDeclaration.setParameters(method.getParameters()); - methodDeclaration.setModifiers(method.getModifiers()); - methodDeclaration.addModifier(Modifier.Keyword.STATIC); - methodDeclaration.setModifier(Modifier.Keyword.PRIVATE, false); - methodDeclaration.setModifier(Modifier.Keyword.PUBLIC, true); - methodDeclaration.setThrownExceptions(method.getThrownExceptions()); - methodDeclaration.setType(method.getType()); - methodDeclaration.setTypeParameters(method.getTypeParameters()); - }); - - - generatedClass.walk(node -> { - String identifier = ""; - if (node instanceof NodeWithIdentifier) - if (externalClassNames.contains(((NodeWithIdentifier) node).getIdentifier())) { - ((NodeWithIdentifier) node).setIdentifier(String.format(SRC_FILE_FORMAT, version) + "." + ((NodeWithIdentifier) node).getIdentifier()); - } - }); - - return cu.toString(); - } - - public static Predicate distinctByKey(Function keyExtractor) { - Set seen = ConcurrentHashMap.newKeySet(); - return t -> seen.add(keyExtractor.apply(t)); - } - - private static void recursiveSearchAndAdd(ClassOrInterfaceDeclaration cd, - HashMap methodDeclarationMap, - HashMap fieldDeclarationMap, - List globalStaticFields, - MethodDeclaration key, - String value) { - if (methodDeclarationMap.containsKey(key) && (methodDeclarationMap.get(key).equals(COMMON_FILENAME) || methodDeclarationMap.get(key).equals(value))) - return; - if (key.getName().toString().equals("convertResource")) return; - - addMethodDeclarationToMap(methodDeclarationMap, value, key); - searchAndSortMethodFields(key, value, fieldDeclarationMap, globalStaticFields); - - getAllCalledMethods(cd, key).forEach(md -> { - recursiveSearchAndAdd(cd, methodDeclarationMap, fieldDeclarationMap, globalStaticFields, md, value); - }); - - } - - private static void searchAndSortMethodFields(MethodDeclaration md, - String classKey, - HashMap fieldToClassMap, - List fieldDeclarations) { - - List collector = new ArrayList<>(); - md.accept(new MethodFieldVisitor(), collector); - - md.accept(new VoidVisitorAdapter() { - @Override - public void visit(VarType n, Void arg) { - super.visit(n, arg); - } - }, null); - - List staticFieldLabels = fieldDeclarations.stream() - .map(fd -> fd.getVariable(0).getName().asString()) - .collect(Collectors.toList()); - - collector.stream() - .filter(ne -> staticFieldLabels.contains(ne.getNameAsString())) - .map(ne -> fieldDeclarations.stream() - .filter(fd -> fd.getVariable(0).getName().asString().equals(ne.getNameAsString())) - .findFirst() - .get()) - .forEach(fd -> { - if (!fieldToClassMap.containsKey(fd)) { - fieldToClassMap.put(fd, classKey); - } else if (!fieldToClassMap.get(fd).equals(classKey)) { - fieldToClassMap.put(fd, COMMON_FILENAME); - } - }); - } - - - private static void createDirectory(String path) { - File file = new File(path); - //Creating the directory - boolean bool = file.mkdir(); - if (bool) { - System.out.println("Directory created successfully"); - } else { - System.out.println("Sorry couldn’t create specified directory"); - } - } - - /** - * Attempts to delete the file at the given path.) - * - * @param path - */ - public static void deleteFile(String path) { - File file = new File(path); - if (file.delete()) { - System.out.println("File <" + path + "> deleted successfully"); - } else { - System.out.println("Failed to delete the file <" + path + ">"); - } - } - - /** - * Finds the god method in the given convertor, and parses out all the method calls that method makes. - * - * @param classOrInterfaceDeclaration - * @return - */ - protected static List getListOfParsableTypes(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { - List listOfClassMethods = getListOfClassMethods(KEYWORD_GOD_METHOD, classOrInterfaceDeclaration); - List calledMethods = new ArrayList<>(); - listOfClassMethods.forEach(md -> md.accept(new MethodCallVisitor(KEYWORD_CONVERT), calledMethods)); - return calledMethods; - } - - /** - * Pulls all internal conversion method calls out of the passed in method and maps those calls to the corresponding - * {@link MethodDeclaration} and returns those as a list. - * - * @param classOrInterfaceDeclaration - * @param method - * @return List of all {@link MethodDeclaration} - */ - public static List getAllCalledMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, MethodDeclaration method) { - List result = new ArrayList<>(); - - List methodCallExprs = new ArrayList<>(); - method.accept(new VoidVisitorAdapter>() { - @Override - public void visit(MethodCallExpr methodCallExpr, List collector) { - collector.add(methodCallExpr); - super.visit(methodCallExpr, collector); - } - }, methodCallExprs); - - Set methodExpressionNames = methodCallExprs.stream() - .filter(methodCallExpr -> !methodCallExpr.getScope().isPresent()) - .map(me -> me.getName().toString()) - .collect(Collectors.toSet()); - - classOrInterfaceDeclaration.getMethods().stream() - .filter(e -> methodExpressionNames.contains(e.getName().toString())) - .collect(Collectors.toCollection(() -> result)); - - return result; - } - - /** - * Searches the passed in {@link ClassOrInterfaceDeclaration} for any method declaration matching any of the method - * names in the passed in List. - * - * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} to search - * @param methodNames {@link List} of method names - * @return {@link List } containing any of the keywords - */ - protected static List getTopLevelMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, List methodNames) { - List toReturn = new ArrayList<>(); - methodNames.stream() - .map(s -> getListOfClassMethods(s, classOrInterfaceDeclaration)) - .flatMap(List::stream) - .collect(Collectors.toCollection(() -> toReturn)); - return toReturn; - } - - /** - * Searched the generated declaration map for the matching {@link MethodDeclaration}, if it already exists within the - * map and is not currently pointing the class label we pass in, it will mark it with the {@link Parser#COMMON_FILENAME} - * - * @param className {@link String} class label we want to associate the method with - * @param methodDeclaration {@link MethodDeclaration} - */ - protected static void addMethodDeclarationToMap(HashMap map, - String className, MethodDeclaration methodDeclaration) { - if (!map.containsKey(methodDeclaration)) { - map.put(methodDeclaration, className); - } else if (!map.get(methodDeclaration).equals(className)) { - map.put(methodDeclaration, COMMON_FILENAME); - } - } - - /** - * Returns a list of all java files within the passed in directory path, without extension. - * - * @param path {@link String} filepath - * @return {@link List < String >} of all filenames - */ - protected static List listAllJavaFilesInDirectory(String path) { - List result = new ArrayList<>(); - - try (Stream walk = Files.walk(Paths.get(path))) { - walk.map(Path::toString) - .filter(f -> f.endsWith(".java")) - .map(Parser::pullFileNameFromPath) - .collect(Collectors.toCollection(() -> result)); - } catch (IOException e) { - e.printStackTrace(); - } - - return result; - } - - /** - * Takes the passed in file path and extracts the filename without extension. - * - * @param path - * @return - */ - protected static String pullFileNameFromPath(String path) { - int lastSlashIndex = path.lastIndexOf('/'); - int lastPeriodIndex = path.lastIndexOf('.'); - return path.substring(lastSlashIndex + 1, lastPeriodIndex); - } - - /** - * The parser works by listing method calls within the individual resource conversion methods as - * {@link MethodCallExpr}. To extract the information we need to refactor the code, - * such as method body, references, signature, etc, we rely on the javaparser {@link TypeSolver} to parse the code - * library and convert the expressions to concrete {@link MethodDeclaration}. - *

- * NB. The more source files in the directory you pass in (this will search recursively), the longer the - * MethodDeclaration lookups will take. Be smart, choose S-Mart. - * - * @param rootProjectDirectory - * @param projectDirectory {@link String} path to the directory that contains the souce files we want to be available for - */ - public static void initializeResolver(String rootProjectDirectory, String projectDirectory) throws IOException { - System.out.println("Initializing resolver against the following root directory:\n" + rootProjectDirectory); - System.out.println("Project codebase located here:\n" + projectDirectory); - - TypeSolver myTypeSolver = new CombinedTypeSolver( - new ReflectionTypeSolver(), - new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.convertors/src/main/java/")), - new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.utilities/src/main/java/")), - new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.dstu2/src/main/java/")), - new JavaParserTypeSolver(new File(rootProjectDirectory + "/org.hl7.fhir.dstu3/src/main/java/")), - new JarTypeSolver("/Users/markiantorno/.m2/repository/ca/uhn/hapi/fhir/hapi-fhir-structures-r4/4.1.0/hapi-fhir-structures-r4-4.1.0.jar"), - new JarTypeSolver("/Users/markiantorno/.m2/repository/ca/uhn/hapi/fhir/hapi-fhir-base/4.1.0/hapi-fhir-base-4.1.0.jar") - ); - - JavaSymbolSolver symbolSolver = new JavaSymbolSolver(myTypeSolver); - StaticJavaParser.getConfiguration().setSymbolResolver(symbolSolver); - } - - /** - * Initializes the parser and runs it against the file located at the passed in path. - * - * @param path {@link String} path to the file. - * @return {@link Optional } - */ - public static Optional initializeParser(String path) { - System.out.println("Initializing parser, and parsing the following file:\n" + path); - CompilationUnit compilationUnit = null; - try { - compilationUnit = StaticJavaParser.parse(new File(path)); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - return Optional.ofNullable(compilationUnit); - } - - /** - * Loads a class using the {@link CompilationUnit} passed in and returns the resulting declaration for parsing. This - * class must exist within the directory parsed originally in {@link #initializeParser(String)} - * - * @param cu {@link CompilationUnit} - * @param classname {@link String} The name of the class to load. - * @return {@link Optional } for the named class. - */ - protected static Optional loadClass(CompilationUnit cu, String classname) { - return cu.getClassByName(classname); - } - - /** - * Takes a given {@link MethodCallExpr} and uses the initialized {@link JavaSymbolSolver} to search the source code - * for the appropriate {@link MethodDeclaration}. - * - * @param methodCallExpr {@link MethodCallExpr} - * @return An {@link Optional}, containing the corresponding {@link MethodDeclaration} - */ - protected static Optional resolveMethodDeclaration(MethodCallExpr methodCallExpr) { - MethodDeclaration wrappedDeclaration = null; - ResolvedMethodDeclaration correspondingDeclaration = methodCallExpr.resolve(); - - if (correspondingDeclaration instanceof JavaParserMethodDeclaration) { - JavaParserMethodDeclaration declaration = (JavaParserMethodDeclaration) correspondingDeclaration; - Node wrappedNode = declaration.getWrappedNode(); - wrappedDeclaration = (MethodDeclaration) wrappedNode; - System.out.println(); - } - - return Optional.ofNullable(wrappedDeclaration); - } - - /** - * Takes the content {@link String} passed in, and writes it to a java file with the provided name, in the provided - * directory location. - * - * @param filename Name of the file, including extension, ex: "Book.java" - * @param directory Path to directory to create the file - * @param content {@link String} content of the file - * @throws IOException - */ - public static void writeJavaCodeToFile(String filename, String directory, String content) throws IOException { - BufferedWriter writer = new BufferedWriter(new FileWriter(directory + filename)); - writer.write(content); - writer.close(); - } - - /** - * Returns the list of class methods. - * - * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} - * @return {@link List} of all {@link MethodDeclaration} - */ - protected static List getListOfClassMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { - return getListOfClassMethods("", classOrInterfaceDeclaration); - } - - /** - * Returns the list of class methods containing the passed in method name. - * - * @param methodName {@link String} method name to search for - * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} - * @return {@link List} of all matching {@link MethodDeclaration} - */ - protected static List getListOfClassMethods(String methodName, ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { - List result = new ArrayList<>(); - classOrInterfaceDeclaration.getMethods().stream() - .filter(method -> method.getName().toString().equals(methodName)) - .collect(Collectors.toCollection(() -> result)); - return result; - } - - private static List generateCommentReportData(String filepath) throws FileNotFoundException { - - CompilationUnit cu = StaticJavaParser.parse(new File(filepath)); - - return cu.getAllContainedComments().stream() - .filter(Comment::isOrphan) - .filter(Comment::isLineComment) - .map(p -> new CommentReportEntry(filepath.substring(filepath.lastIndexOf('/') + 1), - p.getClass().getSimpleName(), p.getContent(), p.getRange().get().begin.line, - !p.getCommentedNode().isPresent())) - .collect(Collectors.toList()); - } - - /** - * Class that visits all method calls within a given method and returns the results as a list. - */ - public static class MethodCallVisitor extends VoidVisitorAdapter> { - - private final String keyword; - private final boolean strict; - - public MethodCallVisitor(String keywords) { - super(); - this.keyword = keywords; - this.strict = false; - } - - public MethodCallVisitor(String keywords, boolean strict) { - super(); - this.keyword = keywords; - this.strict = strict; - } - - @Override - public void visit(MethodCallExpr methodCallExpr, List collector) { - if (strict) { - if (methodCallExpr.getName().asString().equals(keyword)) { - collector.add(methodCallExpr); - } - } else { - if (methodCallExpr.getName().asString().contains(keyword)) { - collector.add(methodCallExpr); - } - } - super.visit(methodCallExpr, collector); - } - } - - /** - * Class that visits all method calls within a given method and returns the results as a list. - */ - public static class MethodFieldVisitor extends VoidVisitorAdapter> { - - public MethodFieldVisitor() { - super(); - } - - @Override - public void visit(NameExpr fieldAccessExpr, List collector) { - super.visit(fieldAccessExpr, collector); - collector.add(fieldAccessExpr); - } - } - - /** - * Class that visits all method calls within a given method and returns the results as a list. - */ - public static class VarAccessChanger extends ModifierVisitor { - - private final List varsToAccessInMainFile; - private final String parentClassName; - - public VarAccessChanger(List varsToAccessInMainFile, String parentClassName) { - super(); - this.varsToAccessInMainFile = varsToAccessInMainFile; - this.parentClassName = parentClassName; - } - - @Override - public NameExpr visit(NameExpr nameExpr, Void arg) { - super.visit(nameExpr, arg); - if (varsToAccessInMainFile.contains(nameExpr.getNameAsString())) { - nameExpr.setName(parentClassName + "." + nameExpr.getNameAsString()); - } - return nameExpr; - } - } - - /** - * Class that visits all methods and deletes them if they are in the list of passed in MethodDeclarations - */ - public static class MethodDeleter extends ModifierVisitor { - - private List toDelete; - - public MethodDeleter(List toDelete) { - this.toDelete = toDelete; - } - - @Override - public MethodDeclaration visit(MethodDeclaration md, Void arg) { - super.visit(md, arg); - if (toDelete.contains(md)) { - return null; - } - return md; - } - } - - /** - * Class that visits all methods and deletes them if they are in the list of passed in MethodDeclarations - */ - public static class MethodExposer extends ModifierVisitor { - - private List toModify; - - public MethodExposer(List toModify) { - this.toModify = toModify; - } - - @Override - public MethodDeclaration visit(MethodDeclaration md, Void arg) { - super.visit(md, arg); - if (toModify.contains(md)) { - md.setModifier(Modifier.Keyword.PRIVATE, false); - md.setModifier(Modifier.Keyword.STATIC, true); - md.setModifier(Modifier.Keyword.PUBLIC, true); - } - return md; - } - } - - /** - * Class that visits all calls in calls and changes the access to an external class if it matches one of the passed - * in labels. - */ - public static class MethodStaticCallAdder extends ModifierVisitor { - - private List methodNames; - private String versionCode; - - public MethodStaticCallAdder(List methodNames, String versionCode) { - this.methodNames = methodNames; - this.versionCode = versionCode; - } - - @Override - public MethodCallExpr visit(MethodCallExpr methodCallExpr, Void arg) { - super.visit(methodCallExpr, arg); - if (methodNames.contains(methodCallExpr.getNameAsString())) { - //eg. convertPatient -> Patient30_50.convertPatient - methodCallExpr.setName(methodCallExpr.getNameAsString().replace(KEYWORD_CONVERT, "") - + versionCode + "." + methodCallExpr.getNameAsString()); - } - return methodCallExpr; - } - } - - private static class CommentReportEntry { - public String filename; - public String type; - public String text; - public int lineNumber; - public boolean isOrphan; - - CommentReportEntry(String filename, String type, String text, int lineNumber, - boolean isOrphan) { - this.filename = filename; - this.type = type; - this.text = text; - this.lineNumber = lineNumber; - this.isOrphan = isOrphan; - } - - @Override - public String toString() { - return filename + " | " + lineNumber + " | " + type + " | " + text.replaceAll("\\n", "").trim(); - } - } -} -